This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to force merge a VCF files, for different samples?

I obtained vcf files from a tool I used. I want to merge them but it was missing some TAG info, which I fixed. Now, I am having somekind of ERROR probably emerging again from HEADER.

Is there a way to force merge vcf files, if not fix the vcf files. I don't really care much about HEADER at this time.

Thanks,

vcf merge snp genome

I obtained vcf files from a tool I used.

So you used some tool, on some data generated with a technology on some samples, and got vcf files.

I want to merge them but it was missing some TAG info, which I fixed.

You were missing some tag info, which you somehow fixed.

Now, I am having somekind of ERROR probably emerging again from HEADER.

And now, using an unknown tool, you get an error.

You need to add a lot of information to this question. I'm considering closing this because you are just making it impossible to answer.

Hi @WouterDeCoster.

How are you doing? Yeah, I used a a toold called phase to phase my variants, which unfortunately in the recent version had a bug and didn't add PG tag in the header. I have to merge different vcf files that came out of this tool, but I am getting error on every tool that does vcf merge.

I also tried adding PG field using AWK, sed but no luck excepting the error.

I think rest of the DATA on VCF files are good, and I need to do some presentation using this data. I don't have much time to redo the whole analyses (phasing) and I think force-merging the VCF would be all fine. What I am saying is HEADER information is least of the concern for what I am doing, but all the VCF merge tools are complaining about error somewhere in HEADER. I also don't have much time to fix that bug as of right now.

I think the best option for right now, is just merge the VCF files (different samples), without any complex manipuation.

1 answer

Bcftools has subcommands merge and annotate VCF files.

https://samtools.github.io/bcftools/bcftools.html

Log in to answer this question.