Check BAMs are complete and clean
2
1
Entering edit mode
8.8 years ago
John 13k

Hello all :)

Is there anyway to check if a BAM file is complete and obeys all the BAM standards?

I have created 100 processed BAMs from 100 unprocessed BAMs, and before I delete the unprocessed data, I'd like to make sure my processed data is OK :)

Of course, there are some things it would be impossible to know was wrong - like I might have mapped all these BAMs to the wrong genome, etc. I'm not looking for those sorts of errors. I'm mainly looking for truncated BAMs, or BAMs where the header doesn't match the read data. It might also be nice to know the reads are sorted properly, but it's not a huge concern.

Alternatively, taking a totally different approach, something like a diff of the BAMs (input/output) to tell me what changed during processing. I can then see if that matches up with what I'd expect.

All the best :)

BAM • 5.6k views
ADD COMMENT
3
Entering edit mode
8.8 years ago
John 13k

Although I did search the forum first, I just googled "BAM diff" and BamUtils popped up. I really should have done that before posting, sorry -_-

Hopefully someone else will find this in a forum search now :)

ADD COMMENT
2
Entering edit mode
8.8 years ago

picard ValidateSamFile

Validates a SAM or BAM file. This tool reports on the validity of a SAM or BAM file relative to the SAM format specification (see http://samtools.github.io/hts-specs/SAMv1.pdf), which is useful for troubleshooting errors encountered with other tools that may be caused by improper formatting.

By default, the tool runs in VERBOSE mode and will exit after finding 100 errors and output them to the console (stdout). It is often practical to start by running this tool with the SUMMARY mode option, which summarizes the "errors" and "warnings". Consequently, specific validation warnings or errors that are of lesser concern can be ignored using the IGNORE and/or IGNORE_WARNINGS arguments in order to focus on blocking errors.

ADD COMMENT
0
Entering edit mode

Oh thats perfect, since I'm already using Picard for everything else :) Thanks Pierre!

ADD REPLY

Login before adding your answer.

Traffic: 2107 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6