Hello, I want to run clusterExperiment using a custom function. I was wondering if it would be possible to run the Seurat Functions used for clustering? Maybe something like this:
SNN_wrap <- function(inputMatrix, k, pcs = 20, ...) {
pca <- RunPCA(inputMatrix)
snn <- FindNeighbors([email protected][, 1:pcs])
res <- FindClusters(snn$snn, resolution = k)
return(as.numeric(as.character(res[, 1])))
}
SNN <- ClusterFunction(SNN_wrap, inputType = "X", algorithmType = "K",
outputType="vector")
Running the individual Seurat Functions (RunPCA, FindNeighbors, FindClusters) with dummy data works. However, the resolution parameter is not exactly "k" - with integer number of clusters. I get errors when trying to run ClusterFunction.
Would this be possible to integrate Seurat Functions in some way into clusterMany?
Thank you!
Hello, I want to run clusterExperiment using a custom function. I was wondering if it would be possible to run the Seurat Functions used for clustering? Maybe something like this:
SNN_wrap <- function(inputMatrix, k, pcs = 20, ...) {
pca <- RunPCA(inputMatrix)
snn <- FindNeighbors([email protected][, 1:pcs])
res <- FindClusters(snn$snn, resolution = k)
return(as.numeric(as.character(res[, 1])))
}
SNN <- ClusterFunction(SNN_wrap, inputType = "X", algorithmType = "K",
outputType="vector")
Running the individual Seurat Functions (RunPCA, FindNeighbors, FindClusters) with dummy data works. However, the resolution parameter is not exactly "k" - with integer number of clusters. I get errors when trying to run ClusterFunction.
Would this be possible to integrate Seurat Functions in some way into clusterMany?
Thank you!