deepTools icon indicating copy to clipboard operation
deepTools copied to clipboard

deepTools reports it cannot find an existing file, if it is truncated

Open cviner opened this issue 4 years ago • 2 comments

This issue has some similarity to other reports of a BAM file being reported to not exist, when it does.

Here is an example of this error:

bamCompare -b1 SRR3705515-abra2.bam -b2 SRR3705515.bam -o log2ratio.bw

Reports:

The file 'SRR3705515-abra2.bam' does not exist

This BAM file is truncated, as reported via SAMtools:

samtools flagstat SRR3705515-abra2.bam
[W::bam_hdr_read] EOF marker is absent. The input is probably truncated

Use of non-truncated BAM files does not cause this error. This error also appears, with at least bamCoverage.

It would be useful if deepTools instead output an informative error message, like SAMtools. It would also be nice if there was a way to ignore this error, and merely output a truncation warning.


deeptools --version : 3.5.1 python --version : 2.7.16 python3 --version : 3.9.7

MacBook, with M1 chip; MacOS Big Sur (fuily-updated).

cviner avatar Sep 29 '21 14:09 cviner

I'm not sure if pysam returns a useful error indicator in this case. Can you check what happens with the following?

python -c "import pysam; bam = pysam.AlignmentFile('SRR3705515-abra2.bam'); print(bam);"

dpryan79 avatar Sep 30 '21 09:09 dpryan79

Unfortunately not. Apologies, but I no longer have a truncated BAM file to test with.

Thanks for looking into this!

-- Coby

On Sep 30, 2021, 11:40 AM +0200, Devon Ryan @.***>, wrote:

I'm not sure if pysam returns a useful error indicator in this case. Can you check what happens with the following? python -c "import pysam; bam = pysam.AlignmentFile('SRR3705515-abra2.bam');" — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

cviner avatar Sep 30 '21 09:09 cviner