wwood / CoverM

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

May be a bug with parameter “--no-zeros” #115

Closed PandengWang closed 1 year ago

PandengWang commented 2 years ago

Hi Woodcroft,

Thanks for providing this so useful tool!

I encountered an strange error as follows:

coverm contig -m mean -b T2U9-fl.bam --min-covered-fraction 70 -o test_c70 --no-zeros -t 10 [2022-05-17T08:06:18Z INFO coverm] CoverM version 0.6.1 [2022-05-17T08:06:18Z INFO coverm] Writing output to file: test_c70 [2022-05-17T08:06:18Z INFO coverm] Using min-covered-fraction 70% [2022-05-17T08:07:44Z INFO coverm::contig] In sample 'T2U9-fl', found 0 reads mapped out of 100154834 total (0.00%) thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/coverage_printer.rs:467:35 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

coverm contig -m mean -b T2U9-fl.bam --min-covered-fraction 70 -o test_c70 -t 10 [2022-05-17T08:09:31Z INFO coverm] CoverM version 0.6.1 [2022-05-17T08:09:31Z INFO coverm] Writing output to file: test_c70 [2022-05-17T08:09:31Z INFO coverm] Using min-covered-fraction 70% [2022-05-17T08:11:04Z INFO coverm::contig] In sample 'T2U9-fl', found 83293193 reads mapped out of 100154834 total (83.16%)

Do you have any tips to solve this problem?

Best, Pandeng Wang

wwood commented 2 years ago

Hi,

Seems like a good question. Are you able to provide a small example dataset I can use to reproduce this?

PandengWang commented 2 years ago

Hi,

It could be easy to reproduce this error. Under contig mode, just keep all other prameters be same and only change the parameter "--no-zeros", we will get different results (the number of mapped reads).

If you can not reproduce this error using other bam files, I will provide you mine.

Thanks!

wwood commented 1 year ago

Hi again,

Sorry I tried on some of the test datasets, and didn't have any luck reproducing. Can you transfer me the file somehow please? Thanks.

PandengWang commented 1 year ago

Hi, You can download my bam file through the following url link: https://drive.google.com/file/d/1VpWSThBTrend-10ItYRSmrw4qgGW_xxI/view?usp=sharing

Thanks.

wwood commented 1 year ago

Hello. Thanks for this. Took me a while, but believe this bug is now fixed in main. Let me know if not.