Question: Combining vcf files so that same loci data is combined
0
gravatar for spiral01
21 months ago by
spiral0180
spiral0180 wrote:

I have vcf files that I wish to combine so that any variants with matching positions are combined also. For example, if I have a variant in one file at position 123 and also one in another file there, I want that information to be combined in the genotype info.

The actual variants will be the same (T->G in one file will always be T->G in the other) as they have been created using the same reference data.

Is this possible to do in one go with any tool?

snp • 614 views
ADD COMMENTlink modified 21 months ago • written 21 months ago by spiral0180
3
gravatar for jared.andrews07
21 months ago by
jared.andrews072.9k
St. Louis, MO
jared.andrews072.9k wrote:

Is each file a different sample? If so, it sounds like GATK's CombineVariants tool would fit your purpose.

ADD COMMENTlink written 21 months ago by jared.andrews072.9k

Thanks for your reply. Yes each file is a single individual. I am trying to combine the vindija and altai neanderthal vcf data. Both have been created using the hg19 as reference and I just want to combine the two vcf files in one.

ADD REPLYlink written 21 months ago by spiral0180

I think that should do the trick for you then. Let me know if you have any issues.

ADD REPLYlink written 21 months ago by jared.andrews072.9k

GATK asks for a reference genome in fasta format. In this case I need the hg19 reference (obtained here: http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/). Is the chromFa.tar.gz the correct reference file for the hg19 build?

ADD REPLYlink written 21 months ago by spiral0180
1

You'll want to download the hg19.2bit file and then use their utility to convert it to a Fasta file.

ADD REPLYlink written 21 months ago by jared.andrews072.9k
0
gravatar for spiral01
21 months ago by
spiral0180
spiral0180 wrote:

Whilst Jared's answer above worked perfectly, I also had success using bcftools merge with the --force-samples argument.

ADD COMMENTlink written 21 months ago by spiral0180

Go ahead and accept (green check mark) your and @Jared's answer to provide closure to this thread.

ADD REPLYlink written 21 months ago by genomax70k
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: 1367 users visited in the last hour