vcf intersection variantannotation
1
0
Entering edit mode
ribioinfo ▴ 100
@ribioinfo-9434
Last seen 3.8 years ago

Hi, I loaded two VCF files in two different objects with the readVCF function of VariantAnnotation. Is it possible to do an intersection e.g same chr, position ecc. between these two objects?

Thank you.

Riccardo

variantannotation • 1.0k views
ADD COMMENT
0
Entering edit mode
@michael-lawrence-3846
Last seen 2.4 years ago
United States

You might want to be more specific about the "etc" part. Otherwise, all I can say is "yes". But for example, to intersect by chr, position and alt, you could convert the VCF objects to VRanges and match:

vrA <- as(vcfA, "VRanges")
vrB <- as(vcfB, "VRanges")
vrA[vrA %in% vrB]

I guess we could make those operations work on VCF also.

ADD COMMENT
0
Entering edit mode

Thank you!, Where is the specification of chr, pos and alt?

Riccardo

ADD REPLY

Login before adding your answer.

Traffic: 335 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