Skip to content

Commit

Permalink
add tests for braf v600e + egfr l858r
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Oct 16, 2023
1 parent cc07039 commit 7e5cf4f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
15 changes: 11 additions & 4 deletions cool_seq_tool/mappers/mane_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,21 @@ def _get_mane_p(mane_data: Dict, mane_c_pos_range: Tuple[int, int]) -> Dict:
:return: MANE transcripts accessions and position change on
p. coordinate
"""
start = mane_c_pos_range[0] / 3
end = mane_c_pos_range[1] / 3

if start == end:
start = math.floor(start)
end = start
else:
start = math.ceil(start)
end = math.floor(end)

return dict(
gene=mane_data["symbol"],
refseq=mane_data["RefSeq_prot"],
ensembl=mane_data["Ensembl_prot"],
pos=(
math.ceil(mane_c_pos_range[0] / 3),
math.floor(mane_c_pos_range[1] / 3),
),
pos=(start, end),
strand=mane_data["chr_strand"],
status=TranscriptPriority(
"_".join(mane_data["MANE_status"].split()).lower()
Expand Down
16 changes: 14 additions & 2 deletions tests/mappers/test_mane_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,20 @@ async def test_g_to_mane_c(


@pytest.mark.asyncio
async def test_grch38_to_mane_p(test_mane_transcript, mybpc3_s236g):
"""Test that grch38_to_mane_p"""
async def test_grch38_to_mane_p(
test_mane_transcript, braf_v600e_mane_p, egfr_l858r_mane_p, mybpc3_s236g
):
"""Test that grch38_to_mane_p works correctly"""
resp = await test_mane_transcript.grch38_to_mane_p(
"NC_000007.14", 140753336, 140753336, gene="BRAF"
)
assert resp == braf_v600e_mane_p

resp = await test_mane_transcript.grch38_to_mane_p(
"NC_000007.14", 55191822, 55191822
)
assert resp == egfr_l858r_mane_p

# https://www.ncbi.nlm.nih.gov/clinvar/variation/922707/?new_evidence=true
# Without gene
resp = await test_mane_transcript.grch38_to_mane_p(
Expand Down

0 comments on commit 7e5cf4f

Please sign in to comment.