How can you update position field in a VCF?
1
0
Entering edit mode
4.2 years ago
rshoobs ▴ 10

I am attempting to LiftOver a set of vcf files from hg19 to hg38. I attempted to use the picard LiftOverVCF tool developed by the broad institute, however I have found that the amount of required RAM is large and is not feasible on my machine. Instead I have extracted my set of SNPs from my vcf file and used standard LiftOver to get the hg38 positions of my SNPs. Is there a way I could update this information in my VCF file? I've looked into bcftools annotate but it seems to only edit the ID, QUAL, FILTER, INFO and FORMAT fields. The other option is to convert all the files to a more accessible format, update them there and then either convert back to vcf or continue to process them in that manner.

gene • 1.9k views
ADD COMMENT
0
Entering edit mode

I'm not aware of an application that directly modifies the positions of the variants (alignment of indels excluded), but I'd be interested in hearing if anyone else has.

If it were me, I'd simply process the VCFs as text (it's delimited after the header), looking for a chromosome/pos/ref/alt combination, and modify the position accordingly. There are a number of ways to do this using standard Unix tools, Python, R, Perl, etc.

ADD REPLY
0
Entering edit mode
4.2 years ago

You could also consider splitting your files by chromosome, lifting them over, and then concatenating them all back together. A bit tedious, but gets around the memory issue nicely and prevents you from having to do much thinking in terms of manual data wrangling.

ADD COMMENT

Login before adding your answer.

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