Skip to content

Commit

Permalink
wip: rm gnomad vcf deletions
Browse files Browse the repository at this point in the history
consider them delins
  • Loading branch information
korikuzma committed Aug 9, 2023
1 parent 39e00a9 commit 68545b6
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 244 deletions.
57 changes: 57 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,34 @@ def genomic_del1_seq_loc():
"type": "SequenceLocation",
}

@pytest.fixture(scope="session")
def genomic_del1():
"""Create test fixture containing params for genomic del VD."""
params = {
"id": "normalize.variation:NC_000003.12%3Ag.10149811del",
"type": "VariationDescriptor",
"variation_id": "",
"variation": dict(),
"molecule_context": "genomic",
"structural_type": "SO:0000159",
"vrs_ref_allele_seq": "T",
}
return params


@pytest.fixture(scope="session")
def genomic_del1_lse(genomic_del1, genomic_del1_seq_loc):
"""Create a test fixture for genomic del LSE."""
_id = "ga4gh:VA.jUeT1n4AuBzwtt5TT-Iaac1KasATWjKE"
genomic_del1["variation_id"] = _id
genomic_del1["variation"] = {
"type": "Allele",
"_id": _id,
"location": genomic_del1_seq_loc,
"state": {"type": "LiteralSequenceExpression", "sequence": ""},
}
return VariationDescriptor(**genomic_del1)


@pytest.fixture(scope="session")
def genomic_del1_38_cn(genomic_del1_seq_loc):
Expand Down Expand Up @@ -428,6 +456,35 @@ def genomic_del2_seq_loc():
}


@pytest.fixture(scope="session")
def genomic_del2():
"""Create test fixture containing params for genomic del VD."""
params = {
"id": "normalize.variation:NC_000003.12%3Ag.10146595_10146613del",
"type": "VariationDescriptor",
"variation_id": "",
"variation": dict(),
"molecule_context": "genomic",
"structural_type": "SO:0000159",
"vrs_ref_allele_seq": "ATGTTGACGGACAGCCTAT",
}
return params


@pytest.fixture(scope="session")
def genomic_del2_lse(genomic_del2, genomic_del2_seq_loc):
"""Create a test fixture for genomic del LSE."""
_id = "ga4gh:VA.CSWNhR5w_geMmJTxkbO3UCLCvT0S2Ypx"
genomic_del2["variation_id"] = _id
genomic_del2["variation"] = {
"type": "Allele",
"_id": _id,
"location": genomic_del2_seq_loc,
"state": {"type": "LiteralSequenceExpression", "sequence": ""},
}
return VariationDescriptor(**genomic_del2)


@pytest.fixture(scope="session")
def genomic_del2_38_cn(genomic_del2_seq_loc):
"""Create test fixture for copy number count del1 on GRCh38"""
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/classifiers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ genomic_delins:
- query: 3-37050340-AAAAGCTTTA-GAGGCTTT
- query: 16-68846036-AG-TGAGTTT
- query: X-70350063-AG-AGGCAGCGCATAAAGCGCATTCTCCG
- query: Y-1313-ATTGAC-a
- query: chr1-2-ca-C
- query: 1-55509715-AC-A
should_not_match:
- query: N_000017.10:c.1423_1424delinsGT
- query: g.1423delinsX
Expand Down Expand Up @@ -151,9 +154,6 @@ genomic_deletion:
- query: NC_000004.11:g.55593610_55593615delTTGTTG
- query: NC_000003.11:g.10183645del
- query: NC_000003.11:g.10188302delG
- query: Y-1313-ATTGAC-a
- query: chr1-2-ca-C
- query: 1-55509715-AC-A
should_not_match:
- query: GENE g.152419920_152419921delinsAG
- query: GENE g.152419920_152419921delAinsG
Expand Down
27 changes: 27 additions & 0 deletions tests/fixtures/translators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,33 @@ genomic_delins:
"type": "Allele"
}
]
- query: 17-7578455-CGCGG-CGCG
variations: [
{
"_id": "ga4gh:VA.BFl5Ja-FnzlReimbu_eRTfcyvXHZbjUC",
"type": "Allele",
"location": {
"_id": "ga4gh:VSL.KEPjHEPUVfIwk8R8xyluX8IW5-9pY6TE",
"type": "SequenceLocation",
"sequence_id": "ga4gh:SQ.AjWXsI7AkTK35XW9pgd3UbjpC3MAevlz",
"interval": {
"type": "SequenceInterval",
"start": {
"type": "Number",
"value": 7578457
},
"end": {
"type": "Number",
"value": 7578459
}
}
},
"state": {
"type": "LiteralSequenceExpression",
"sequence": "G"
}
}
]

