error of the BAM files using MetaBAT2

Issue #37 resolved
Holly0929 created an issue

Hi, I am currently using MetaBAT2 for binning genomes from my assembly.fa and sorted BAM files. However, each time I run the command (" jgi_summarize_bam_contig_depths --outputDepth metabatdepth.txt .bam " or "runMetaBat.sh assembly.fa .bam" ), some error message keeps popping up like this:

Warning: SAM 1.3 M not 1.4 =/X and there is no NM aux field. PercentID will be invalid!!! SN1040:128:HY35KBCXY:2:2106:4378:93142_2:N:0:GGACTCCT+TATCCTCT^C

May I know what was wrong? and how to solve this problem?

Thank you.

Comments (3)

  1. Rob Egan

    The issue is that the SAM file does not have enough information to determine the % identity that the read has to the reference and metabat uses this to ignore reads that map, but map poorly, primarily because the read is from a closely related species which happens to be missing from the assembly.

    You can either: 1) map with an aligner that supports the SAM format >= 1.4 (which uses = or X in the cigar string for match and mismatch respectively (instead of M from previous versions of the SAM format which is ambiguous)). bbmap is a my recommendation here.

    2) execute samtools calmd on your SAM file which uses the reference to include the auxiliary fields NM and MD which will allow metabat's tool to calculate the % ID.

    -Rob

  2. Holly0929 reporter

    Thanks a lot for your quick response, Rob Egan. I will try another mapping tool and keep updated with you.

  3. Log in to comment