About: Sets genotypes. The target genotypes can be specified as:
./. .. completely missing ("." or "./.", depending on ploidy)
./x .. partially missing (e.g., "./0" or ".|1" but not "./.")
. .. partially or completely missing
a .. all genotypes
b .. heterozygous genotypes failing two-tailed binomial test (example below)
q .. select genotypes using -i/-e options
and the new genotype can be one of:
. .. missing ("." or "./.", keeps ploidy)
0 .. reference allele (e.g. 0/0 or 0, keeps ploidy)
c:GT .. custom genotype (e.g. 0/0, 0, 0/1, m/M, overrides ploidy)
m .. minor (the second most common) allele (e.g. 1/1 or 1, keeps ploidy)
M .. major allele (e.g. 1/1 or 1, keeps ploidy)
p .. phase genotype (0/1 becomes 0|1)
u .. unphase genotype and sort by allele (1|0 becomes 0/1)
Usage: bcftools +setGT [General Options] -- [Plugin Options]
Options:
run "bcftools plugin" for a list of common options
Plugin options:
-e, --exclude <expr> Exclude a genotype if true (requires -t q)
-i, --include <expr> include a genotype if true (requires -t q)
-n, --new-gt <type> Genotypes to set, see above
-t, --target-gt <type> Genotypes to change, see above
Example:
# set missing genotypes ("./.") to phased ref genotypes ("0|0")
bcftools +setGT in.vcf -- -t . -n 0p
# set missing genotypes with DP>0 and GQ>20 to ref genotypes ("0/0")
bcftools +setGT in.vcf -- -t q -n 0 -i 'GT="." && FMT/DP>0 && GQ>20'
# set partially missing genotypes to completely missing
bcftools +setGT in.vcf -- -t ./x -n .
# set heterozygous genotypes to 0/0 if binom.test(nAlt,nRef+nAlt,0.5)<1e-3
bcftools +setGT in.vcf -- -t "b:AD<1e-3" -n 0
# force unphased heterozygous genotype if binom.test(nAlt,nRef+nAlt,0.5)>0.1
bcftools +setGT in.vcf -- -t ./x -n c:'m/M'
More on the dots: GenotypeGVCFs and the death of the do
not enough data : eg; homozygous deletion, low coverage, etc...