Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added a repairer for protein insertion to extension #4

Merged
merged 1 commit into from
May 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/clj_hgvs/repairer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -323,4 +332,5 @@
remove-fs-greater
protein-ter-substitution->ext
frameshift->ext
ext-ter->downstream])
ext-ter->downstream
ins->ext])
5 changes: 4 additions & 1 deletion test/clj_hgvs/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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*))))
Expand Down