Skip to content

Commit ceeedf9

Browse files
committed
fix: fix termination codon position in extension
1 parent c161a91 commit ceeedf9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/varity/vcf_to_hgvs/protein.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@
590590
(mut/protein-unknown-mutation)
591591

592592
:else
593-
(let [[_ ins offset _] (diff-bases (or pref "") (or palt ""))
593+
(let [[_ ins _ _] (diff-bases (or pref "") (or palt ""))
594594
ini-site ((comp str first) ref-prot-seq)
595595
first-diff-aa-info (if (= ppos 1)
596596
{:ppos 1
@@ -612,7 +612,7 @@
612612
(if (and (= ppos 1) (= alt-aa "Ter"))
613613
(mut/protein-unknown-mutation)
614614
(mut/protein-extension (if (= ppos 1) (mut/->long-amino-acid ini-site) "Ter")
615-
(coord/protein-coordinate (if (= ppos 1) 1 (+ ppos offset)))
615+
(coord/protein-coordinate (if (= ppos 1) 1 (:ppos first-diff-aa-info)))
616616
alt-aa
617617
(if (= ppos 1) :upstream :downstream)
618618
(if new-aa-pos

test/varity/vcf_to_hgvs_test.clj

+1
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283
"chr10" 87965468 "TC" "T" '("p.*404Eext*11" "p.*577Eext*11" "p.*207Eext*11") ; not actual example (+)
284284
"chrX" 15823239 "ATAA" "A" '("p.*483Text*?") ; not actual example (+)
285285
"chr13" 24421118 "CTTA" "C" '("p.*1725Vext*2") ; not actual example (-)
286+
"chrX" 15823235 "CCAAA" "C" '("p.*483Lext*?") ; not actual example (+)
286287
;; NOTE: There are very few correct examples...
287288

288289
;; Extension without termination site

0 commit comments

Comments
 (0)