Description Usage Arguments Value Methods (by generic) Constructors Accessors Subsetting Coercion Examples
The RaggedExperiment
class is a container for
storing range-based data, including but not limited to copy
number data, and mutation data. It can store a collection of
GRanges
objects, as it is derived from the
GenomicRangesList
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | RaggedExperiment(..., colData = DataFrame())
## S4 method for signature 'RaggedExperiment'
seqinfo(x)
## S4 replacement method for signature 'RaggedExperiment'
seqinfo(x, new2old = NULL, pruning.mode = c("error", "coarse", "fine", "tidy")) <- value
## S4 method for signature 'RaggedExperiment'
rowRanges(x, ...)
## S4 replacement method for signature 'RaggedExperiment,GRanges'
rowRanges(x, ...) <- value
## S4 method for signature 'RaggedExperiment'
mcols(x, use.names = FALSE, ...)
## S4 replacement method for signature 'RaggedExperiment'
mcols(x, ...) <- value
## S4 method for signature 'RaggedExperiment'
rowData(x, use.names = TRUE, ...)
## S4 replacement method for signature 'RaggedExperiment'
rowData(x, ...) <- value
## S4 method for signature 'RaggedExperiment'
dim(x)
## S4 method for signature 'RaggedExperiment'
dimnames(x)
## S4 replacement method for signature 'RaggedExperiment,list'
dimnames(x) <- value
## S4 method for signature 'RaggedExperiment'
length(x)
## S4 method for signature 'RaggedExperiment'
colData(x, ...)
## S4 replacement method for signature 'RaggedExperiment,DataFrame'
colData(x) <- value
## S4 method for signature 'RaggedExperiment,missing'
assay(x, i, withDimnames = TRUE, ...)
## S4 method for signature 'RaggedExperiment,ANY'
assay(x, i, withDimnames = TRUE, ...)
## S4 method for signature 'RaggedExperiment'
assays(x, withDimnames = TRUE, ...)
## S4 method for signature 'RaggedExperiment'
assayNames(x, ...)
## S4 method for signature 'RaggedExperiment'
show(object)
## S4 method for signature 'RaggedExperiment,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]
## S4 method for signature 'RaggedExperiment,Vector'
overlapsAny(
query,
subject,
maxgap = 0L,
minoverlap = 1L,
type = c("any", "start", "end", "within", "equal"),
...
)
## S4 method for signature 'RaggedExperiment,Vector'
subsetByOverlaps(
x,
ranges,
maxgap = -1L,
minoverlap = 0L,
type = c("any", "start", "end", "within", "equal"),
invert = FALSE,
...
)
|
... |
Constructor: GRanges, list of GRanges, or GRangesList OR assay: Additional arguments for assay. See details for more information. |
colData |
A |
x |
A RaggedExperiment object. |
new2old |
The
If |
pruning.mode |
When some of the seqlevels to drop from
See the "B. DROP SEQLEVELS FROM A LIST-LIKE OBJECT" section in the examples below for an extensive illustration of these pruning modes. |
value |
|
use.names |
(logical default FALSE) whether to propagate rownames from
the object to rownames of metadata |
i |
logical(1), integer(1), or character(1) indicating the
assay to be reported. For |
withDimnames |
logical (default TRUE) whether to use dimension names in the resulting object |
object |
A RaggedExperiment object. |
j |
integer(), character(), or logical() index selecting columns from RaggedExperiment |
drop |
logical (default TRUE) whether to drop empty samples |
query |
A RaggedExperiment instance. |
subject |
Each of them can be an IntegerRanges (e.g. IRanges,
Views) or IntegerRangesList (e.g. IRangesList,
ViewsList) derivative.
In addition, if If If both arguments are list-like objects with names, each list element from the 2nd argument is paired with the list element from the 1st argument with the matching name, if any. Otherwise, list elements are paired by position. The overlap is then computed between the pairs as described below. If |
maxgap |
A single integer >= -1. If If |
minoverlap |
A single non-negative integer. Only ranges with a minimum of When |
type |
By default, any overlap is accepted. By specifying the The |
ranges |
Each of them can be an IntegerRanges (e.g. IRanges,
Views) or IntegerRangesList (e.g. IRangesList,
ViewsList) derivative.
In addition, if If If both arguments are list-like objects with names, each list element from the 2nd argument is paired with the list element from the 1st argument with the matching name, if any. Otherwise, list elements are paired by position. The overlap is then computed between the pairs as described below. If |
invert |
If |
constructor returns a RaggedExperiment
object
'rowRanges' returns a GRanges
object
summarizing ranges corresponding to assay()
rows.
'rowRanges<-' returns a RaggedExperiment
object
with replaced ranges
'mcols' returns a DataFrame
object
of the metadata columns
'assays' returns a SimpleList
'overlapsAny' returns a logical vector of length equal
to the number of rows in the query
; TRUE
when the
copy number region overlaps the subject
.
'subsetByOverlaps' returns a RaggedExperiment containing
only copy number regions overlapping subject
.
seqinfo
: seqinfo accessor
seqinfo<-
: Replace seqinfo metadata of the ranges
rowRanges
: rowRanges accessor
rowRanges<-
: rowRanges replacement
mcols
: get the metadata columns of the ranges,
rectangular representation of the 'assays'
mcols<-
: set the metadata columns of the ranges
corresponding to the assays
rowData
: get the rowData or metadata for the ranges
rowData<-
: set the rowData or metadata for the ranges
dim
: get dimensions (number of sample-specific row
ranges by number of samples)
dimnames
: get row (sample-specific) range names
and sample names
dimnames<-
: set row (sample-specific) range names
and sample names
length
: get the length of row vectors in the object,
similar to SummarizedExperiment
colData
: get column data
colData<-
: change the colData
assay
: assay missing method uses first metadata column
assay
: assay numeric method.
assays
: assays
assayNames
: names in each assay
show
: show method
[
: Subset a RaggedExperiment object
overlapsAny
: Determine whether copy number ranges
defined by query
overlap ranges of subject
.
subsetByOverlaps
: Subset the RaggedExperiment to contain only
copy number ranges overlapping ranges of subject
.
RaggedExperiment(..., colData=DataFrame())
: Creates a
RaggedExperiment object using multiple GRanges
objects or a list
of GRanges
objects. Additional column data may be provided
as a DataFrame
object.
In the following, 'x' represents a RaggedExperiment
object:
rowRanges(x)
:
Get the ranged data. Value is a GenomicRanges
object.
assays(x)
:
Get the assays. Value is a SimpleList
.
assay(x, i)
:
An alternative to assays(x)[[i]]
to get the ith
(default first) assay element.
mcols(x), mcols(x) <- value
:
Get or set the metadata columns. For RaggedExperiment
, the
columns correspond to the assay ith elements.
rowData(x), rowData(x) <- value
:
Get or set the row data. Value is a DataFrame
object. Also corresponds to the mcols
data.
Note for advanced users and developers. Both
mcols
and rowData
setters may reduce the size of the
internal RaggedExperiment
data representation. Particularly after
subsetting, the internal row index is modified and such setter
operations will use the index to subset the data and reduce the
"rows" of the internal data representation.
x[i, j]
:
Get ranges or elements (i
and j
, respectively) with
optional metadata columns where i
or j
can be missing,
an NA-free logical, numeric, or character vector.
In the following, 'object' represents a RaggedExperiment
object:
as(object, "GRangesList")
:
Creates a GRangesList object from a RaggedExperiment
.
as(from, "RaggedExperiment")
:
Creates a RaggedExperiment
object from a GRangesList,
or GRanges object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Create an empty RaggedExperiment instance
re0 <- RaggedExperiment()
re0
## Create a couple of GRanges objects with row ranges names
sample1 <- GRanges(
c(a = "chr1:1-10:-", b = "chr1:11-18:+"),
score = 1:2)
sample2 <- GRanges(
c(c = "chr2:1-10:-", d = "chr2:11-18:+"),
score = 3:4)
## Include column data
colDat <- DataFrame(id = 1:2)
## Create a RaggedExperiment object from a couple of GRanges
re1 <- RaggedExperiment(sample1=sample1, sample2=sample2, colData = colDat)
re1
## With list of GRanges
lgr <- list(sample1 = sample1, sample2 = sample2)
## Create a RaggedExperiment from a list of GRanges
re2 <- RaggedExperiment(lgr, colData = colDat)
grl <- GRangesList(sample1 = sample1, sample2 = sample2)
## Create a RaggedExperiment from a GRangesList
re3 <- RaggedExperiment(grl, colData = colDat)
## Subset a RaggedExperiment
assay(re3[c(1, 3),])
subsetByOverlaps(re3, GRanges("chr1:1-5")) # by ranges
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.