Skip to content

Commit 4847fa7

Browse files
authored
Merge pull request #116 from chrovis/fix/fix-around-ter-codon-protein-variant
2 parents bf3dff0 + ceeedf9 commit 4847fa7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/varity/vcf_to_hgvs/protein.clj

+5-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
@@ -650,6 +650,9 @@
650650
(every? empty? [del ins])
651651
(mut/protein-no-effect)
652652

653+
(= 1 (count del) (count ins))
654+
(protein-substitution ppos* pref* palt* seq-info)
655+
653656
(empty? del)
654657
(protein-insertion ppos* pref* palt* seq-info)
655658

test/varity/vcf_to_hgvs_test.clj

+2
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
"chr17" 31159027 "TGC" "T" '("p.A75*") ; not actual example (+, nonsense in del case)
202202
"chr2" 47478341 "TG" "T" '("p.L762*" "p.L696*") ;; rs786204050 (+) frameshift with termination
203203
"chr17" 7676202 "T" "TGTCCCTTAGTCTT" '("p.P58*" "p.P19*") ; cf. not actual example (-, frameshift with termination)
204+
"chr13" 24421115 "TGACTTAGCC" "T" '("p.G1724K") ; not actual example (-, del includes termination codon)
204205

205206
;; deletion
206207
"chr1" 240092288 "AGTC" "A" '("p.S61del") ; cf. rs772088733 (+)
@@ -282,6 +283,7 @@
282283
"chr10" 87965468 "TC" "T" '("p.*404Eext*11" "p.*577Eext*11" "p.*207Eext*11") ; not actual example (+)
283284
"chrX" 15823239 "ATAA" "A" '("p.*483Text*?") ; not actual example (+)
284285
"chr13" 24421118 "CTTA" "C" '("p.*1725Vext*2") ; not actual example (-)
286+
"chrX" 15823235 "CCAAA" "C" '("p.*483Lext*?") ; not actual example (+)
285287
;; NOTE: There are very few correct examples...
286288

287289
;; Extension without termination site

0 commit comments

Comments
 (0)