batchelor
batchelor copied to clipboard
Unexpected number of cells produced in fastMNN
I tried to run fastMNN (installed today from bioconductor), but I get more cells than expecte din the corrected object. Any idea why?
sobj <- subset(data, features=hvg)
print('sobj')
print(sobj)
expr <- GetAssayData(object = sobj ,slot = "data")
print('expr')
print(dim(expr))
sce <- fastMNN(expr, batch = [email protected][[batch]])
print('sce')
print(dim(sce))
[1] "sobj"
An object of class Seurat
2000 features across 2730 samples within 1 assay
Active assay: originalexp (2000 features, 0 variable features)
[1] "expr"
[1] 2000 2730
[1] "sce"
[1] 2000 9815
I have no idea. I assume that expr
is a matrix or dgCMatrix
, and not some custom class that might be reinterpreted as a list.
Yes, it is a matrix
class(expr)
'matrix''array'
Well, I dunno. Works fine for me on batchelor 1.10.0.
library(batchelor)
x <- matrix(runif(2000000), ncol=1000)
dim(x)
## [1] 2000 1000
batch <- sample(2, ncol(x), replace=TRUE)
out <- fastMNN(x, batch=batch)
dim(out)
## [1] 2000 1000
Try modifying the example above to reproduce the error.