R/scanpyFunctions.R
runScanpyFindClusters.Rd
runScanpyFindClusters Computes the clusters from the input sce object and stores them back in sce object
runScanpyFindClusters(
inSCE,
useAssay = "scanpyScaledData",
useReducedDim = "scanpyPCA",
nNeighbors = 10,
dims = 40,
method = c("leiden", "louvain"),
colDataName = NULL,
resolution = 1,
niterations = -1,
flavor = "vtraag",
use_weights = FALSE,
cor_method = "pearson",
inplace = TRUE,
externalReduction = NULL,
seed = 12345
)
(sce) object from which clusters should be computed and stored in
Assay containing scaled counts to use for clustering.
Reduction method to use for computing clusters.
Default "scanpyPCA"
.
The size of local neighborhood (in terms of number of
neighboring data points) used for manifold approximation. Larger values
result in more global views of the manifold, while smaller values result in
more local data being preserved. Default 10
.
numeric value of how many components to use for computing
clusters. Default 40
.
selected method to compute clusters. One of "louvain",
and "leiden". Default louvain
.
Specify the name to give to this clustering result.
Default is NULL
that will generate a meaningful name automatically.
A parameter value controlling the coarseness of the
clustering. Higher values lead to more clusters Default 1
.
How many iterations of the Leiden clustering method to
perform. Positive values above 2 define the total number of iterations to
perform, -1 has the method run until it reaches its optimal clustering.
Default -1
.
Choose between to packages for computing the clustering.
Default vtraag
Boolean. Use weights from knn graph. Default FALSE
correlation method to use. Options are ‘pearson’,
‘kendall’, and ‘spearman’. Default pearson
.
If True, adds dendrogram information to annData object,
else this function returns the information. Default TRUE
Pass DimReduce object if PCA computed through
other libraries. Default NULL
.
Specify numeric value to set as a seed. Default 12345
.
Updated sce object which now contains the computed clusters
data(scExample, package = "singleCellTK")
if (FALSE) {
sce <- runScanpyNormalizeData(sce, useAssay = "counts")
sce <- runScanpyFindHVG(sce, useAssay = "scanpyNormData", method = "seurat")
sce <- runScanpyScaleData(sce, useAssay = "scanpyNormData")
sce <- runScanpyPCA(sce, useAssay = "scanpyScaledData")
sce <- runScanpyFindClusters(sce, useReducedDim = "scanpyPCA")
}