Skip to content

Commit 9688edf

Browse files
authored
Merge pull request #363 from CanDIG/stable-candidate
v5.0.0: File Download, Sequencing Support
2 parents a040d66 + 4e68276 commit 9688edf

21 files changed

+888
-570
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
DB_PATH: localhost
1515
SERVER_LOCAL_DATA: ${{github.workspace}}/data
1616
PGPASSWORD: OG0pjmnQDWUTvLotYrxPrg
17-
INDEXING_PATH: ${{github.workspace}}/tmp
17+
INDEXING_PATH: ${{github.workspace}}/tmp/indexer
18+
SEARCH_PATH: ${{github.workspace}}/tmp/search
1819
INDEXING_SWITCH_FILE: ${{github.workspace}}/indexer_on
1920
TESTENV_URL: http://localhost:3000
2021
AGGREGATE_COUNT_THRESHOLD: 5
@@ -52,12 +53,15 @@ jobs:
5253
pip install -r requirements.txt
5354
bash create_db.sh
5455
mkdir -p ${{ env.INDEXING_PATH }}
56+
mkdir -p ${{ env.SEARCH_PATH }}/results
57+
mkdir -p ${{ env.SEARCH_PATH }}/to_search
5558
touch ${{ env.INDEXING_SWITCH_FILE }}
5659
sed -i s@\<AGGREGATE_COUNT_THRESHOLD\>@${{env.AGGREGATE_COUNT_THRESHOLD}}@ config.ini
5760
sed -i s@\<POSTGRES_USERNAME\>@${{env.POSTGRES_USERNAME}}@ config.ini
5861
- name: Test
5962
run: |
6063
python htsget_server/server.py &
6164
python htsget_server/indexing.py &
65+
python htsget_server/search.py &
6266
sleep 5
6367
pytest tests/test_htsget_server.py

create_db.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ psql --quiet -h "$db" -U $PGUSER -d genomic -a -f data/pr_288.sql >>setup_out.tx
4343
psql --quiet -h "$db" -U $PGUSER -d genomic -a -f data/pr_315.sql >>setup_out.txt
4444
psql --quiet -h "$db" -U $PGUSER -d genomic -a -f data/pr_339.sql >>setup_out.txt
4545
psql --quiet -h "$db" -U $PGUSER -d genomic -a -f data/pr_341.sql >>setup_out.txt
46+
psql --quiet -h "$db" -U $PGUSER -d genomic -a -f data/pr_352.sql >>setup_out.txt
4647
echo "...done"

data/files.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CREATE TABLE drs_object (
1717
description VARCHAR,
1818
aliases VARCHAR,
1919
program_id VARCHAR,
20+
meta_data JSONB,
2021
PRIMARY KEY (id),
2122
FOREIGN KEY(program_id) REFERENCES program (id)
2223
);

data/files/counts.tsv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
gene_id transcript_id(s) length effective_length expected_count TPM FPKM
2+
ENSG00000000003.15 ENST00000373020.8,ENST00000494424.1,ENST00000496771.5,ENST00000612152.4,ENST00000614008.4 2000.22 1008.6 150.00 6.24 7.32
3+
ENSG00000000003.16 ENST00000373020.8,ENST00000494424.1,ENST00000496771.5,ENST00000612152.4,ENST00000614008.4 2000.22 1008.6 150.00 6.24 9.32

data/files/counts2.tsv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
gene_id abundance counts length countsFromAbundance
2+
ENSG00000000003 41.459314 1984.82025 3312.70606925252 no
3+
ENSG00000000005 10.857373 13.2324342 1049.23423423242 no

data/pr_352.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- add the metadata column if it doesn't already exist
2+
DO
3+
$$
4+
BEGIN
5+
ALTER TABLE drs_object ADD COLUMN IF NOT EXISTS meta_data jsonb;
6+
END;
7+
$$;

entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ if [[ -f "initial_setup" ]]; then
1212
sed -i s@\<POSTGRES_USERNAME\>@$POSTGRES_USERNAME@ config.ini
1313

