scAI icon indicating copy to clipboard operation
scAI copied to clipboard

Can't run identifyClusters

Open f6v opened this issue 3 years ago • 4 comments

I've been trying to run scAI in an HPC environment. Here's the code:

LIB_PATH = "./R_libs/R-4.0.0/"

library(Seurat)
library(ggplot2)
library(scAI, lib.loc = LIB_PATH)
library(swne, lib.loc = LIB_PATH)

load("./data/data_simulation.rda")
X <- data_simulation$data
labels <- data_simulation$labels

scAI_outs <- create_scAIobject(raw.data = X, do.sparse = F)

cat("Preprocessing...")
scAI_outs <- preprocessing(scAI_outs, assay = NULL)

cat("Running scAI...")
scAI_outs <- run_scAI(scAI_outs, K = 20, nrun = 1, do.fast = T)

cat("Running identifyClusters...")
scAI_outs <- identifyClusters(scAI_outs, resolution = 0.9)

cat("Running getAggregatedData...")
scAI_outs <- getAggregatedData(scAI_outs, group = scAI_outs@identity)

cat("Running reducedDims...")
scAI_outs <- reducedDims(scAI_outs, method = "tsne")

cat("Running cellVisualization...")
umap_plot <- cellVisualization(scAI_outs, scAI_outs@embed$umap, color.by = "cluster")
ggsave("./results/umap_clusters.png", umap_plot)

I've tried both simulated and 10x PBMC dataset. Every time it fails on identifyClusters:

Error in `$<-.data.frame`(S3Part(x, TRUE), name, value) :
  replacement has 500 rows, data has 0
Calls: identifyClusters -> $<- -> $<- -> $<-.data.frame

Would you have any advice?

f6v avatar Nov 13 '20 16:11 f6v