wwood / CoverM

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

Unable to find BAM file when file exists #174

Closed iwilkie closed 11 months ago

iwilkie commented 11 months ago

Hello,

I mapped some reads to a genome of interest, and wanted to use CoverM to get the trimmed_mean value of each read pair.

Having previously used this program in similar scenarios, I ran the coverm genome and got an error message saying that the BAM files could not be found.

$ coverm genome -bam_files /bioinf/home/iwilkie/active_projects/04_verru227_isolate/06.readmapping_TARA/04.BAM/sorted/SORTED-verru227_TARA_worldwide_pair-ERR1701760.bam -f verruco_genome.fa -o test --methods trimmed_mean
[2023-07-05T08:37:17Z INFO  coverm] CoverM version 0.6.1
[2023-07-05T08:37:17Z INFO  coverm] Writing output to file: test
^E[2023-07-05T08:37:20Z INFO  coverm] Using min-covered-fraction 10%
[2023-07-05T08:37:20Z INFO  coverm] Using trim-min 5%
[2023-07-05T08:37:20Z INFO  coverm] Using trim-max 95%
thread 'main' panicked at 'Unable to find BAM file am_files: FileNotFound { path: "am_files" }', src/bam_generator.rs:285:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I've checked again and again, and the files are there and are not empty. I also tried a new installation of CoverM in a new environment just to be sure, but the issue persists. I'm writing this issue page as I haven't been able to find similar issues when using coverm genome, and other solutions don't seem to be working.

For reference, I also tried specifying the genome fa file with -d . -x fa, but still run into the same issue.

Does anybody have any ideas as to what I could try? Thanks in advance!

rhysnewell commented 11 months ago

Hello!

It looks like you've accidentally dropped a - on your --bam-files parameter

I.e. change -bam-files to --bam-files or just -b

Cheers, Rhys

iwilkie commented 11 months ago

Ah thank you so much @rhysnewell, sorry for the oversight on my side!