CoverM icon indicating copy to clipboard operation
CoverM copied to clipboard

bam_generator] Failed to correctly find or parse BAM file at "/tmp/coverm_fifo.wyqhN9T2ujOl/foo.pipe"

Open Hollyhlp opened this issue 2 years ago • 5 comments

When using coverM, I met the following problem. May I know how to solve it? Thank you.

2022-08-02T06:51:55Z INFO coverm::mapping_index_maintenance] Generating BWA_MEM index for /tmp/.tmpzfBZeD .. [2022-08-02T07:14:01Z INFO coverm::mapping_index_maintenance] Finished generating BWA_MEM index. [2022-08-02T07:14:03Z ERROR coverm::bam_generator] Failed to correctly find or parse BAM file at "/tmp/coverm_fifo.wyqhN9T2ujOl/foo.pipe": unable to open SAM/BAM/CRAM file at /tmp/coverm_fifo.wyqhN9T2ujOl/foo.pipe [2022-08-02T07:14:03Z ERROR coverm::bam_generator] Error when running mapping process. Exitstatus was ExitStatus(ExitStatus(256)). Command run was: ["bash -c "set -e -o pipefail; bwa mem -t 90 '/tmp/coverm-mapping-index.bqpqp1GxhiZ7/.tmpzfBZeD' '/data3/QITA/lp/D2/WWTP_DNA/BLG_8/READ_QC/BLG0/final_pure_reads_1.fastq' '/data3/QITA/lp/D2/WWTP_DNA/BLG_8/READ_QC/BLG0/final_pure_reads_2.fastq' 2>/tmp/.tmpFbdRW4 | samtools sort -T '/tmp/coverm_fifo.wyqhN9T2ujOl/coverm-make-samtools-sortwotEcW' -l0 -@ 89 2>/tmp/.tmp8zezSg > "/tmp/coverm_fifo.wyqhN9T2ujOl/foo.pipe"""] [2022-08-02T07:14:03Z ERROR coverm::bam_generator] The STDERR for the BWA_MEM part was: [bns_restore_core] Parse error reading /tmp/coverm-mapping-index.bqpqp1GxhiZ7/.tmpzfBZeD.amb

[2022-08-02T07:14:03Z ERROR coverm::bam_generator] The STDERR for the samtools sort part was: samtools sort: failed to read header from "-"

[2022-08-02T07:14:03Z ERROR coverm::bam_generator] Cannot continue since mapping failed.

Hollyhlp avatar Aug 02 '22 07:08 Hollyhlp

And here is the command I used:

coverm genome --coupled /data3/final_pure_reads_1.fastq /data3//final_pure_reads_2.fastq --genome-fasta-directory /data3/HLP/srenamed/ -o B-DNA-abundance/B0-count -m count --min-read-aligned-percent 0.75 --min-read-percent-identity 0.95 --min-covered-fraction 0 -p bwa-mem -t 90

Hollyhlp avatar Aug 02 '22 07:08 Hollyhlp

Hi Holly,

Thanks for including the command you used. I think this might already be fixed in the code in the repo, but just not released.

Are you able to try that? Alternatively you could try making your own BWA MEM index and then specifying that as -r ?

wwood avatar Aug 08 '22 00:08 wwood

Hi, was this issue ever solved? I am getting the same error but only for one file out of several hundred that were successful.

nvpatin avatar Jun 20 '23 16:06 nvpatin

Hello,

I would just check and make sure that your tmp drive isn't running out space when you run your coverm command. Try re-running your command with TMPDIR=/drive/with/lots/of/space coverm ... and see if the error still persists.

Cheers, Rhys

rhysnewell avatar Jun 22 '23 02:06 rhysnewell

Hi,

Just to add some extra info. I was getting this same error and it was caused by accidently misnaming my input sample files. Once I ensured the command was pointing to the correct files it worked fine.

Cheers, Laura

Somebodyatthdoor avatar Jul 11 '23 14:07 Somebodyatthdoor