Question: repolarize vcf file based on major allele of one sample?
gravatar for nketchi
5 months ago by
nketchi0 wrote:

Hello community!

I'm really stuck trying to achieve what I think should be a pretty straightforward thing:

I would like to recode my vcf file so that the REF allele is polarised based on the MAJOR allele of one of my samples (but including all the info)

I've tried many approaches such as: bcftools consensus major_allele_test.vcf.gz -f $REF -H 1 --sample IF9 > maj_allele_IF9.fa

which creates a fasta file of the major allele of the sample, followed by: bcftools +fill-from-fasta major_allele_test.vcf.gz -- -c REF -f maj_allele_IF9.fa > maj_allele_liftover.vcf

which will correctly change the REF column, but does not change the other info (such as AD, DP etc within the vcf file)

I was wondering about creating a chain file and doing a whole liftover based on the fasta file of the major allele but this seems a bit over the top

does anyone have suggestions as to how I can "liftover" my vcf file reference using the major allele of one sample? Thanks!

major allele polarise vcf • 132 views
ADD COMMENTlink written 5 months ago by nketchi0
Please log in to add an answer.


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