Skip to content

Commit

Permalink
Avoid trying to re-align and normalize very long indels which cause c…
Browse files Browse the repository at this point in the history
…ause null pointer errors. These are dealt with by structural variation comparions. Thanks to Severine Catreux
  • Loading branch information
chapmanb committed May 18, 2014
1 parent 4a7d38e commit 6d04ff4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject bcbio.variation "0.1.6"
(defproject bcbio.variation "0.1.7-SNAPSHOT"
:description "Toolkit to analyze genomic variation data, built on the GATK with Clojure"
:license {:name "MIT" :url "http://www.opensource.org/licenses/mit-license.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
Expand All @@ -21,8 +21,8 @@
[org.simpleframework/simple-xml "2.0.4"]
[org.apache.servicemix.bundles/org.apache.servicemix.bundles.jets3t "0.8.1_1"]
;;
[org.biojava/biojava3-core "3.0.4"]
[org.biojava/biojava3-alignment "3.0.4"]
[org.biojava/biojava3-core "3.0.8"]
[org.biojava/biojava3-alignment "3.0.8"]
[org.clojars.chapmanb/circdesigna "0.0.2" :exclusions [net.sf.beaver/beaver-ant]]
[nz.ac.waikato.cms.weka/weka-stable "3.6.6"]
[org.clojars.chapmanb/fast-random-forest "0.98"]
Expand Down
11 changes: 8 additions & 3 deletions src/bcbio/variation/complex.clj
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
(defn- get-vc-alleles [vc]
(vec (map #(.getDisplayString %) (cons (:ref-allele vc) (:alt-alleles vc)))))

(defn is-multi-indel?
"Identify complex indels that can be split into multiple calls."
(defn- is-multi-indel?
"Identify complex indels that can be split into multiple calls.
Caps indels we can operate on at 5000bp to avoid realignment errors for longer."
[vc]
(letfn [(monomorphic-alleles? [vc]
(= 1 (->> (get-vc-alleles vc)
Expand All @@ -44,8 +45,12 @@
(not (monomorphic-alleles? vc))))
(has-ref-padding-mismatch? [vc]
(let [alleles (get-vc-alleles vc)]
(not= (nth (first alleles) 0) (nth (second alleles) 0))))]
(not= (nth (first alleles) 0) (nth (second alleles) 0))))
(splittable-size? [vc]
(< (apply max (map count (get-vc-alleles vc)))
5000))]
(and (= "INDEL" (:type vc))
(splittable-size? vc)
(or (has-multiple-nonref-alleles? vc)
(has-ref-padding-mismatch? vc)))))

Expand Down

0 comments on commit 6d04ff4

Please sign in to comment.