From 87d86d6c69769aed4cdc19e211cce5f0f3e1bd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20L=C3=B3pez-Doriga?= Date: Fri, 22 Sep 2023 12:13:44 +0200 Subject: [PATCH] modifying genomicVariations for g_variants in ontology filter scope --- beacon/db/filters.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/beacon/db/filters.py b/beacon/db/filters.py index 354dc4e3..6387751c 100644 --- a/beacon/db/filters.py +++ b/beacon/db/filters.py @@ -93,7 +93,10 @@ def apply_ontology_filter(query: dict, filter: OntologyFilter, collection: str) query_filtering={} query_filtering['$and']=[] dict_scope={} - dict_scope['scope']=collection + if collection == 'g_variants': + dict_scope['scope']='genomicVariations' + else: + dict_scope['scope']=collection query_filtering['$and'].append(dict_scope) dict_id={} dict_id['id']=filter.id @@ -163,7 +166,10 @@ def apply_ontology_filter(query: dict, filter: OntologyFilter, collection: str) query_filtering={} query_filtering['$and']=[] dict_scope={} - dict_scope['scope']=collection + if collection == 'g_variants': + dict_scope['scope']='genomicVariations' + else: + dict_scope['scope']=collection query_filtering['$and'].append(dict_scope) dict_id={} dict_id['id']=filter.id @@ -208,7 +214,10 @@ def apply_ontology_filter(query: dict, filter: OntologyFilter, collection: str) query_filtering={} query_filtering['$and']=[] dict_scope={} - dict_scope['scope']=collection + if collection == 'g_variants': + dict_scope['scope']='genomicVariations' + else: + dict_scope['scope']=collection query_filtering['$and'].append(dict_scope) dict_id={} dict_id['id']=filter.id