1414
bash create_db.sh
15-
mkdir $INDEXING_PATH
15+
mkdir -p $INDEXING_PATH
16+
mkdir -p $SEARCH_PATH/results
17+
mkdir -p $SEARCH_PATH/to_search
1618
touch $INDEXING_SWITCH_FILE
1719
rm initial_setup
1820
fi
@@ -24,6 +26,7 @@ candigv2_logging.logging.initialize()"
2426
#python3 htsget_server/server.py
2527

2628
bash htsget_server/indexing.sh &
29+
bash htsget_server/search.sh &
2730

2831
# use the following instead for production deployment
2932
cd htsget_server

htsget_server/beacon_openapi.yaml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,25 @@ paths:
109109
description: Successful operation
110110
tags:
111111
- Informational endpoints
112+
/result/{queue_id}:
113+
parameters:
114+
- in: path
115+
required: true
116+
name: queue_id
117+
schema:
118+
type: string
119+
get:
120+
description: Get full Beacon result for a search
121+
operationId: beacon_operations.get_full_result
122+
responses:
123+
'200':
124+
description: OK
125+
content:
126+
application/json:
127+
schema:
128+
$ref: "#/components/schemas/BeaconResultsetsResponseBody"
129+
'404':
130+
description: Not Found
112131
/g_variants:
113132
get:
114133
description: Search for variants
@@ -262,7 +281,7 @@ components:
262281
oneOf:
263282
- $ref: "#/components/schemas/BeaconBooleanResponseBody"
264283
- $ref: "#/components/schemas/BeaconCountResponseBody"
265-
- $ref: "#/components/schemas/BeaconResultsetsResponseBody"
284+
- $ref: "#/components/schemas/BeaconSearchResponseBody"
266285
description: Successful operation.
267286
BeaconErrorResponse:
268287
description: An unsuccessful operation.
@@ -325,6 +344,22 @@ components:
325344
- meta
326345
- responseSummary
327346
type: object
347+
BeaconSearchResponseBody:
348+
description: Beacon quick search result
349+
properties:
350+
info:
351+
$ref: '#/components/schemas/Info'
352+
meta:
353+
$ref: '#/components/schemas/BeaconResponseMeta'
354+
response:
355+
$ref: '#/components/schemas/QuickSearchResult'
356+
responseSummary:
357+
$ref: '#/components/schemas/BeaconSummaryResponseSection'
358+
required:
359+
- meta
360+
- responseSummary
361+
- response
362+
type: object
328363
BeaconResultsetsResponseBody:
329364
description: Beacon response that includes record level details, grouped in Resultsets.
330365
properties:
@@ -448,7 +483,7 @@ components:
448483
type: object
449484
HandoverType:
450485
type: object
451-
description: in our context, only htsget urls should be returned
486+
description: in our context, only htsget or download urls should be returned
452487
properties:
453488
id:
454489
type: string
@@ -458,6 +493,7 @@ components:
458493
type: string
459494
enum:
460495
- HTSGET
496+
- DOWNLOAD
461497
IncludeResultsetResponses:
462498
default: HIT
463499
description: Indicator of whether responses from every Resultset should be included in the response to this request or just the ones with positive, negative results or no details at all. If null (not specified), the default value of 'HIT' is assumed. This parameter allows for returning boolean/counting results although the Beacon instance is capable to return record level details.
@@ -603,6 +639,23 @@ components:
603639
- resultSets
604640
title: Beacon ResultSet
605641
type: object
642+
QuickSearchResult:
643+
description: Result with initial estimated data and a link to full Beacon result
644+
type: object
645+
properties:
646+
beaconResultUrl:
647+
type: string
648+
estimatedResults:
649+
type: array
650+
items:
651+
type: object
652+
properties:
653+
analysisId:
654+
type: string
655+
programId:
656+
type: string
657+
variantCount:
658+
type: integer
606659
BeaconCountResponseSection:
607660
description: Payload definition for the "count" response.
608661
properties:
@@ -884,6 +937,7 @@ components:
884937
type: string
885938
genotype:
886939
type: object
940+
description: based on suggested modification at https://github.com/ga4gh-beacon/beacon-v2/issues/57#issuecomment-1452561660
887941
properties:
888942
zygosity:
889943
$ref: '#/components/schemas/OntologyTerm'

0 commit comments

Comments
 (0)