Sorry, I have been trying to work this out desparately all day. Biostars couldn't find any answer so I am cross posting here.
I am trying to get both the left and right reference genome using a sample name in phase VCF file.
This works:
bcftools consensus -f lyrata_chr01-short.fasta phasedVCF-short.vcf.gz -s ms01e -H 1 > ms01e-left.fa
When I am trying to make the new Ref Sequence by imputing genotype from the right haplotype, this doesn't work.
bcftools consensus -f lyrata_chr01-short.fasta phasedVCF-short.vcf.gz -s ms01e -H 2 > ms01e-right.fa
Broken VCF, too few alts at 1:141
What is the issue ?
Here is my VCF data:
#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 . . . . . . . . . . . .
1 3697 . T C . . . GT:PG:PG_al:PI . 0|0:0|0:T|T:11398 . 0|1:0|1:T|C:8039 0|1:0|1:T|C:8202 0|1:0|1:T|C:4616 0|1:0|1:T|C:3938 . 0|1:0|1:T|C:5102 . . 0|1:0|1:T|C:17340 1|0:1|0:C|T:1 . . .
The GT
field is empty at POS 141
for SAMPLE ms01e
, but in that situation it should by default pick a REF
allele. Isn't it?
And, it only is the problem when doing -H 2
not -H 1
.
Update: I have been trying to fix this issue by playing with -i and -e
using the BCFtools manual. But, still cannot find the fix.