Skip to content

Commit

Permalink
Trim off stray whitespace in BED file input to handle problematic lin…
Browse files Browse the repository at this point in the history
…e breaks. #24
  • Loading branch information
chapmanb committed Jan 15, 2015
1 parent bd7af84 commit e977673
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject bcbio.variation "0.2.2"
(defproject bcbio.variation "0.2.3-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 Down
5 changes: 3 additions & 2 deletions src/bcbio/align/ref.clj
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@
(let [ref-map (get-seq-name-map ref-file)
is-tab? (with-open [rdr (reader bed-file)]
(.contains (first (drop-while #(.startsWith % "track") (line-seq rdr))) "\t"))]
(fn [line]
(fn [raw-line]
(when-not (.startsWith line "track")
(let [parts (if is-tab?
(let [line (string/trimr raw-line)
parts (if is-tab?
(string/split line #"\t")
(string/split line #" "))]
(let [[chr start end] (take 3 parts)]
Expand Down

0 comments on commit e977673

Please sign in to comment.