-
Notifications
You must be signed in to change notification settings - Fork 11
Description
I actually don t know why I come across this problem when I test fastMNN. I hope I could find out why this error happen, and code is as follows.
zilionis <- ZilionisLungData()
zilionis <- zilionis[, colSums(assay(zilionis)) != 0]
dim(zilionis)
bpp <- BiocParallel::MulticoreParam(20)
zilionis <- addPerCellQC(zilionis, BPPARAM=bpp,
subsets=list(Mito=which(rownames(zilionis)=="^MT-")))
zilionis <- logNormCounts(zilionis, size_factors = zilionis$sum)
set.seed(1010010101)
dec.zilionis <- modelGeneVarByPoisson(zilionis,
block=zilionis$Library, BPPARAM=bpp)
top.zilionis <- getTopHVGs(dec.zilionis, n=5000)
library(BiocNeighbors)
library(batchelor)
set.seed(1010001)
merged.zilionis <- fastMNN(zilionis, batch = zilionis$Library, subset.row = top.zilionis,
BSPARAM=BiocSingular::RandomParam(deferred = TRUE),
BNPARAM=AnnoyParam(),
BPPARAM=bpp)
And this is the traceback.
traceback()
19: h(simpleError(msg, call))
18: .handleSimpleError(function (cond)
.Internal(C_tryCatchHelper(addr, 1L, cond)), "类别为"ScaledMatrix"的对象不对: \n the supplied seed must support extract_array()",
base::quote(validObject(.Object)))
17: stop(msg, ": ", errors, domain = NA)
16: validObject(.Object)
15: initialize(value, ...)
14: initialize(value, ...)
13: new(...)
12: new2(Class, seed = seed)
11: new_DelayedArray(seed, Class = "ScaledMatrix")
10: DelayedArray(ScaledMatrixSeed(x, center = center, scale = scale))
9: DelayedArray(ScaledMatrixSeed(x, center = center, scale = scale))
8: ScaledMatrix(t(x), center = centers)
7: t(ScaledMatrix(t(x), center = centers))
6: .process_single_matrix_for_pca(mat, batch = batch, weights = weights,
subset.row = keep, deferred = bsdeferred(BSPARAM))
5: FUN(subset.row)
4: .multi_pca_single(x, batch = batch, d = d, weights = weights,
get.variance = get.variance, subset.row = subset.row, get.all.genes = correct.all,
BSPARAM = BSPARAM, BPPARAM = BPPARAM)
3: (function (x, batch, restrict = NULL, ..., subset.row = NULL,
cos.norm = TRUE, d = 50, weights = NULL, get.variance = FALSE,
correct.all = FALSE, BSPARAM = ExactParam(), BPPARAM = SerialParam())
{
batch <- factor(batch)
.check_valid_batch(x, batch)
if (cos.norm) {
l2 <- cosineNorm(x, mode = "l2norm", subset.row = subset.row,
BPPARAM = BPPARAM)
x <- .apply_cosine_norm(x, l2)
}
mat <- .multi_pca_single(x, batch = batch, d = d, weights = weights,
get.variance = get.variance, subset.row = subset.row,
get.all.genes = correct.all, BSPARAM = BSPARAM, BPPARAM = BPPARAM)
divided <- divideIntoBatches(mat[[1]], batch = batch, restrict = restrict,
byrow = TRUE)
output <- .fast_mnn(batches = divided$batches, restrict = divided$restricted,
..., BPPARAM = BPPARAM)
d.reo <- divided$reorder
output <- output[d.reo, , drop = FALSE]
...
2: do.call(.fast_mnn_single, c(list(x = batches[[1]], batch = batch,
restrict = restrict[[1]]), common.args))
1: fastMNN(zilionis, batch = zilionis$Library, subset.row = top.zilionis,
BPPARAM = bpp)