Skip to content

Commit

Permalink
Separate complex nucleotide variants from other variants
Browse files Browse the repository at this point in the history
  • Loading branch information
alumi committed May 20, 2019
1 parent 7b324be commit 0270bf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/cljam/io/vcf/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
:ref (subs ref left-match (- ref-length right-match)),
:alt (subs alt left-match (- alt-length right-match))}

:else {:type :other})))
:else {:type :complex})))

(defn inspect-allele
"Inspects an `alt` allele by comparing to a `ref` allele string.
Expand All @@ -342,7 +342,8 @@
- `:deletion` Deletion of a short base sequence
- `:complete-insertion` Complete insertion of a long sequence
- `:breakend` Breakend of a complex rearrangement
- `:other` The variant is too complex or malformed"
- `:complex` Complex nucleotide variants other than snv/mnv/indel
- `:other` Can't categorize the allele, might be malformed"
[ref alt]
(let [alt-length (count alt)]
(cond
Expand Down
10 changes: 5 additions & 5 deletions test/cljam/io/vcf/util_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@

"T" "<ctg1>CT" {:type :other} ;; invalid
"T" "<CT" {:type :other} ;; invalid

"." "A" {:type :other}
"TAC" "GC" {:type :other}
"TG" "TAC" {:type :other}
"TCA" "GGGG" {:type :other}
"AAAA" "CAC" {:type :other}))

"TAC" "GC" {:type :complex}
"TG" "TAC" {:type :complex}
"TCA" "GGGG" {:type :complex}
"AAAA" "CAC" {:type :complex}))

0 comments on commit 0270bf5

Please sign in to comment.