Entering edit mode
Hi Bioconductor folks,
I'm trying to create some GRanges summaries, but I think I may be
missing
an obvious solution. I have fixed-width windows as a GRanges object,
and
for each window/row I'd like to add a metadata column that indicates
how
many base pairs of this window overlap features in another GRange
object.
I'll need to add a few columns for different features in different
GRanges
objects.
I've tried using the approach of findOverlaps, followed by ranges() to
extract range widths. This creates an error: "'query' must be a Ranges
of
length equal to number of queries". I saw in the source
that pintersect(query[queryHits(x)], subject[subjectHits(x)]) works
too
(and does without error). This returns the overlapping ranges, but
it'd
take a load of data munging to get it into the format I'd like it
seems
like I may be overlooking an easier solution.
thanks,
Vince
!> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin13.0.1 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel stats graphics grDevices utils datasets
methods
[8] base
other attached packages:
[1] ggplot2_0.9.3.1 rtracklayer_1.22.0 GenomicRanges_1.14.3
[4] XVector_0.2.0 IRanges_1.20.6 BiocGenerics_0.8.0
[7] ESSR_1.0.1
loaded via a namespace (and not attached):
[1] Biostrings_2.30.1 bitops_1.0-6 BSgenome_1.30.0
colorspace_1.2-4
[5] compiler_3.0.2 dichromat_2.0-0 digest_0.6.4
grid_3.0.2
[9] gtable_0.1.2 labeling_0.2 MASS_7.3-29
munsell_0.4.2
[13] plyr_1.8 proto_0.3-10 RColorBrewer_1.0-5
RCurl_1.95-4.1
[17] reshape2_1.2.2 Rsamtools_1.14.2 scales_0.2.3
stats4_3.0.2
[21] stringr_0.6.2 tools_3.0.2 XML_3.98-1.1
zlibbioc_1.8.0
--
Vince Buffalo
Ross-Ibarra Lab www.rilab.org)
Plant Sciences, UC Davis
[[alternative HTML version deleted]]