Skip to content

Commit 30755de

Browse files
committed
fix: add extension conditional branch to insertion
1 parent 4847fa7 commit 30755de

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/varity/vcf_to_hgvs/protein.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,18 @@
464464
(or (and (zero? nprefo) (zero? npalto))
465465
(and (= nprefo 1) (= npalto 1))) :substitution
466466
(and prefer-deletion? (pos? nprefo) (zero? npalto)) :deletion
467-
(and prefer-insertion? (zero? nprefo) (pos? npalto)) :insertion
467+
(and prefer-insertion? (zero? nprefo) (pos? npalto)) (if first-diff-aa-is-ter-site
468+
:extension
469+
:insertion)
468470
(and (some? unit) (= ref-repeat 1) (= alt-repeat 2)) :duplication
469471
(and (some? unit) (pos? alt-repeat)) :repeated-seqs
470472
(and (pos? nprefo) (zero? npalto)) :deletion
471473
(and (pos? nprefo) (pos? npalto)) (if (= base-ppos 1)
472474
:extension
473475
:indel)
474-
(and (zero? nprefo) (pos? npalto)) :insertion
476+
(and (zero? nprefo) (pos? npalto)) (if first-diff-aa-is-ter-site
477+
:extension
478+
:insertion)
475479
:else (throw (ex-info "Unsupported variant" {:type ::unsupported-variant})))]
476480
{:type (if (= t :fs-ter-substitution) :substitution t)
477481
:pos base-ppos

test/varity/vcf_to_hgvs_test.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@
344344
"chr1" 47438996 "T" "TCCGCAC" {:prefer-insertion? false} '("p.P286_H287[5]")
345345
"chr1" 47438996 "T" "TCCGCAC" {:prefer-insertion? true} '("p.H293_A294insPH")
346346

347-
;; prefer-insertion?, not actual example (+)
348-
"chr1" 26773690 "C" "CGCAGCA" {:prefer-insertion? true} '("p.Q1334_R1335insQQ")
347+
;; prefer-insertion?
348+
"chr1" 26773690 "C" "CGCAGCA" {:prefer-insertion? true} '("p.Q1334_R1335insQQ") ;; not actual example (+)
349+
"chr10" 103089678 "T" "TTCC" {:prefer-insertion? true} '("p.*562Eext*1") ;; not actual example (-)
349350

350351
;; prefer-extension-for-initial-codon-alt?
351352
"chr10" 121593814 "CCATGGT" "C" {:prefer-extension-for-initial-codon-alt? true} '("p.M1Vext-17") ;; not actual example (-)

0 commit comments

Comments
 (0)