Last data update: 2014.03.03
|
R: Inter range transformations of a RangedSummarizedExperiment...
inter-range-methods | R Documentation |
Inter range transformations of a RangedSummarizedExperiment object
Description
This man page documents the inter range transformations that are
supported on RangedSummarizedExperiment objects.
Usage
## S4 method for signature 'RangedSummarizedExperiment'
isDisjoint(x, ignore.strand=FALSE)
## S4 method for signature 'RangedSummarizedExperiment'
disjointBins(x, ignore.strand=FALSE)
Arguments
x |
A RangedSummarizedExperiment object.
|
ignore.strand |
See ?isDisjoint in the
GenomicRanges package.
|
Details
These transformations operate on the rowRanges component of the
RangedSummarizedExperiment object, which can be a
GenomicRanges or GRangesList
object.
More precisely, any of the above functions performs the following
transformation on RangedSummarizedExperiment object x :
f(rowRanges(x), ...)
where f is the name of the function and ... any additional
arguments passed to it.
See ?isDisjoint in the GenomicRanges
package for the details of how these transformations operate on a
GenomicRanges or GRangesList
object.
Value
See ?isDisjoint in the
GenomicRanges package.
See Also
Examples
nrows <- 20; ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
rowRanges <- GRanges(rep(c("chr1", "chr2"), c(5, 15)),
IRanges(sample(1000L, 20), width=100),
strand=Rle(c("+", "-"), c(12, 8)))
colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
row.names=LETTERS[1:6])
rse0 <- SummarizedExperiment(assays=SimpleList(counts=counts),
rowRanges=rowRanges, colData=colData)
rse1 <- shift(rse0, 99*start(rse0))
isDisjoint(rse0) # FALSE
isDisjoint(rse1) # TRUE
bins0 <- disjointBins(rse0)
bins0
stopifnot(identical(bins0, disjointBins(rowRanges(rse0))))
bins1 <- disjointBins(rse1)
bins1
stopifnot(all(bins1 == bins1[1]))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(SummarizedExperiment)
Loading required package: GenomicRanges
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: Biobase
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/SummarizedExperiment/inter-range-methods.Rd_%03d_medium.png", width=480, height=480)
> ### Name: inter-range-methods
> ### Title: Inter range transformations of a RangedSummarizedExperiment
> ### object
> ### Aliases: inter-range-methods isDisjoint
> ### isDisjoint,RangedSummarizedExperiment-method disjointBins
> ### disjointBins,RangedSummarizedExperiment-method
> ### Keywords: methods utilities
>
> ### ** Examples
>
> nrows <- 20; ncols <- 6
> counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
> rowRanges <- GRanges(rep(c("chr1", "chr2"), c(5, 15)),
+ IRanges(sample(1000L, 20), width=100),
+ strand=Rle(c("+", "-"), c(12, 8)))
> colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
+ row.names=LETTERS[1:6])
> rse0 <- SummarizedExperiment(assays=SimpleList(counts=counts),
+ rowRanges=rowRanges, colData=colData)
> rse1 <- shift(rse0, 99*start(rse0))
>
> isDisjoint(rse0) # FALSE
[1] FALSE
> isDisjoint(rse1) # TRUE
[1] TRUE
>
> bins0 <- disjointBins(rse0)
> bins0
[1] 1 2 2 1 1 2 2 1 2 1 1 1 1 1 2 1 1 2 1 3
> stopifnot(identical(bins0, disjointBins(rowRanges(rse0))))
>
> bins1 <- disjointBins(rse1)
> bins1
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> stopifnot(all(bins1 == bins1[1]))
>
>
>
>
>
> dev.off()
null device
1
>
|