protein_deletion:
tests:
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/validators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ genomic_delins:
- query: 3-37050340-AAAAGCTTTA-GAGGCTTT
- query: 16-68846036-AG-TGAGTTT
- query: X-70350063-AG-AGGCAGCGCATAAAGCGCATTCTCCG
- query: 16-2138199-GTGAG-G
- query: 1-55509715-AC-A
should_not_match:
- query: NC_000023.21:g.32386323delinsGA
- query: NC_000007.13:g.159138664delinsAT
Expand All @@ -123,6 +125,8 @@ genomic_delins:
- query: 3-37050340-AAAAGCGTTA-GAGGCTTT
- query: 16-68846036-AC-TGAGTTT
- query: X-70350063-CC-AGGCAGCGCATAAAGCGCATTCTCCG
- query: 1-55509715-TC-A
- query: 16-2138199-GTGAT-G

protein_deletion:
should_match:
Expand Down Expand Up @@ -160,13 +164,9 @@ genomic_deletion:
- query: NC_000003.12:g.10146527_10146528del
- query: NC_000003.11:g.10191495delT
- query: VHL g.10188279_10188297del
- query: 16-2138199-GTGAG-G
- query: 1-55509715-AC-A
should_not_match:
- query: NC_000003.11:g.10191454654654654495delT
- query: NC_000003.11:g.10188297_10188279del
- query: 1-55509715-TC-A
- query: 16-2138199-GTGAT-G

protein_insertion:
should_match:
Expand Down
11 changes: 9 additions & 2 deletions tests/test_gnomad_vcf_to_protein.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"""Module for testing gnomad_vcf_to_protein works correctly"""
from copy import deepcopy

import pytest
from ga4gh.vrsatile.pydantic.vrsatile_models import VariationDescriptor

from tests.conftest import assertion_checks
from variation.gnomad_vcf_to_protein_variation import dna_to_rna
from variation.schemas.classification_response_schema import SequenceOntology


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -347,16 +350,20 @@ async def test_insertion(test_handler, protein_insertion, protein_insertion2):
async def test_deletion(test_handler, protein_deletion_np_range, cdk11a_e314del):
"""Test that deletion queries return correct response"""
resp = await test_handler.gnomad_vcf_to_protein("17-39723966-TTGAGGGAAAACACAT-T")
expected = deepcopy(protein_deletion_np_range)
expected.structural_type = SequenceOntology.DELINS
assertion_checks(
resp.variation_descriptor,
protein_deletion_np_range,
expected,
"17-39723966-TTGAGGGAAAACACAT-T",
ignore_id=True,
)
assert resp.warnings == []

resp = await test_handler.gnomad_vcf_to_protein("1-1708855-TTCC-T")
assertion_checks(resp.variation_descriptor, cdk11a_e314del, "1-1708855-TTCC-T")
expected = deepcopy(cdk11a_e314del)
expected.structural_type = SequenceOntology.DELINS
assertion_checks(resp.variation_descriptor, expected, "1-1708855-TTCC-T")
assert resp.warnings == []


Expand Down
76 changes: 0 additions & 76 deletions tests/test_hgvs_dup_del_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,35 +884,6 @@ def genomic_dup6_free_text_rse_lse(genomic_dup6_free_text):
return VariationDescriptor(**params)


