Skip to content

Commit bea83d3

Browse files
committed
fix: include amino acid alleles in get_allele_registry_associations function
1 parent ccd93b3 commit bea83d3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/mavedb/lib/clingen/services.py

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

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

374378
for allele in alleles:
375379
for hgvs_string in content_submissions:

tests/lib/clingen/test_services.py

Lines changed: 8 additions & 2 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():

0 commit comments

Comments
 (0)