Verifying BAM Header
0
0
Entering edit mode
23 months ago
sbilobram ▴ 20

Recently some of our BAMs have come through with duplicate SQ tags in the headers. This caused some of the downstream tools to fail. We now want a tool to check that the BAMs' headers conform to SAM/BAM Format specs. The Picard/GATK ValidateSamFile fails on these BAMs but gives an useful error message. The samtools quickcheck does not find this malformation.

IS THERE A TOOL THAT WILL CHECK THAT A BAM HEADER IS VALID?

headers BAM • 1000 views
ADD COMMENT
0
Entering edit mode

The samtools quickcheck does not find this malformation.

samtools quickcheck does not SEARCH this malformation.

ADD REPLY
0
Entering edit mode

IS THERE A TOOL THAT WILL CHECK THAT A BAM HEADER IS VALID?

what's wrong with ValidateSamFile ?

ADD REPLY
0
Entering edit mode

even samtools will display a warning:

samtools view -H toy.bam | awk '/^@SQ/ {print} {print}' |  samtools view -H  > /dev/null
[W::sam_hdr_parse] duplicated sequence 'ref'
[W::sam_hdr_parse] duplicated sequence 'ref2'
ADD REPLY
0
Entering edit mode

yeah this is great but we want to capture any/all mal formed Headers. If I didn't know this header had duplicate SQ tags I wouldnt not have known to search for '/^@SQ/

ADD REPLY
0
Entering edit mode

what do you mean with

but we want to capture any/all mal formed Headers.

just detect the error and dump the header with samtools view -H (?)

ADD REPLY
0
Entering edit mode

We want a tool that would detect any error in the BAM header not just duplicated SQ tags

ADD REPLY
0
Entering edit mode

ValidateSamFile crashes with an error. The error is helpful but the tool does stop running which we dont really want.

ADD REPLY
0
Entering edit mode

I'm sorry but sounds like "the car has no wheels, it's broken, but we want it to drive"

ADD REPLY

Login before adding your answer.

Traffic: 1328 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