This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Compress already compressed file with bgzip without decompressing first

I have a large compressed VCF that needs to be compressed with bgzip so I can run bcftools. However, it isn't compressed with bgzip and if I decompress I will go over my quota on the cluster. Is it possible to compress a file without decompressing it fully and then compressing it again?

bgzip

1 answer

Assuming it's compressed with gzip, then zcat it to stdout which won't use up any of your disk quota and then bgzip.

zcat vcf.gz | bgzip -c > vcf.bgz

Log in to answer this question.