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.
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?
1 answer
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
The sed command you suggested worked for the analyses I needed. Thank you again for your help!
I know it's been a long time since you answered but maybe you can still help me. I have the same issue but this does not seem to work for me. What am I doing wrong?
First I do this like you suggested:
LC_ALL=C sed 's/^##fileformat=VCFv4.3/##fileformat=VCFv4.2/' ALL.chr.vcf.gz > newALL.chr.vcf.gz
And then this again:
vcftools --gzvcf newALL.chr.vcf.gz --snps chr.csv --recode --out filtered_output
Which again gives me the error
Error: VCF version must be v4.0, v4.1 or v4.2: You are using version VCFv4.3
I would be very grateful for help!
You can either upgrate vcftools to the latest version to work with VCFv4.3 or better switch to using bcftools instead.
Log in to answer this question.