merge vcf files with different samples and variants?
0
2
Entering edit mode
shilin.zhao ▴ 40
@shilinzhao-7822
Last seen 6.6 years ago
United States

Hello, 

I've searched on this site and found some questions about merging vcf with same samples or variants by rbind or cbind. My questions is about merging vcf files with different samples and variants? Is there any function which can do it? Thanks!

 

For example:

vcf file1:

chr1   Pos1 Sample1(Variant0/1)

chr1   Pos2 Sample1(Variant0/1)

vcf file2:

chr1   Pos1 Sample2(Variant0/1)

chr1   Pos3 Sample2(Variant0/1)

 

Expected merged result:

chr1   Pos1 Sample1(Variant0/1) Sample2(Variant0/1)

chr1   Pos2 Sample1(Variant0/1) NA (or No Variant 0/0)

chr1   Pos3 NA (or No Variant 0/0) Sample2(Variant0/1) 

 

 

 

 

 

 

vcf • 2.7k views
ADD COMMENT

Login before adding your answer.

Traffic: 512 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6