seurat-object icon indicating copy to clipboard operation
seurat-object copied to clipboard

Weird issue with doing operations when ncells = nfeatures

Open saketkc opened this issue 9 months ago • 0 comments

Doing operations on layers with same number of features and cells results in missing feature overlap issue (seuratv5 branch):

set.seed(seed = 1)
dummyexpMat <- matrix(
  data = sample(x = c(1:50), size = 1e4, replace = TRUE),
  ncol = 100, nrow = 100
)
colnames(x = dummyexpMat) <- paste0("cell", seq(ncol(x = dummyexpMat)))
row.names(x = dummyexpMat) <- paste0("gene", seq(nrow(x = dummyexpMat)))

# Create Seurat object for testing
obj <- CreateSeuratObject(counts = as.sparse(dummyexpMat))
obj <- NormalizeData(object = obj, verbose = FALSE)
obj <- ScaleData(object = obj, verbose = FALSE)


Warning: No layers found matching search pattern provided 
Error: No feature overlap between existing object and new layer data

saketkc avatar Sep 25 '23 01:09 saketkc