subset {clusterExperiment} | R Documentation |
These functions are used to subset ClusterExperiment objects, either by removing samples, genes, or clusterings
## S4 method for signature 'ClusterExperiment,character' removeClusterings(x, whichClusters, ...) ## S4 method for signature 'ClusterExperiment,numeric' removeClusterings(x, whichClusters) ## S4 method for signature 'ClusterExperiment,numeric' removeClusters(x, whichCluster, clustersToRemove, makePrimary = FALSE, clusterLabels = NULL) ## S4 method for signature 'ClusterExperiment,character' removeClusters(x, whichCluster, ...) ## S4 method for signature 'ClusterExperiment,ANY,character,ANY' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ClusterExperiment,ANY,logical,ANY' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ClusterExperiment,ANY,numeric,ANY' x[i, j, ..., drop = TRUE]
x |
a ClusterExperiment object. |
whichClusters |
argument that can be either numeric or character value
indicating the clusters to be used. If numeric, gives the indices of the
|
... |
The arguments |
whichCluster |
Clustering from which to remove clusters for
|
clustersToRemove |
numeric vector identifying the clusters to remove (whose samples will be reassigned to -1 value). |
makePrimary |
whether to make the added cluster the primary cluster (only relevant if |
clusterLabels |
label(s) for the clusters being added. If |
i, j |
A vector of logical or integer subscripts, indicating the rows and columns to be subsetted for |
drop |
A logical scalar that is ignored. |
removeClusterings
removes the clusters given by
whichClusters
. If the
primaryCluster
is one of the clusters removed, the
primaryClusterIndex
is set to 1 and the dendrogram and coclustering
matrix are discarded and orderSamples is set to 1:NCOL(x)
.
removeClusters
creates a new cluster that unassigns samples in cluster clustersToRemove
(in the clustering defined by whichClusters
) and assigns them to -1 (unassigned)
Note that when subsetting the data, the dendrogram information and the co-clustering matrix are lost.
A ClusterExperiment
object.
removeClusterings
returns a ClusterExperiment
object,
unless all clusters are removed, in which case it returns a
SingleCellExperiment
object.