walaj / VariantBam

Filtering and profiling of next-generational sequencing data using region-specific rules
Other
74 stars 10 forks source link

Crash (Signal 11) when trying to process an unsorted BAM #2

Closed maplesond closed 8 years ago

maplesond commented 8 years ago

A crash (Signal 11) occurs when trying to process an unsorted BAM. The software could check the SAM header to see if the file is file is not-sorted up before processing and provide a useful error message if this is the case.

walaj commented 8 years ago

Hi Daniel, Could you provide the command that you used to get this error? I can't re-create, so it could be specific to a certain filter set.

maplesond commented 8 years ago

Here's the command line: "variant bowtie2.bam -m 100 -o b2_mc100.bam"

It worked fine after I sorted bowtie2.bam with samtools.

walaj commented 8 years ago

OK I see the issue, it is segfaulting when trying to downsample to a certain coverage, which for that filter expects a sorted BAM. I'll fix to have it give a more informative error before I close this thread.

Edit: I added a heuristic check for a sorted BAM, that will cause it to give a useful error message if it sees an unsorted BAM when trying to downsample. Updated the documentation to indicate that sorted BAMs are required for these filters.

walaj commented 8 years ago

I have updated the code to include both the heuristic sort-check and a check of the SAM header. Thank you for noticing this!