Error "Failed to read from standard input: unknown file type" with Gzipped BAM Files
I’m using bcftools (v. 1.20) for variant calling with mpileup and bcftools call, but I’m encountering the following error message: "Failed to read from standard input: unknown file type".
I’m using the -b bam_files.txt option, which includes a list of my BAM files (e.g., a.bam.gz, b.bam.gz, etc.). I suspect the issue is related to my BAM files being gzipped. Unfortunately, due to their large size, I don’t have enough space to unzip them.
Is there a way to use gzipped BAM files directly in the variant calling analysis? Any guidance would be appreciated.
Thanks!
Uh, out of curiosity, how much space are you gaining by compressing bams with gzip? It must be by a negligible amount, as bams are already bgzip-compressed. If the size is still an issue, you should use cram instead. Both bams and crams are supported natively by samtools and bcftools.