This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ERROR: Missing one or both alleles for a genotype:

I have a problem when imputing with Beagle. In GT field of my VCF file I see . instead of .|..

Can someone help me in making a change of . with .|..

vcf beagle impute gsub

1 answer

Hello,

bcftools could do the job. Try first this:

# set missing genotypes ("./.") to phased ref genotypes ("0|0")
   bcftools +setGT in.vcf -- -t . -n 0p

If this doesn't work, fix the ploidy first:

bcftools +fixploidy in.vcf -- -s samples.txt

From the help page:

About: Fix ploidy
Usage: bcftools +fixploidy [General Options] -- [Plugin Options]
Options:
   run "bcftools plugin" for a list of common options

Plugin options:
   -p, --ploidy <file>   space/tab-delimited list of CHROM,FROM,TO,SEX,PLOIDY
   -s, --sex <file>      list of samples, "NAME SEX"
   -t, --tags <list>     VCF tags to fix [GT]

Example:
   # Default ploidy, if -p not given. Unlisted regions have ploidy 2
   X 1 60000 M 1
   X 2699521 154931043 M 1
   Y 1 59373566 M 1
   Y 1 59373566 F 0
   MT 1 16569 M 1
   MT 1 16569 F 1

   # Example of -s file, sex of unlisted samples is "F"
   sampleName1 M

   bcftools +fixploidy in.vcf -- -s samples.txt

fin swimmer

Log in to answer this question.