Description Arguments Constructor Accessors MTuples/GTuples compatibility (rowRanges access) Subsetting Combining Author(s) See Also Examples
The MethPat
class is a matrix-like container where rows represent
genomic tuples of interest and columns represent samples (with sample data
summarized as a DataFrame-class
). A
MethPat
object contains the counts of how many times each methylation
pattern is observed for that genomic tuple in each sample. For example,
there are four possible methylation patterns at 2-tuples: MM
,
MU
, UM
and UU
.
The MethPat
class extends the
SummarizedExperiment
class. The key
differences are:
The rowRanges
must be a MTuples
object rather than a GRanges
object.
Certain assays
are required. See assays
argument below.
assays |
A |
rowRanges |
A |
colData |
An optional, but recommended,
|
exptData |
An optional |
... |
For For For For other accessors, ignored. |
verbose |
A |
x, |
object An instance of |
i,j |
For For For |
subset |
An expression which, when evaluated in the context of
|
select |
An expression which, when evaluated in the context of
|
name |
A symbol representing the name of a column of |
withDimnames |
A |
drop |
A |
value |
An instance of a class specified in the S4 method signature or as outlined in 'Details'. |
deparse.level |
See |
Instances are constructed using the MethPat
function with arguments
outlined aboved.
In the following code snippets, x
is a MethPat
instance.
assays(x)
, assays(x) <- value
:Get or set the assays.
value
is a list
or SimpleList
, each
element of which is a matrix
with the same dimensions
as x
.
assay(x, i)
, assay(x, i) <- value
:A conventient
alternative (to assays(x)[[i]]
, assays(x)[[i]] <- value)
to
get or set the i
th (default first) assay element. value
must
be a matrix
of the same dimensions as x
, and
with dimension names NULL
or consistent with those of x
.
rowRanges(x)
, rowRanges(x) <- value
:Get or set the
row data. value
is a MTuples
instance. Row names of
value
must be NULL
or consistent with the existing row names
of x
.
colData(x)
, colData(x) <- value
:Get or set the column
data. value
is a DataFrame
instance. Row
names of value
must be NULL
or consistent with the existing
columns of x
.
exptData(x)
, exptData(x) <- value
:Get or set the
experiment data. value
is a list
or
SimpleList
instance, with arbitrary content.
dim(x)
:Get the dimensions (tuples x samples) of the
MethPat
object.
dimnames(x)
, dimnames(x) <- value
:Get or set the
dimension names. value
is usually a list of length 2, containing
elements that are either NULL
or vectors of appropriate length for
the corresponding dimension. value
can be NULL
, which removes
dimension names. This method implies that rownames
,
rownames<-
, colnames
, and colnames<-
are all
available.
Since an MTuples
classes (used in the rowRanges
) slot) extends
the GTuples
, many GTuples
operations are
supported on MetPath
and derived instances, using rowRanges
.
WARNING: The preferred getter/setter of tuple information is
tuples(x)
/tuples(x) <- value
. In short, the use of
granges(x)
, coderanges(x), ranges(x) <- value
,
start(x)
, start(x) <- value
, end(x)
,
end(x) <- value
, width(x)
and width(x) <- value
is
generally not what is really desired or required when working with
MethPat
objects; see GTuples
for further
discussion.
Supported operations include: compare
,
countOverlaps
,
distance
,
distanceToNearest
,
duplicated
,
end
(not recommended, see above),
end<-
(not recommended, see above),
findOverlaps
,
follow
,
granges
(not recommended, see above),
IPD
,
match
,
mcols
,
mcols<-
,
nearest
,
order
,
overlapsAny
,
precede
,
ranges
(not recommended, see above),
ranges<-
(not recommended, see above),
rank
,
relistToClass
,
restrict
,
seqinfo
,
seqinfo<-
,
seqnames
,
shift
,
size
,
sort
,
split
,
start
(not recommended, see above),
start<-
(not recommended, see above),
strand
,
strand<-
,
subsetByOverlaps
,
tuples
,
tuples<-
,
width
(not recommended, see above),
width<-
(not recommended, see above).
Not all GTuples
operations are supported,
because they do not make sense for MethPat
objects (e.g.,
length
, name
, as.data.frame
, c
,
splitAsList
), involve non-trivial combination or splitting of rows
(e.g., unique), or have not yet been implemented (window
,
window<-
).
Additionally, all MTuples
-specific methods are also defined, such as
methinfo
and methtype
.
x[i, j], x[i, j] <- value
:Create or replace a subset of
x
. i
, j
can be numeric
, logical
,
character
, or missing
. value
must be a
MethPat
instance with dimensions, dimension names, and assay
elements consistent with the subset x[i, j]
being replaced.
subset(x, subset, select)
:Create a subset of x
using
an expression subset
referring to columns of rowRanges(x)
(including seqnames
, start
, end
, width
,
strand
, and names(mcols(x))
) and / or select
referring
to column names of colData(x)
.
Additional subsetting accessors provide convenient access to colData
columns
x$name, x$name <- value
Access or replace column
name
in x
.
x[[i, ...]], x[[i, ...]] <- value
Access or replace column
i
in x
.
In the code snippets below, x
, y
and ...
are
MethPat
instances to be combined. All MethPat
instances must
have the same size
tuples and have compatible seqinfo
.
cbind(...), rbind(...)
:cbind
combines objects with
identical tuples (rowRanges
) but different samples (columns in
assays
). The colnames in colData
must match or an error is
thrown. Duplicate columns of mcols(rowRanges(MethPat))
must contain
the same data.
rbind
combines objects with different tuples (rowRanges
) and
the same subjects in (columns in assays
). Duplicate columns of
colData
must contain the same data.
exptData
from all objects are combined into a
SimpleList with no name checking.
combine(x, y, ...)
:combine
combines objects with
different tuples (rowRanges
) and different samples (columns in
assays
) using an "incomplete" union strategy. Please read
combine
for the difference between the union
and intersection strategies; the current method is "incomplete" because it
requires that the samples (columns in assays
) are distinct across
x
, y
and ...
. This behaviour may change in future
versions so that data from the same sample that is stored across multiple
objects can be safely combined.
The colnames in colData
must
match or an error is thrown. Duplicate columns of
mcols(rowRanges(MethPat))
must contain the same data.
exptData
from all objects are combined into a
SimpleList with no name checking.
Peter Hickey, building on all the real work of Martin Morgan for the
SummarizedExperiment
class.
1 | ## TODO
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.