This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unknown file type error when running bcftools command

Hi all,

I've been trying to run this command:

bcftools view --threads 40 --samples-file /home/j/jle/jasminl/scratch/analysis/ID.txt -Oz -o /home/j/jle/jasminl/scratch/analysis/JC.vcf.gz

Where ID.txt is a file containing the ID I want to use to extract samples from the JC.vcf.gz file. However, I have been running into this error:

Failed to open -: unknown file type

Is this a common problem? What might be causing it?

Thank you.

bcftools bash

what's the version of bcftools ? otherwise I suspect there is a invisible character somewhere in your command. You shoud re-write it from scractch .

I tried rewriting it from scratch, but the same is occurring. The modules I have currently loaded onto my shell script is:

module load gcc/8.3.0 module load bcftools/1.8 module load samtools/1.13

Please let me know your thoughts, thank you.

run bcftools view only, look at the available options and look if this old version of bcftools contains the options you wanted.

1 answer

You haven't specified an actual input file because it's treating /home/j/jle/jasminl/scratch/analysis/JC.vcf.gz as the output file as it follows the -o flag.

It should be something like this:

bcftools view \
    --threads 40 \
    --samples-file /home/j/jle/jasminl/scratch/analysis/ID.txt \
    -O z \
    -o /home/j/jle/jasminl/scratch/analysis/JC.output.vcf.gz \
    /home/j/jle/jasminl/scratch/analysis/JC.vcf.gz

Thank you!

Log in to answer this question.