repolarize vcf file based on major allele of one sample?
0
1
Entering edit mode
5.4 years ago
nketchi ▴ 10

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!

vcf polarise major allele • 1.3k views
ADD COMMENT

Login before adding your answer.

Traffic: 4304 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