bam has improper refpos + oplen BAM stage

Issue #73 resolved
Former user created an issue

Hello All,

I have encountered the following error when using metabat2

"bam has improper refpos + oplen"

I am using a different alignment program than bowtie2, I have included a SAM map and header as well as the command I have used.

kart -i final.contigs.fa -t 20 -f ../BatsR1.fastq -f2 ../BatsR2.fastq -o Batsout.sam samtools sort -@ 40 -m 15G Batsout.sam -o BatsoutSorterd.bam

The sorted bam appears to be indexable. Its a very large sorted bam (205GB)

First 3 Sam lines: @PG ID:kart PN:Kart VN:2.5.2 @SQ SN:k127_40996742 LN:228 @SQ SN:k127_31462622 LN:304

SAM Example Alignments:

SRRSRR1000000.86023842 141 * 0 0 * * 0 0 TTACATTTGATATTTTGGATCAGGCCTTATATCAAGCTTAAGATGGAAGAGTTCATATCTTAGGATTATTGAATATAGCATTATCTGCCTCTTGAGCAGATGTTGGAAATCATACTCCAAAAATGGAAAATATTAATGTTGATAAAAATG AE6EEEAA66//AA/6////66/E//E<6/A//EA/EE/A/A/A/<6A<EEE///A</<//EE<6//E/<E</A///A/AEEEAA/AA/A6//</EA/E/EEE/EEEAA//EEA6E//EEEEEE//<EAE/AEE/EA/EE/EEE////// AS:i:0 XS:i:0 SRRSRR1000000.86023843 99 k127_54009573 202 60 37S19M14S = 202 70 GGTCCCAACATGTCCCAAGATGGCCCCAATGGAAACATAGCATTGGTATTGGAGTAGCAATAATAATAGT A/AAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEEEEEEEAEAE NM:i:51 AS:i:19 XS:i:18 SRRSRR1000000.86023843 147 k127_54009573 202 60 37S19M14S = 202 -70 GGTCCCAACATGTCCCAAGATGGCCCCAATGGAAACATAGCATTGGTATTGGAGTAGCAATAATAATAGT EE/EEEEEA/E//AEE6E///EEEEEEEE/AEAEE/A/E/EEEEEE/E/E/E///E/EEE/EEEEAAAAA NM:i:51 AS:i:19 XS:i:18 SRRSRR1000000.86023844 99 k127_45184135 240 60 67M = 240 67 GGATTGAATAATAGTCGCTACATATTAAAACTCTTAGTAATCTTATTAACATTCTTTATTTTATGGC AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE NM:i:4 AS:i:63 XS:i:0 SRRSRR1000000.86023844 147 k127_45184135 240 60 67M = 240 -67 GGATTGAATAATAGTCGCTACATATTAAAACTCTTAGTAATCTTATTAACATTCTTTATTTTATGGC <EEEEEEEEEEEEE6EEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEAAAAA NM:i:4 AS:i:63 XS:i:0

Comments (5)

  1. Brian Couger

    I was able to index the bam, so I believe it is properly sorted. I used the anaconda install for software installation.

  2. Brian Couger

    It completed the stage, It was a minority of reads that had this, might be worth noting if other people chose to use kart for alingment

  3. Rob Egan

    So, I have a few comments.

    1. The anaconda build is not provided by us so I believe it is out of date, please use the version from docker hub (metabat/metabat:latest) or build directly
    2. Our tool is indicating that the alignments from kcart seem to be wrong or at least incorrectly formatted and you might want to open up a ticket with them. Specifically the alignment’s cigar indicates that the alignment of the read has matches that extend off of the end of the reference sequence. If you include the reads that triggered the warning and the corresponding @SQ reference lines from the bam I can help show what is inconsistent.
    3. The reads that triggered the warning are skipped, so If it is just a minority of reads, then it will likely have no impact on the resulting bins.
  4. Brian Couger

    Hi Rob,

    Thanks fort the reply, I was able to make bins off the reads, the reads mentioned were a fairly small minority (couple hundred thousand of 3 billion total. I am rerunning the assemblies for other reason, when I bin them again I might switch to bbmap as recommended in protocol.

    Many Thanks,

    Brian

  5. Log in to comment