BCFtools Cheatsheet
1. BCFtools view
Examples:
# View the content of a compressed BCF file and convert it to compressed VCF format
bcftools view -Oz -o output.vcf.gz input.bcf
# Use the `-O` option to specify output format:
# - `b`: Compressed BCF
# - `u`: Uncompressed BCF
# - `z`: Compressed VCF
# - `v`: Uncompressed VCF
# Filter by region, retaining only chr1 positions between 1,000,000 and 2,000,000
bcftools view -r chr1:1000000-2000000 -Oz -o region_filtered.vcf.gz input.bcf
# Filter using multiple regions specified in a file (in BED format)
bcftools view -R regions.bed -Oz -o file_filtered.vcf.gz input.bcf2. BCFtools call
Examples:
Last updated