Question: Question: Is there a way to reformat vcf 4.3 down to 4.2?
0
gravatar for rdlady
2.3 years ago by
rdlady40
rdlady40 wrote:

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 • 4.7k views
ADD COMMENTlink modified 2.3 years ago by Pierre Lindenbaum131k • written 2.3 years ago by rdlady40
6
gravatar for Pierre Lindenbaum
2.3 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum131k wrote:

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 COMMENTlink written 2.3 years ago by Pierre Lindenbaum131k

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 REPLYlink written 2.3 years ago by rdlady40

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

ADD REPLYlink modified 2.3 years ago • written 2.3 years ago by rdlady40
Please log in to add an answer.

Help
Access

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