Closed tomyputw closed 1 month ago
Thanks for the report.
Please:
library(package)
commands that are needed. Right now I get:
> zilionis <- ZilionisLungData()
Error in ZilionisLungData() : could not find function "ZilionisLungData"
sessionInfo()
.BiocManager::valid()
for that.An abbreviated version of this works fine for me:
library(scRNAseq)
zeisel <- ZeiselBrainData()
zeisel <- zeisel[, colSums(assay(zeisel)) != 0]
dim(zeisel)
library(scran)
bpp <- BiocParallel::MulticoreParam(2)
zeisel <- addPerCellQC(
zeisel,
BPPARAM=bpp,
subsets=list(Mito=grep("^mt-", rownames(zeisel))) # note, your subsets don't make sense.
)
zeisel <- logNormCounts(zeisel, size_factors = zeisel$sum)
set.seed(1010010101)
dec.zeisel <- modelGeneVarByPoisson(zeisel,
block=zeisel$Library, BPPARAM=bpp)
top.zeisel <- getTopHVGs(dec.zeisel, n=5000)
library(BiocNeighbors)
library(batchelor)
set.seed(1010001)
merged.zeisel <- fastMNN(zeisel, batch = zeisel$tissue, subset.row = top.zeisel,
BSPARAM=BiocSingular::RandomParam(deferred = TRUE),
BNPARAM=AnnoyParam(),
BPPARAM=bpp)
The Zilionis dataset has the same matrix type so there shouldn't be much difference, aside from computational time.
@LTLA Thank you for your reply very much. I retry in linux and it work well.
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)