diff --git a/src/clj_hgvs/repairer.cljc b/src/clj_hgvs/repairer.cljc index f0268d2..ec76d7d 100644 --- a/src/clj_hgvs/repairer.cljc +++ b/src/clj_hgvs/repairer.cljc @@ -276,6 +276,15 @@ (string/replace s #"extTer(\?|\d+)$" "ext*$1") s)) +;; p.S733_*734insS -> p.*734Sext*? +(defn ^:no-doc ins->ext + [s kind] + (if (= kind :protein) + (string/replace s + #"[A-Z](\d+_\*)(\d+)ins([A-Z]+[a-z]*)" + "*$2$3ext*?") + s)) + (def built-in-repairers "The built-in repair functions. @@ -323,4 +332,5 @@ remove-fs-greater protein-ter-substitution->ext frameshift->ext - ext-ter->downstream]) + ext-ter->downstream + ins->ext]) diff --git a/test/clj_hgvs/core_test.cljc b/test/clj_hgvs/core_test.cljc index 2a7a071..926b7a8 100644 --- a/test/clj_hgvs/core_test.cljc +++ b/test/clj_hgvs/core_test.cljc @@ -364,7 +364,10 @@ "p.*833fs" "p.*833ext*?" ;; ext-ter->downstream - "p.Ter397ThrextTer?" "p.Ter397Thrext*?") + "p.Ter397ThrextTer?" "p.Ter397Thrext*?" + + ;; ext->ins + "p.S733_*734insS" "p.*734Sext*?") (are [s] (let [s* (hgvs/repair-hgvs-str s)] (and (= s* s) (some? (hgvs/parse s*))))