From e2f1ade47e57769377ad45120af84fb264ed7411 Mon Sep 17 00:00:00 2001 From: costero-e Date: Fri, 15 Nov 2024 15:36:28 +0100 Subject: [PATCH 1/2] fixing referenceName --- beacon/db/filters.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/beacon/db/filters.py b/beacon/db/filters.py index 0bbb2c2d..cb845a0d 100644 --- a/beacon/db/filters.py +++ b/beacon/db/filters.py @@ -715,7 +715,7 @@ def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collectio #LOG.debug(filter.id) if collection == 'g_variants' and scope != 'individual' and scope != 'run': if filter.id == "identifiers.genomicHGVSId": - list_chromosomes = ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22'] + list_chromosomes = ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','X','Y'] dict_regex={} if filter.value == 'GRCh38': dict_regex['$regex']="11:" @@ -724,7 +724,12 @@ def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collectio elif filter.value == 'NCBI36': dict_regex['$regex']="9:" elif filter.value in list_chromosomes: - dict_regex['$regex']='^NC_0000'+filter.value + if filter.value == 'X': + dict_regex['$regex']='^NC_0000'+'23' + elif filter.value == 'Y': + dict_regex['$regex']='^NC_0000'+'24' + else: + dict_regex['$regex']='^NC_0000'+filter.value elif '>' in filter.value: dict_regex=filter.value elif '.' in filter.value: From 45e7b7452121bdc1be2a88e4db25ac8ad5bae793 Mon Sep 17 00:00:00 2001 From: costero-e Date: Fri, 15 Nov 2024 15:51:42 +0100 Subject: [PATCH 2/2] fixing referenceName --- beacon/db/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon/db/filters.py b/beacon/db/filters.py index cb845a0d..c0a1687a 100644 --- a/beacon/db/filters.py +++ b/beacon/db/filters.py @@ -729,7 +729,7 @@ def apply_alphanumeric_filter(query: dict, filter: AlphanumericFilter, collectio elif filter.value == 'Y': dict_regex['$regex']='^NC_0000'+'24' else: - dict_regex['$regex']='^NC_0000'+filter.value + dict_regex['$regex']='^NC_0000'+filter.value+'.'+'10:g'+'|'+'^NC_0000'+filter.value+'.'+'11:g'+'|'+'^NC_0000'+filter.value+'.'+'9:g' elif '>' in filter.value: dict_regex=filter.value elif '.' in filter.value: