Entering edit mode
4.4 years ago
anailis
•
0
Hello. I am trying to convert a .vcf containing phased data to SHAPEIT .hap/.sample format using bcftools or Plink2.
bcftools convert input.vcf --hapsample output.hap
OR
plink2 --vcf input.vcf --export haps --out output.hap
PLINK gives the error "--exports haps cannot be used with missing genotype calls" and bcftools gives the error "FORMAT/GT tag not present at [chr.no]:[SNP:id]". My vcf is using genotype probabilities (GP) not genotype (GT). My .vcf was produced from a .bgen using qctools:
qctool -g input.bgen -s input.sample -incl-rsids snps.txt -incl-samples sample.txt -og output.vcf
A snapshot of my .vcf looks like:
##fileformat=VCFv4.2
##FORMAT=<ID=GP,Type=Float,Number=G,Description="Genotype call probabilities">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT [sample-id] ...
. 11944 rs10172629,2 C T . . . GP [sample-genotype] ...
Sample genotypes are in the form 0,1,0,1 etc where 0 and 1 refer to the possible alleles.
Added
plink
tag.Do you need the GPs or would you prefer GTs? To obtain GTs, I think that you just need to add the
threshold
parameter to the qctool command.Also, in place of qctool, you could try
shapeit -convert
(for producing the VCF)