diff --git a/civicpy/data/test_cache.pkl b/civicpy/data/test_cache.pkl index 450b92e..1b9d000 100644 Binary files a/civicpy/data/test_cache.pkl and b/civicpy/data/test_cache.pkl differ diff --git a/civicpy/exports/civic_gks_record.py b/civicpy/exports/civic_gks_record.py index c8adcf1..bc1a34f 100644 --- a/civicpy/exports/civic_gks_record.py +++ b/civicpy/exports/civic_gks_record.py @@ -343,6 +343,7 @@ def _get_variant_concept_mapping(variant: GeneVariant) -> ConceptMapping: relation=Relation.RELATED_MATCH, ) for clinvar_id in clinvar_ids + if clinvar_id and clinvar_id != "N/A" ) for a in molecular_profile.aliases: diff --git a/civicpy/tests/test_exports.py b/civicpy/tests/test_exports.py index 31e096e..cdf9308 100644 --- a/civicpy/tests/test_exports.py +++ b/civicpy/tests/test_exports.py @@ -687,6 +687,19 @@ def test_get_extensions(self, v600e_mp): ) assert expressions is None + def test_na_clinvar_mapping(self, v600e_mp): + """Test that get_aliases_and_mappings method works as expected when no clinvar entry found""" + variant = v600e_mp.variants[0] + + with patch.object(variant, "clinvar_entries", new=["N/A"]): + gks_mp = CivicGksMolecularProfile(v600e_mp) + _, mappings = gks_mp.get_aliases_and_mappings(v600e_mp) + assert mappings + assert not any( + m.coding.system == "https://www.ncbi.nlm.nih.gov/clinvar/variation/" + for m in mappings + ) + class TestCivicGksTherapyGroup(object): """Test that CivicGksTherapyGroup works as expected"""