Question: Effieicntly convert DNAStringSetList to a character vector
1
gravatar for dr
3.4 years ago by
dr10
dr10 wrote:

I'm using the VariantAnnotation​ package and I want to intersect two VCF files to find overlapping variants. What's the most efficient way to achieve this?

I can intersect the coordinates of the two VCFs with the GenomicRanges::findOverlaps function, but I still want to make sure that the ALT fields of the intersected coordinates match. As these are ​represented by DNAStringSetLists it's not clear to me how to efficiently achieve this.

 

 

 

 

 

variantannotation • 511 views
ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by dr10
Answer: Effieicntly convert DNAStringSetList to a character vector
0
gravatar for Michael Lawrence
3.4 years ago by
United States
Michael Lawrence11k wrote:

Not sure if it is the "best" way for you, but one way would be to coerce to a VRanges and use the ordinary match() functionality:

vr1 <- as(vcf1, "VRanges")
vr2 <- as(vcf2, "VRanges")
v1 %in% v2

etc

You might find VRanges generally useful for your use cases.

ADD COMMENTlink written 3.4 years ago by Michael Lawrence11k
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 16.09
Traffic: 183 users visited in the last hour