@pytest.fixture(scope="module")
def genomic_del1():
"""Create test fixture containing params for genomic del VD."""
params = {
"id": "normalize.variation:NC_000003.12%3Ag.10149811del",
"type": "VariationDescriptor",
"variation_id": "",
"variation": dict(),
"molecule_context": "genomic",
"structural_type": "SO:0000159",
"vrs_ref_allele_seq": "T",
}
return params


@pytest.fixture(scope="module")
def genomic_del1_lse(genomic_del1, genomic_del1_seq_loc):
"""Create a test fixture for genomic del LSE."""
_id = "ga4gh:VA.jUeT1n4AuBzwtt5TT-Iaac1KasATWjKE"
genomic_del1["variation_id"] = _id
genomic_del1["variation"] = {
"type": "Allele",
"_id": _id,
"location": genomic_del1_seq_loc,
"state": {"type": "LiteralSequenceExpression", "sequence": ""},
}
return VariationDescriptor(**genomic_del1)


@pytest.fixture(scope="module")
def genomic_del1_cn(genomic_del1, genomic_del1_38_cn):
"""Create a test fixture for genomic del copy number count."""
Expand Down Expand Up @@ -1036,36 +1007,6 @@ def genomic_del1_free_text_rse(genomic_del1_free_text, genomic_del1_free_text_se
genomic_del1_free_text["variation_id"] = _id
return VariationDescriptor(**genomic_del1_free_text)


@pytest.fixture(scope="module")
def genomic_del2():
"""Create test fixture containing params for genomic del VD."""
params = {
"id": "normalize.variation:NC_000003.12%3Ag.10146595_10146613del",
"type": "VariationDescriptor",
"variation_id": "",
"variation": dict(),
"molecule_context": "genomic",
"structural_type": "SO:0000159",
"vrs_ref_allele_seq": "ATGTTGACGGACAGCCTAT",
}
return params


@pytest.fixture(scope="module")
def genomic_del2_lse(genomic_del2, genomic_del2_seq_loc):
"""Create a test fixture for genomic del LSE."""
_id = "ga4gh:VA.CSWNhR5w_geMmJTxkbO3UCLCvT0S2Ypx"
genomic_del2["variation_id"] = _id
genomic_del2["variation"] = {
"type": "Allele",
"_id": _id,
"location": genomic_del2_seq_loc,
"state": {"type": "LiteralSequenceExpression", "sequence": ""},
}
return VariationDescriptor(**genomic_del2)


@pytest.fixture(scope="module")
def genomic_del2_cn(genomic_del2, genomic_del2_38_cn):
"""Create a test fixture for genomic del copy number count."""
Expand Down Expand Up @@ -2419,14 +2360,6 @@ async def test_genomic_del1(
resp.variation_descriptor, genomic_del1_free_text_lse, q, ignore_id=True
)

# gnomad vcf
q = "3-10149810-CT-C" # 38
resp = await test_handler.normalize(q)
assertion_checks(resp.variation_descriptor, genomic_del1_lse, q, ignore_id=True)

resp = await test_handler.normalize(q, HGVSDupDelModeOption.COPY_NUMBER_COUNT)
assertion_checks(resp.variation_descriptor, genomic_del1_lse, q, ignore_id=True)

# Invalid
invalid_queries = [
"NC_000003.11:g.198022431del",
Expand Down Expand Up @@ -2513,15 +2446,6 @@ async def test_genomic_del2(
resp.variation_descriptor, genomic_del2_free_text_default, q, ignore_id=True
)

# gnomad vcf
q = "3-10146594-AATGTTGACGGACAGCCTAT-A"
resp = await test_handler.normalize(q, HGVSDupDelModeOption.DEFAULT)
assertion_checks(resp.variation_descriptor, genomic_del2_lse, q, ignore_id=True)

q = "3-10188278-AATGTTGACGGACAGCCTAT-A"
resp = await test_handler.normalize(q)
assertion_checks(resp.variation_descriptor, genomic_del2_lse, q, ignore_id=True)

# Invalid
invalid_queries = [
"NC_000003.12:g.10146595_198295580del",
Expand Down
Loading

0 comments on commit 68545b6

Please sign in to comment.