Discard Alignment With Mismatches From A Bam File
1
2
Entering edit mode
12.5 years ago

Hi,

Is it possible to discard alignment with mismatches from a bam file ? and to specify the maximum allowed mismatches ?

Thanks,

N.

bam • 4.0k views
ADD COMMENT
1
Entering edit mode
12.5 years ago

Mismatch allowances should really have been done during the mapping step. I would recommend you to remap the reads.

If you can't remap it, you can parse your file to remove alignments by looking at a couple of things. This can all be found in the SAM file specifications (http://samtools.sourceforge.net/SAM1.pdf):

-If your mapper outputs the optional MD tag in one of the last fields, that will tell you the positions of the mismatches

-The CIGAR string could potentially tell you the number of mismatches, however not all mappers fully use the CIGAR characters.

Also make sure the alignment entry is mapped in the first place by checking if the 0x4 bit of the flag is not set.

ADD COMMENT
0
Entering edit mode

Yes, I think I will remap my reads. I wondered just if a tool that parse a bam file to discard mismatched reads existed

ADD REPLY

Login before adding your answer.

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