Skip to content

Commit

Permalink
scope genomicVariation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Apr 11, 2024
1 parent e02e21e commit 8de90b5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions beacon/db/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ def apply_ontology_filter(query: dict, filter: OntologyFilter, collection: str,


scope = filter.scope
if scope is None:
if scope is None and collection != 'g_variants':
scope = collection[0:-1]
elif scope is None:
scope = 'genomicVariation'
LOG.debug(scope)
is_filter_id_required = True
# Search similar
Expand Down Expand Up @@ -653,8 +655,10 @@ def format_operator(operator: Operator) -> str:
def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collection: str) -> dict:
#LOG.debug(filter.value)
scope = filter.scope
if scope is None:
if scope is None and collection != 'g_variants':
scope = collection[0:-1]
elif scope is None:
scope = 'genomicVariation'
formatted_value = format_value(filter.value)
formatted_operator = format_operator(filter.operator)
#LOG.debug(collection)
Expand Down Expand Up @@ -890,8 +894,10 @@ def apply_custom_filter(query: dict, filter: CustomFilter, collection:str) -> di
#LOG.debug(query)

scope = filter.scope
if scope is None:
if scope is None and collection != 'g_variants':
scope = collection[0:-1]
elif scope is None:
scope = 'genomicVariation'
value_splitted = filter.id.split(':')
if value_splitted[0] in conf.alphanumeric_terms:
query_term = value_splitted[0]
Expand Down

0 comments on commit 8de90b5

Please sign in to comment.