[BioC] reducing RangedData
Robert Castelo
robert.castelo at upf.edu
Thu Oct 22 01:27:02 CEST 2009
dear list,
i'd like to project a set of exons on genomic space but keeping
the strand information. let's assume for simplicity that no exons
overlap in opposite strands so no conflicts need to be resolved
regarding that case. in principle this is easy without keeping the
strand using a RangeList and the reduce method. however i've been
struggling for a while without success to figure out how can i
"reduce" my coordinates without loosing the strand information.
my guess is that to carry out the strand information i need to
use a RangedData object:
sta <- c(1, 1, 1)
end <- c(3, 4, 5)
str <- c("+", "+", "-")
rd <- RangedData(IRanges(start=sta, end=end), strand=str, space=chr)
rd
RangedData: 3 ranges by 1 columns
columns(1): strand
sequences(2): chr1 chr2
and then use rdapply to reduce on each of the chromosomes but i
either don't know how to directly apply reduce:
params <- RDApplyParams(rd, reduce)
rdapply(params)
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "reduce", for signature
"RangedData"
or i loose the strand information:
params <- RDApplyParams(rd, function(rd) reduce(ranges(rd)))
rdapply(params)
$chr1
RangesList: 1 range
1: 1:4
$chr2
RangesList: 1 range
1: 1:5
thanks for your help!
robert.
sessionInfo()
R version 2.9.1 (2009-06-26)
i386-apple-darwin8.11.1
locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rtracklayer_1.4.1 RCurl_0.98-1
[3] bitops_1.0-4.1 GOstats_2.10.0
[5] graph_1.22.2 Category_2.10.1
[7] geneplotter_1.22.0 lattice_0.17-25
[9] limma_2.18.2 bgSpJncArrayDm1.db_1.0.1
[11] org.Dm.eg.db_2.2.11 RSQLite_0.7-1
[13] DBI_0.2-4
BSgenome.Dmelanogaster.UCSC.dm1_1.0.0
[15] BSgenome_1.12.3 RColorBrewer_1.0-2
[17] Biostrings_2.12.8 IRanges_1.2.3
[19] annotate_1.22.0 AnnotationDbi_1.6.1
[21] Biobase_2.4.1 xtable_1.5-5
loaded via a namespace (and not attached):
[1] genefilter_1.24.2 GO.db_2.2.11 grid_2.9.1 GSEABase_1.6.1
[5] RBGL_1.20.0 splines_2.9.1 survival_2.35-4 tools_2.9.1
[9] XML_2.5-3
More information about the Bioconductor
mailing list