Category

Variant Analysis


Usage

bcftools view [options] <in.vcf.gz> [region1 [...]]


Manual

Required arguments

  • in.vcf.gz file: Input VCF/BCF file.
  • region1 [...]: Additional regions.

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 int: Compression level: 0 uncompressed, 1 best speed, 9 best compression [-1].
  • --no-version: Do not append version and command line to the header.
  • -o, --output 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].
  • -r, --regions region: Restrict to comma-separated list of regions.
  • -R, --regions-file file: Restrict to regions listed in a file.
  • -t, --targets [^]region: Similar to -r but streams rather than index-jumps. Exclude regions with "^" prefix.
  • -T, --targets-file [^]file: Similar to -R but streams rather than index-jumps. Exclude regions with "^" prefix.
  • --threads int: Use multithreading with int worker threads [0].

Subset options

  • -a, --trim-alt-alleles: Trim ALT alleles not seen in the genotype fields (or their subset with -s/-S).
  • -I, --no-update: Do not (re)calculate INFO fields for the subset (currently INFO/AC and INFO/AN).
  • -s, --samples [^]list: Comma-separated list of samples to include (or exclude with "^" prefix).
  • -S, --samples-file [^]file: File of samples to include (or exclude with "^" prefix).
  • --force-samples: Only warn about unknown subset samples.

Filter options

  • -c, -C, --min-ac, --max-ac int[:type]: Minimum/maximum count for non-reference (nref), 1st alternate (alt1), least frequent (minor), most frequent (major) or sum of all but most frequent (nonmajor) alleles [nref].
  • -f, --apply-filters list: Require at least one of the listed FILTER strings (e.g., "PASS,.").
  • -g, --genotype [^]hom|het|miss: Require one or more hom/het/missing genotype or, if prefixed with "^", exclude sites with hom/het/missing genotypes.
  • -i, -e, --include, --exclude expr: Select/exclude sites for which the expression is true (see man page for details).
  • -k, -n, --known, --novel: Select known/novel sites only (ID is not/is '.').
  • -m, -M, --min-alleles, --max-alleles int: minimum/Maximum number of alleles listed in REF and ALT (e.g., -m 2 -M 2 for biallelic sites).
  • -p, -P, --phased, --exclude-phased: Select/exclude sites where all samples are phased.
  • -q, -Q, --min-af, --max-af float[:type]: minimum/Maximum frequency for non-reference (nref), 1st alternate (alt1), least frequent (minor), most frequent (major), or sum of all but most frequent (nonmajor) alleles [nref].
  • -u, -U, --uncalled, --exclude-uncalled: Select/exclude sites without a called genotype.
  • -v, -V, --types, --exclude-types list: Select/exclude comma-separated list of variant types: snps,indels,mnps,ref,bnd,other [null].
  • -x, -X, --private, --exclude-private: Select/exclude sites where the non-reference alleles are exclusive (private) to the subset samples.

 

File formats this tool works with
VCF

Share your experience or ask a question