This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BCFTOOLS VIEW parameter?

I am trying to split my multiple samples vcf files to single one with Bcftools view, and -O z which can generate the compressed VCF.

bcftools view -s "$id" -g het  -v snps -o "$id/${id}_${vcf%.vcf.gz}_hetsnps.vcf" -O z "$vcf" --threads 50

However, the output files are uncompressed?

enter image description here

snp

Please do not paste screenshots of plain text content, it is counterproductive. You can copy paste the content directly here (using the code formatting option shown below), or use a GitHub Gist if the content volume exceeds allowed length here.

code_formatting

1 answer

you should add a '.gz' to the output file name.

 -o "$id/${id}_${vcf%.vcf.gz}_hetsnps.vcf.gz" -O z

Log in to answer this question.