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!