diff --git a/pipeline/clinvar/clinvar_common.py b/pipeline/clinvar/clinvar_common.py index 4008e3ebe..84efaec4a 100644 --- a/pipeline/clinvar/clinvar_common.py +++ b/pipeline/clinvar/clinvar_common.py @@ -41,13 +41,17 @@ def findUniqueElement(name, parent): return(child) - -#def build_xpath_filter_for_cv_assertions(gene_symbols): -## symbols_str = [ f'text()="{s}"' for s in gene_symbols] ### HERE -# symbols_pred = ' or '.join(symbols_str) +# +# This function is outdated (11/25/2024), but is currently part of an +# ENIGMA unit test +# +def build_xpath_filter_for_cv_assertions(gene_symbols): + symbols_str = [ f'text()="{s}"' for s in gene_symbols] ### HERE + symbols_pred = ' or '.join(symbols_str) # filter assertion if it contains a Symbol we are interested in -# return f"ReferenceClinVarAssertion/MeasureSet/Measure/MeasureRelationship/Symbol/ElementValue[({symbols_pred}) and @Type=\"Preferred\"]" + return f"ReferenceClinVarAssertion/MeasureSet/Measure/MeasureRelationship/Symbol/ElementValue[({symbols_pred}) and @Type=\"Preferred\"]" + def extractSynonyms(el): include_types = {'ProteinChange3LetterCode', 'ProteinChange1LetterCode', @@ -89,9 +93,9 @@ def extract_genomic_coordinates_from_location(loc): ) # if no reference/alternate allele found, compute (assuming genomic coordinates # are either present for all assemblies or for none) - #if not coords: - # coords = _extract_genomic_coordinates_from_non_genomic_fields(meas_el) - return coords +# if not coords: +# coords = _extract_genomic_coordinates_from_non_genomic_fields(meas_el) +# return coords def _preprocess_element_value(var_str): diff --git a/pipeline/clinvar/test_clinvar.py b/pipeline/clinvar/test_clinvar.py index f9e998585..1ea803317 100644 --- a/pipeline/clinvar/test_clinvar.py +++ b/pipeline/clinvar/test_clinvar.py @@ -17,7 +17,7 @@ def test_simple_genomic_coordinate_extraction(): """ - measure_el = ET.fromstring(sample_measure) + location_el = ET.fromstring(sample_location) genomic_coords = clinvar_common.extract_genomic_coordinates_from_location(location_el) @@ -34,7 +34,7 @@ def test_genomic_coordinate_extraction_from_NM(): """ measure_el = ET.fromstring(sample_measure) - genomic_coords = clinvar_common.extract_genomic_coordinates_from_measure(measure_el) + genomic_coords = clinvar_common._extract_genomic_coordinates_from_non_genomic_fields(measure_el) assert genomic_coords[hgvs_utils.HgvsWrapper.GRCh38_Assem] == variant_utils.VCFVariant(13, 32340945, "CTG", "C")