Question: Merging/Concatenating Vcf Files
3
gravatar for bioinfo
6.2 years ago by
bioinfo680
EU
bioinfo680 wrote:

I have a vcf file of SNPs and another vcf file for my Indels. During SNP calling step by GATK, I created them separately instead of using -glm (calling together SNPs and Indels). Now to get the consensus sequence of my mapped genome, I want to put them together in the same vcf file. Should I merge these two vcf files or concatenate them to get the proper variant vcf file, so I can consider SNPs and Indels for my consensus sequence?

indel vcftools snp • 11k views
ADD COMMENTlink modified 3.6 years ago by Anop Singh Ranawat0 • written 6.2 years ago by bioinfo680
9
gravatar for dfornika
6.2 years ago by
dfornika1000
Vancouver, British Columbia, Canada
dfornika1000 wrote:

You should merge them using the vcf-merge utility that is part of the vcftools package.

Concatenation would be appropriate if you had separate files for each chromosome, and simply wanted to join them 'end-to-end' into a single file. In this case, your SNPs and indels need to be inter-woven ie. merged.

If you haven't used vcftools before, you can find it here:

http://vcftools.sourceforge.net/

Specifically, you can read about vcf-merge here:

http://vcftools.sourceforge.net/docs.html#merge

You will need to compress the vcf files with bgzip and index with tabix before you can run any vcftools functions on them.

ADD COMMENTlink written 6.2 years ago by dfornika1000

Thanks for ur reply. I was a bit confused with merging and concatenation. Now it's clear.

ADD REPLYlink written 6.2 years ago by bioinfo680

What should I do to merge VCF files column wise?

The format is as follows

CHROM POSID REF ALT QUAL FILTER INFO FORMAT CAST_EiJ

I want to add a column extra in this, so that my format will be

CHROM POSID REF ALT QUAL FILTER INFO FORMAT CAST_EiJ C57BL6J

in which all the columns except last will be common.

Thanks.

ADD REPLYlink modified 2.2 years ago • written 2.2 years ago by startup_biostar0

Please post this as a new question.

ADD REPLYlink written 2.2 years ago by dfornika1000
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: 1683 users visited in the last hour