Entering edit mode
2.3 years ago
Sowmya Pulapet
▴
70
Hello everyone, I have 3 samples on which I have performed variant calling seperately. Now I want to combine all three of them to get a single VCF file in the following format:
CHROM POS ID REF ALT QUAL FILTER INFO Sample1 sample2 sample3
The VCFs are from individual samples. I could only find tools to merge VCFs of a single sample. Also my individual VCFs does not have sample names. Any input on this would be helpful !
Thanks in advance.
Hi, that requires sample names in the vcf files. But mine doesn't have sample names.
if there is no sample name, so there is no genotype, so 'merging' vcfs is meaningless.
Show us the output to:
If the VCF is gzipped, use
zgrep
instead ofgrep
.Hi Ram, here's the output:
as I said, without genotype 'merging' vcfs is meaningless. May be you just want
bcftools concat
Hi @Pierre Lindenbaum, Would you please explain why it is meaningless? I used bcftools reheader to rename the 'unknown' to desired sample name. Then used bcftools merge and it worked. I have very little knowledge in this area. Please correct me if I am wrong.
You're not wrong - The SAMPLE fields are optional in VCF and only when there are no SAMPLE field is merging meaningless. This approach (rename and merge) would have been my recommendation too, so you've solved it yourself. You do have a genotype field and the merge process is routine, not meaningless in the slightest.
Alright. Thank you for the explanation.