Closed danshu closed 5 years ago
Can you make a minimum reproducible example?
https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
Certainly I have no problems running doubletCluster
on a SingleCellExperiment object:
... which is probably where you got the code from anyway.
This seems to have something to do with rownames. counts <- as.matrix(counts(sce)) rownames(counts) <- c() dbl.out <- doubletCluster(counts, sce$Cluster) After deleting rownames, there is no error now.
On the other hand, for the example (https://rdrr.io/github/MarioniLab/scran/man/doubletCluster.html): rownames(counts) <- paste0("gene",1:100) After giving rownames to "counts", I got the same error.
Interestingly, I got the same error when running "read10xCounts()". Actually, there is no such error before I updated scater and scran.
R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux buster/sid
Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.8.0 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.8.0
locale:
[1] LC_CTYPE=en_HK.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_HK.UTF-8 LC_COLLATE=en_HK.UTF-8
[5] LC_MONETARY=en_HK.UTF-8 LC_MESSAGES=en_HK.UTF-8
[7] LC_PAPER=en_HK.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_HK.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets [8] methods base
other attached packages:
[1] DropletUtils_1.0.3 SingleCellExperiment_1.3.11
[3] SummarizedExperiment_1.10.1 DelayedArray_0.7.48
[5] matrixStats_0.54.0 Biobase_2.40.0
[7] GenomicRanges_1.32.7 GenomeInfoDb_1.16.0
[9] IRanges_2.14.12 S4Vectors_0.19.22
[11] BiocGenerics_0.27.1 BiocParallel_1.14.2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.19 XVector_0.20.0 edgeR_3.23.5
[4] lattice_0.20-35 tools_3.5.1 grid_3.5.1
[7] rhdf5_2.25.11 Matrix_1.2-14 GenomeInfoDbData_1.1.0
[10] Rhdf5lib_1.3.3 bitops_1.0-6 RCurl_1.95-4.11
[13] limma_3.36.5 compiler_3.5.1 locfit_1.5-9.1
Regarding the modified example; I observe no such error with the following code:
library(scran)
# Mocking up an example.
ngenes <- 100
mu1 <- 2^rexp(ngenes)
mu2 <- 2^rnorm(ngenes)
counts.1 <- matrix(rpois(ngenes*100, mu1), nrow=ngenes)
counts.2 <- matrix(rpois(ngenes*100, mu2), nrow=ngenes)
counts.m <- matrix(rpois(ngenes*20, mu1+mu2), nrow=ngenes)
counts <- cbind(counts.1, counts.2, counts.m)
clusters <- rep(1:3, c(ncol(counts.1), ncol(counts.2), ncol(counts.m)))
rownames(counts) <- paste0("gene", seq_len(ngenes))
# Find potential doublets: works fine for me.
dbl <- doubletCluster(counts, clusters)
If you want to use the latest version of scran, then you should also be using the latest version of the other Bioconductor packages. I would suggest running BiocManager::install(version="devel")
to synchronize the other packages; this may or may not solve your problem.
Thanks! Updating "other attached packages" to development versions solved this problem.
Hi,
I'm using doubletCluster to identify potential doublets but having this error: dbl.out <- doubletCluster(sce, sce$Cluster) Error in
rownames<-
(*tmp*
, value = c("AL627309.1", "CICP27", "AL627309.7", : invalid rownames length This error does not show up when I run doubletCluster using the following example? https://rdrr.io/github/MarioniLab/scran/man/doubletCluster.html Anyone can help?Best, Danshu