View Single Post
Old 01-21-2020, 04:25 PM   #3
David Eccles (gringer)
Location: Wellington, New Zealand

Join Date: May 2011
Posts: 838

Have a look at the bcftools package. It supports uncompressed and gzip-compressed VCF file formats as input, as well as the BCF format, and provides means to output as any of those formats. Here are the first few lines of documentation for bcftools view:

$ bcftools view

About:   VCF/BCF conversion, view, subset and filter VCF/BCF files.
Usage:   bcftools view [options] <in.vcf.gz> [region1 [...]]

Output options:
    -G,   --drop-genotypes              drop individual genotype information (after subsetting if -s option set)
    -h/H, --header-only/--no-header     print the header only/suppress the header in VCF output
    -l,   --compression-level [0-9]     compression level: 0 uncompressed, 1 best speed, 9 best compression [-1]
    -o,   --output-file <file>          output file name [stdout]
    -O,   --output-type <b|u|z|v>       b: compressed BCF, u: uncompressed BCF, z: compressed VCF, v: uncompressed VCF [v]
gringer is offline   Reply With Quote