Question: Is there a way to reformat vcf 4.3 down to 4.2?
1
0
Entering edit mode
3.9 years ago
rdlady ▴ 40

I got a vcf file from the supplementary materials of an article but the vcf file is in vcf 4.3 format. Is there a way to convert the vcf from 4.3 to 4.2 format?

sequencing SNP ChIP-Seq • 7.5k views
ADD COMMENT
9
Entering edit mode
3.9 years ago

https://samtools.github.io/hts-specs/VCFv4.3.pdf

most of the changes are new official tags, the ##SAmple tag., ##pedigree etc...

if you need to process it with a tool that is not able to read 4.3 , you can try to 'just' change the version number of the of VCF.

sed 's/^##fileformat=VCFv4.3/##fileformat=VCFv4.2/' in.vcf > out.vcf
ADD COMMENT
0
Entering edit mode

That's a good idea. I was concerned that v4.3 might be too different from 4.2 but you are right, I should at least just try to change the version number in the vcf file and see if that works. Thank you! I will post an update if that works.

ADD REPLY
0
Entering edit mode

The sed command you suggested worked for the analyses I needed. Thank you again for your help!

ADD REPLY

Login before adding your answer.

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