Skip to content

Commit c2d6841

Browse files
committed
fix: include amino acid alleles in get_allele_registry_associations function
1 parent 295bda7 commit c2d6841

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/mavedb/lib/clingen/services.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,11 @@ def get_allele_registry_associations(
367367

368368
# Extract the CAID from the URL (e.g., "http://reg.test.genome.network/allele/CA2513066" -> "CA2513066")
369369
caid = registration["@id"].split("/")[-1]
370-
alleles = registration.get("genomicAlleles", []) + registration.get("transcriptAlleles", [])
370+
alleles = (
371+
registration.get("genomicAlleles", [])
372+
+ registration.get("transcriptAlleles", [])
373+
+ registration.get("aminoAcidAlleles", [])
374+
)
371375

372376
for allele in alleles:
373377
for hgvs_string in content_submissions:

tests/lib/clingen/test_services.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def test_dispatch_submissions_failure(self, mock_auth_url, mock_put, car_service
332332

333333

334334
def test_get_allele_registry_associations_success():
335-
content_submissions = ["NM_0001:c.1A>G", "NM_0002:c.2T>C"]
335+
content_submissions = ["NM_0001:c.1A>G", "NM_0002:c.2T>C", "NM_0003:c.3G>A"]
336336
submission_response = [
337337
{
338338
"@id": "http://reg.test.genome.network/allele/CA123",
@@ -344,9 +344,15 @@ def test_get_allele_registry_associations_success():
344344
"genomicAlleles": [],
345345
"transcriptAlleles": [{"hgvs": "NM_0002:c.2T>C"}],
346346
},
347+
{
348+
"@id": "http://reg.test.genome.network/allele/CA789",
349+
"genomicAlleles": [],
350+
"transcriptAlleles": [],
351+
"aminoAcidAlleles": [{"hgvs": "NM_0003:c.3G>A"}],
352+
},
347353
]
348354
result = get_allele_registry_associations(content_submissions, submission_response)
349-
assert result == {"NM_0001:c.1A>G": "CA123", "NM_0002:c.2T>C": "CA456"}
355+
assert result == {"NM_0001:c.1A>G": "CA123", "NM_0002:c.2T>C": "CA456", "NM_0003:c.3G>A": "CA789"}
350356

351357

352358
def test_get_allele_registry_associations_empty():
@@ -367,7 +373,7 @@ def test_get_allele_registry_associations_no_match():
367373
assert result == {}
368374

369375

370-
def test_get_allele_registry_associations_with_errors(caplog):
376+
def test_get_allele_registry_associations_with_errors():
371377
content_submissions = ["NM_0001:c.1A>G", "NM_0002:c.2T>C"]
372378
submission_response = [
373379
{

0 commit comments

Comments
 (0)