[Bioc-devel] Strands and overlaps between VRanges and GRanges

Steve Lianoglou lianoglou.steve at gene.com
Fri Jan 31 09:09:57 CET 2014


Comrades,

Forgive my n00briety in these matters, as I've only recently starting
dealing w/ genomic variants, but since the strand of a VRanges object
is always constrained to be `+`, does it make sense for the strand of
a potential non-VRanges 'subject' object (like a GRanges) be
considered when looking for overlaps between the two?

For instance, assume we load up the VRanges object returned by
`example(vr)`, which results in to ranges

Then:

R> gr <- as(vr, 'GRanges')
R> strand(gr) <- c('+', '-')
R> length(subsetByOverlaps(vr, gr))
[1] 1

Only the first variant from `vr` is returned, unless we explicitly set
ignore.strand=TRUE:

R> length(subsetByOverlaps(vr, gr, ignore.strand=TRUE))
[1] 2

Wouldn't it make more sense for these overlap (and match) methods to
default to ignore.strand=TRUE when either the query (and maybe even
the subject) are a VRanges object, even if the other is a GRanges?

Thanks,
-steve

-- 
Steve Lianoglou
Computational Biologist
Genentech



More information about the Bioc-devel mailing list