| ClusterExperiment-class | R Documentation |
ClusterExperiment is a class that extends
SingleCellExperiment and is used to store the data
and clustering information.
In addition to the slots of the SingleCellExperiment
class, the ClusterExperiment object has the additional slots described
in the Slots section.
There are several methods implemented for this class. The most
important methods (e.g., clusterMany, makeConsensus,
...) have their own help page. Simple helper methods are described in the
Methods section. For a comprehensive list of methods specific to this class
see the Reference Manual.
The constructor ClusterExperiment creates an object of the
class ClusterExperiment. However, the typical way of creating these
objects is the result of a call to clusterMany or
clusterSingle.
Note that when subsetting the data, the co-clustering and dendrogram information are lost.
ClusterExperiment(object, clusters, ...)
## S4 method for signature 'matrixOrHDF5,ANY'
ClusterExperiment(object, clusters, ...)
## S4 method for signature 'SummarizedExperiment,ANY'
ClusterExperiment(object, clusters, ...)
## S4 method for signature 'SingleCellExperiment,numeric'
ClusterExperiment(object, clusters, ...)
## S4 method for signature 'SingleCellExperiment,character'
ClusterExperiment(object, clusters, ...)
## S4 method for signature 'SingleCellExperiment,factor'
ClusterExperiment(object, clusters, ...)
## S4 method for signature 'SingleCellExperiment,matrix'
ClusterExperiment(
object,
clusters,
transformation = function(x) {
x
},
primaryIndex = 1,
clusterTypes = "User",
clusterInfo = NULL,
orderSamples = seq_len(ncol(object)),
dendro_samples = NULL,
dendro_index = NA_real_,
dendro_clusters = NULL,
coClustering = NULL,
merge_index = NA_real_,
merge_cutoff = NA_real_,
merge_dendrocluster_index = NA_real_,
merge_nodeProp = NULL,
merge_nodeMerge = NULL,
merge_method = NA_character_,
merge_demethod = NA_character_,
clusterLegend = NULL,
checkTransformAndAssay = TRUE
)
object |
a matrix or |
clusters |
can be either a numeric or character vector, a factor, or a numeric matrix, containing the cluster labels. |
... |
The arguments |
transformation |
function. A function to transform the data before performing steps that assume normal-like data (i.e. constant variance), such as the log. |
primaryIndex |
integer. Sets the 'primaryIndex' slot (see Slots). |
clusterTypes |
a string describing the nature of the clustering. The values 'clusterSingle', 'clusterMany', 'mergeClusters', 'makeConsensus' are reserved for the clustering coming from the package workflow and should not be used when creating a new object with the constructor. |
clusterInfo |
a list with information on the clustering (see Slots). |
orderSamples |
a vector of integers. Sets the 'orderSamples' slot (see Slots). |
dendro_samples |
phylo4 object. Sets the 'dendro_samples' slot (see Slots). |
dendro_index |
numeric. Sets the |
dendro_clusters |
phylo4 object. Sets the 'dendro_clusters' slot (see Slots). |
coClustering |
matrix. Sets the |
merge_index |
integer. Sets the |
merge_cutoff |
numeric. Sets the |
merge_dendrocluster_index |
integer. Sets the
|
merge_nodeProp |
data.frame. Sets the |
merge_nodeMerge |
data.frame. Sets the |
merge_method |
character, Sets the |
merge_demethod |
character, Sets the
|
clusterLegend |
list, Sets the |
checkTransformAndAssay |
logical. Whether to check the content of the assay and given transformation function for whether they are valid. |
The clusterLegend argument to ClusterExperiment
must be a valid clusterLegend format and match the values in clusters,
in that the "clusterIds" column must matches the value in the clustering matrix
clusters. If names(clusterLegend)==NULL, it is assumed that the
entries of clusterLegend are in the same order as the columns of
clusters. Generally, this is not a good way for users to set the
clusterLegend slot.
The ClusterExperiment constructor function gives
clusterLabels based on the column names of the input
matrix/SingleCellExperiment. If missing, will assign labels
"cluster1","cluster2", etc.
Note that the validity check when creating a new
ClusterExperiment object with new is less extensive than when
using ClusterExperiment function with
checkTransformAndAssay=TRUE (the default). Users are advised to use
ClusterExperiment to create new ClusterExperiment objects.
A ClusterExperiment object.
transformationfunction. Function to transform the data by when methods that assume normal-like data (e.g. log)
clusterMatrixmatrix. A matrix giving the integer-valued cluster ids for each sample. The rows of the matrix correspond to clusterings and columns to samples. The integer values are assigned in the order that the clusters were found, if found by setting sequential=TRUE in clusterSingle. "-1" indicates the sample was not clustered.
primaryIndexnumeric. An index that specifies the primary set of labels.
clusterInfolist. A list with info about the clustering.
If created from clusterSingle, clusterInfo will include the
parameter used for the call, and the call itself. If sequential = TRUE
it will also include the following components.
clusterInfoif sequential=TRUE and clusters were successfully
found, a matrix of information regarding the algorithm behavior for each
cluster (the starting and stopping K for each cluster, and the number of
iterations for each cluster).
whyStopif sequential=TRUE and clusters were successfully
found, a character string explaining what triggered the algorithm to stop.
merge_indexindex of the current merged cluster
merge_cutoffvalue for the cutoff used to determine whether to merge clusters
merge_dendrocluster_indexindex of the cluster merged with the current merge
merge_nodeMergedata.frame of information about nodes merged in the
current merge. See mergeClusters
merge_nodePropdata.frame of information of proportion estimated
non-null at each node of dendrogram. See mergeClusters
merge_methodcharacter indicating method used for merging. See
mergeClusters
merge_demethodcharacter indicating the DE method used for merging. See
mergeClusters
clusterTypescharacter vector with the origin of each column of clusterMatrix.
dendro_samplesphylo4d object. A dendrogram
containing the cluster relationship (leaves are samples; see
clusterDendrogram for details).
dendro_clustersphylo4d object. A dendrogram
containing the cluster relationship (leaves are clusters; see see
sampleDendrogram for details).
dendro_indexnumeric. An integer giving the cluster that was used to make the dendrograms. NA_real_ value if no dendrograms are saved.
coClusteringOne of
NULL, i.e. empty
a
numeric vector, signifying the indices of the clusterings in the
clusterMatrix that were used for makeConsensus. This allows for the
recreation of the distance matrix (using hamming distance) if needed for
function plotClusters but doesn't require storage of full NxN
matrix.
a sparseMatrix object – a sparse
representation of the NxN matrix with the cluster co-occurrence
information; this can either be based on subsampling or on co-clustering
across parameter sets (see clusterMany). The matrix is a square
matrix with number of rows/columns equal to the number of samples.
clusterLegenda list, one per cluster in clusterMatrix. Each
element of the list is a matrix with nrows equal to the number of different
clusters in the clustering, and consisting of at least two columns with the
following column names: "clusterId" and "color".
orderSamplesa numeric vector (of integers) defining the order of samples to be used for plotting of samples. Usually set internally by other functions.
sparseMatrix phylo4d
sce <- matrix(data=rnorm(200), ncol=10)
labels <- gl(5, 2)
cc <- ClusterExperiment(sce, as.numeric(labels), transformation =
function(x){x})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.