Coverting missing sites to reference allele using Bcftools isn't working.
1
0
Entering edit mode
5.9 years ago
kirannbishwa01 ★ 1.6k

I am trying to set the missing GT = . to 0|0 but while using bcftools I end up only with GT as single 0 in all the missing sites for all the samples.

Initial VCFs:

CHROM   POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  MA605   MA611   MA622   MA625   MA629   Ncm8    Sp154   Sp164   Sp21    Sp3 Sp76    SpNor33 ms01e   ms02g   ms03g   ms04h
1   141 .   C   T   .   .   .   GT:PG:PG_al:PI  .   .   .   0|1:0|1:C|T:10763   .   .   .   .   .   .   .   .   .   .   .   .

My script:

bcftools +setGT phasedVCF-short02.vcf.gz -- -t . --new-gt 0p > phasedVCF-short03.vcf
Filled 110671 alleles

bcftools +setGT phasedVCF-short02.vcf.gz -- -t . --new-gt 0p\n > phasedVCF-short03.vcf

bcftools +missing2ref phasedVCF-short02.vcf.gz -- -p > phasedVCF-short03.vcf

All these methods are giving the Output VCF:

CHROM   POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  MA605   MA611   MA622   MA625   MA629   Ncm8    Sp154   Sp164   Sp21    Sp3 Sp76    SpNor33 ms01e   ms02g   ms03g   ms04h
1   141 .   C   T   .   .   .   GT:PG:PG_al:PI  0:.:.:. 0:.:.:. 0:.:.:. 0|1:0|1:C|T:10763   0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:. 0:.:.:.

I thought if something was wrong with my VCF, so downloaded VCF file over the internet to test. And I am getting the same exact result.

This is weired. What is the issue here ?

bcftools vcf software error genome genotype • 3.4k views
ADD COMMENT
3
Entering edit mode
5.9 years ago

Hello,

as your missing genotype are just set to . bcftools assume that you have a monoploidy GT. So to get 0|0 you first have to set the correct ploidy.

$ bcftools +fixploidy phasedVCF-short02.vcf.gz -- -f 2|bcftools +missing2ref - -- -p > phasedVCF-short03.vcf

fin swimmer

ADD COMMENT

Login before adding your answer.

Traffic: 1507 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6