BradnerLab/pipeline — pull request #34 by jdimatteo (2014-09-02 04:38:49+00:00)
Title: Exclude bad regions

Implemented skipping regions that are invalid for either of these two reasons:

1. chromosomes is not in the bam file (i.e. as reported by samtools idxstats)
2. the start/stop range is not within the reference chromosome sequence length (again as reported by samtools idxstats)

If the region is invalid, "WARNING	Excluding invalid region..." will be logged and the region will be excluded from the calculated region records.

If bam_parse_region still somehow fails when neither of these conditions are met, the program aborts with an error code. I don't think that should ever happen though (and if it did, probably something was really wrong, in which case aborting probably makes sense).