This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Program to calculate and add the NM tag to a bam file

Does anybody know of a program to add the NM tag (number of mismatches) to a BAM file?

Usually aligned BAM files come with that tag, but I've found one without it and need that information.

Thanks!

bam nm

Hello

I've created an alignment (SAM and subsequently BAM file) using samtools. However, when I'm trying to create an index out of the BAM file I get the following message:

[E::hts_idx_push] Region 536876664..536876746 cannot be stored in a bai index. Try using a csi index with min_shift = 14, n_lvls >= 6

I have no clue what that means so any help would be much appreciated

Thanks

1 answer

samtools calmd <aln.bam> <ref.fasta>

Log in to answer this question.