Question: Coverting missing sites to reference allele using Bcftools isn't working.
0
gravatar for kirannbishwa01
13 months ago by
kirannbishwa011000
United States
kirannbishwa011000 wrote:

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 ?

ADD COMMENTlink modified 13 months ago by finswimmer11k • written 13 months ago by kirannbishwa011000
1
gravatar for finswimmer
13 months ago by
finswimmer11k
Germany
finswimmer11k wrote:

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 COMMENTlink modified 13 months ago • written 13 months ago by finswimmer11k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 827 users visited in the last hour