Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions htsget_server/beacon_openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ paths:
- $ref: '#/components/parameters/genomicAlleleShortForm'
- $ref: '#/components/parameters/geneId'
- $ref: '#/components/parameters/filters'
- $ref: '#/components/parameters/fullSearch'
responses:
'200':
$ref: '#/components/responses/ResultsOKResponse'
Expand Down Expand Up @@ -202,6 +203,12 @@ components:
type: array
items:
type: string
fullSearch:
in: query
name: fullSearch
description: Set to true if a full beacon search is desired; default is to return estimated variant count.
schema:
type: boolean
geneId:
example: BRAF
in: query
Expand Down Expand Up @@ -709,6 +716,9 @@ components:
- requestedGranularity
RequestParameters:
properties:
fullSearch:
description: Set to true if full search of files is desired
type: boolean
alternateBases:
$ref: '#/components/schemas/AlternateBases'
aminoacidChange:
Expand Down
12 changes: 9 additions & 3 deletions htsget_server/beacon_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def get_search(
variant_max_length=None,
allele=None,
gene_id=None,
filters=None
filters=None,
full_search=False
):
req = {
"includeResultsetResponses": include_result_set_responses,
Expand Down Expand Up @@ -115,6 +116,8 @@ def get_search(
req['query']['requestParameters']['variant_max_length'] = variant_max_length
if variant_min_length is not None:
req['query']['requestParameters']['variant_min_length'] = variant_min_length
if full_search:
req['query']['requestParameters']['full_search'] = True

try:
result = search(req)
Expand Down Expand Up @@ -274,8 +277,11 @@ def search(raw_req):
"meta": meta,
"authed_programs": authed_programs
}
queue_id = add_to_queue(search_json)
response["beaconResultUrl"] = f"{HTSGET_URL}/beacon/v2/result/{queue_id}"

# only send to queue if a full search was requested:
if 'full_search' in actual_params and actual_params['full_search'] == True:
queue_id = add_to_queue(search_json)
response["beaconResultUrl"] = f"{HTSGET_URL}/beacon/v2/result/{queue_id}"

# set up quick beacon results:
response["estimatedSearchParameters"] = {
Expand Down