Skip to content

Commit 658026a

Browse files
committed
fix: fix protein-extension condition
1 parent 1663bc4 commit 658026a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/varity/vcf_to_hgvs/protein.clj

+6-4
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,12 @@
428428
pref-only
429429
palt-only)
430430
ini-site-affected (ini-site-affected? ref-exon-seq alt-exon-seq)
431+
first-diff-aa-is-ter-site (first-diff-aa-is-ter-site? base-ppos
432+
ref-prot-seq
433+
alt-prot-seq*)
431434
t (cond
432-
ref-include-from-ter-start-and-over-ter-end :frame-shift
435+
(and ref-include-from-ter-start-and-over-ter-end
436+
(not first-diff-aa-is-ter-site)) :frame-shift
433437
(= (+ base-ppos offset) (count ref-prot-seq)) (if (and (= "" pref-only palt-only)
434438
(ter-site-same-pos? ref-prot-seq alt-prot-seq*))
435439
:no-effect
@@ -455,9 +459,7 @@
455459
(= palt (subs pref 0 (count palt))))
456460
(= (first palt-only) \*)) :fs-ter-substitution
457461
ref-include-ter-site :indel
458-
(first-diff-aa-is-ter-site? base-ppos
459-
ref-prot-seq
460-
alt-prot-seq*) :extension
462+
first-diff-aa-is-ter-site :extension
461463
:else :frame-shift)
462464
(or (and (zero? nprefo) (zero? npalto))
463465
(and (= nprefo 1) (= npalto 1))) :substitution

test/varity/vcf_to_hgvs_test.clj

+2
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@
280280
"chr11" 125655318 "TGA" "TAT" '("p.*477Yext*17" "p.*443Yext*17" "p.*477Yext*24")
281281
"chr10" 8074014 "C" "CATGGGTT" '("p.*445Yext*64" "p.*444Yext*64") ; not actual example (+)
282282
"chr10" 87965468 "TC" "T" '("p.*404Eext*11" "p.*577Eext*11" "p.*207Eext*11") ; not actual example (+)
283+
"chrX" 15823239 "ATAA" "A" '("p.*483Text*?") ; not actual example (+)
284+
"chr13" 24421118 "CTTA" "C" '("p.*1725Vext*2") ; not actual example (-)
283285
;; NOTE: There are very few correct examples...
284286

285287
;; Extension without termination site

0 commit comments

Comments
 (0)