wwood / CoverM

Read coverage calculator for metagenomics
GNU General Public License v3.0
273 stars 30 forks source link

thread 'main' panicked at 'index out of bounds: the len is 6564 but the index is 6586' #175

Closed haleyhallowell closed 11 months ago

haleyhallowell commented 11 months ago

Hello! I am a long-time user of CoverM but have ran into an error that i have not encountered before, and i'm not sure what is going wrong here. I am running the code here:

home/hhallow1/scratch4-jsuez1/week12_virome/coverm-x86_64-unknown-linux-musl-0.6.1/coverm contig --min-covered-fraction 0 --min-read-aligned-length-pair 250 --min-read-percent-identity-pair 95 --proper-pairs-only -m count -t 12 -b mappings/*_vOTUs.sort.bam -o all_coverm_95pid_250rlen_pair_counts.txt

*.bam files were sorted and indexed (created with bowtie2)

And this is the output from coverM:

[2023-07-06T16:07:02Z INFO coverm] CoverM version 0.6.1 [2023-07-06T16:07:02Z INFO coverm] Using min-read-percent-identity-pair 95% [2023-07-06T16:07:02Z INFO coverm] Writing output to file: all_coverm_95pid_250rlen_pair_counts.txt [2023-07-06T16:07:02Z INFO coverm] Using min-covered-fraction 0% thread 'main' panicked at 'index out of bounds: the len is 6564 but the index is 6586', /project/src/contig.rs:174:29

Any help is appreciated! Thanks!

wwood commented 11 months ago

Hi,

That's a new one. It seems there is an issue with the CIGAR string.

Can you please try running

RUST_LOG=trace /home/hhallow1/scratch4-jsuez1/week12_virome/coverm-x86_64-unknown-linux-musl-0.6.1/coverm contig --min-covered-fraction 0 --min-read-aligned-length-pair 250 --min-read-percent-identity-pair 95 --proper-pairs-only -m count -t 12 -b mappings/*_vOTUs.sort.bam -o all_coverm_95pid_250rlen_pair_counts.txt 2>trace.log

That will likely generate a very large trace.log file, but can you please email that to me, or link it here on a GitHub gist or something? If it is too big then just send the last 1000 lines.

THanks, ben

haleyhallowell commented 11 months ago

Sending the log to your gmail in a few!

haleyhallowell commented 11 months ago

Solved 😊. I had duplicate header/sequences in my file and when bowtie aligned it removed those from the output. I removed those duplicate sequences from my .fna file and rebuilt the bowtie2 db, reran the code and was able to get coverm working!

wwood commented 11 months ago

Good news. Thanks for sharing the solution back.