Skip to content

Commit

Permalink
Provide better debugging of failures during VCF cleaning: #18
Browse files Browse the repository at this point in the history
  • Loading branch information
chapmanb committed Sep 7, 2014
1 parent 0259c73 commit 9c99d4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Move to latest MIT licensed GATK release: 3.2
- Library updates and fixes to work with java 1.8
- Improve debugging output for failed lines during pre-clean step.

## 0.1.7 (23 July 2014)

Expand Down
13 changes: 10 additions & 3 deletions src/bcbio/variation/normalize.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
[bcbio.run.fsp :as fsp]
[bcbio.run.itx :as itx]
[bcbio.variation.structural :as structural]
[bcbio.variation.variantcontext :as gvc]))
[bcbio.variation.variantcontext :as gvc]
[taoensso.timbre :as timbre]))

;; ## Chromosome name remapping

Expand Down Expand Up @@ -589,12 +590,18 @@
remove-incorrect-qual
(remove-bad-ref get-ref-base)
(maybe-add-indel-pad-base ref-file get-ref-base)
(string/join "\t"))))]
(string/join "\t"))))
(debug-clean-line [line]
(try
(clean-line line)
(catch Exception e
(timbre/error e (str "Problem cleaning line: " line))
(System/exit 1))))]
(when (itx/needs-run? out-file)
(itx/with-tx-file [tx-out-file out-file]
(with-open [rdr (zipsafe-reader in-vcf-file)
wtr (writer tx-out-file)]
(doall
(map #(.write wtr (str % "\n"))
(remove empty? (map clean-line (line-seq rdr))))))))
(remove empty? (map debug-clean-line (line-seq rdr))))))))
out-file)))

0 comments on commit 9c99d4e

Please sign in to comment.