Comments (8)
Hi,
I've never seen this error, but this could be a memory and/or multithreading issue.
I'd recommend to check the following:
- monitor your RAM usage when running scDblFinder (e.g. using
htop
). - the package per se is not very memory hungry (it's been ran on much larger datasets), but the object itself can be, in particular earlier versions of
as.SingleCellExperiment
had a bug that made the object huge (although this should be solved in the version you're using). So check the size (e.g. usingformat(object.size(x), units="Gb")
of bothcell_bender_seurat
andsce
. If you see thatsce
is much bigger, you can always skip the conversion and run scDblFinder with something like:
sce <- scDblFinder(GetAssayData(cell_bender_seurat, slot="counts", assay="RNA3"),
samples=cell_bender_seurat$orig.ident)
- If from
htop
it does seem to be memory-related, try reducing the number of threads (or eventually using a single one).
from scdblfinder.
thank you for the prompt response
- It looks normal (below 1%)
- seems ok
format(object.size(cell_bender_seurat), units="Gb") # "8 Gb"
format(object.size(sce), units="Gb") # "2.9 Gb"
A) Could it be something to do with how Seurat v.5 has layers ( 8 sample 8 layers for counts for example), and when I convert it to Array v.3 it becomes one matrix 36601 x 75331?
B) Tried to run without threads:
sce.standard <- scDblFinder(sce, samples = "orig.ident")
Warning messages:
1: In rpois(nrow(x) * length(wAd), as.numeric(as.matrix(x[, wAd]))) :
NAs produced
2: In value[[3L]](cond) :
Error in calculating norm factors:Error in .local(x, ...): size factors should be positive
C) Tried this too
sce <- scDblFinder(GetAssayData(cell_bender_seurat, slot="counts", assay="RNA3"),
samples=cell_bender_seurat$orig.ident)
Error in .checkSCE(sce) :
`sce` should be a SingleCellExperiment, a SummarizedExperiment, or an array (i.e. matrix, sparse matric, etc.) of counts.
In addition: Warning message:
The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
ℹ Please use the `layer` argument instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
from scdblfinder.
Not sure I understand your question A, the original Seurat object also has dimensions 36601 x 75331...
- Can you check
class(GetAssayData(cell_bender_seurat, layer="counts", assay="RNA3"))
? - Can you check
quantile(colSums(counts(sce)))
- Can you try this:
sce.standard <- scDblFinder(sce[VariableFeatures(cell_bender_seurat),], samples = "orig.ident")
from scdblfinder.
class(GetAssayData(cell_bender_seurat, layer="counts", assay="RNA3"))
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"
quantile(colSums(counts(sce)))
0% 25% 50% 75% 100%
201 650 2209 5732 81977
- It is running since 1 hr - I hope it is a good sign
sce.standard <- scDblFinder(sce[VariableFeatures(cell_bender_seurat),], samples = "orig.ident")
from scdblfinder.
I'm unsure what's the issue here, but it appears to be related to 1) the fact that you have cells with a very low library size (your 201 is crap, personally I'd have filtered out many) and 2) the feature selection internal to scDblFinder might have resulted in some cells not having reads in those features. This appears to have been solved by using the VariableFeatures (which is a perfectly decent way of doing things), or would most likely also be solved by filtering out cells with a low library size (e.g. taking >=400-500).
If you want you can try again with multithreading, user either of these 2 solutions.
from scdblfinder.
how long in average does it take to run scDblFinder ?
- its been ~5 hrs
- filtered out data, which eventually crashed
quantile(colSums(counts(sce)))
0% 25% 50% 75% 100%
451 1189 3332 6480 81977
sce.standard <- scDblFinder(sce, samples = "orig.ident", BPPARAM=MulticoreParam(8))
Warning in (function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE, :
convergence criterion below machine epsilon
Warning in (function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE, :
did not converge--results might be invalid!; try increasing work or maxit
Warning in (function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE, :
convergence criterion below machine epsilon
Warning in (function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE, :
did not converge--results might be invalid!; try increasing work or maxit
Stop worker failed with the error: wrong args for environment subassignment
from scdblfinder.
I figure out why I was getting that error, few steps back in my analysis:
I removed ambient RNA with Cell Bender v3, which generated negative values in the count matrix, that's why scDblFinder() was not able to process my data. The issue about cell bender generating a negative count matrix is discussed here htps://github.com/broadinstitute/CellBender/issues/306. To fix it run Cellbender v.2 re-run scDblFinder()
all works, quite quickly
Cheers.
from scdblfinder.
Hi,
Great that we have an explanation, thanks for coming back on this.
I've now added in the devel version a check of that so that a more useful error message is provided.
Best,
Pierre-Luc
from scdblfinder.
Related Issues (20)
- Error running scDblFinder HOT 4
- how to get layers info after running scDblFinder HOT 2
- Multiple errors: samples argument and Matrix HOT 4
- Removing genes from count matrix before doublet detection HOT 3
- SCTransform example in vignette not working HOT 1
- Wild Variability in doublet scores HOT 2
- Where to run scDblFinder in SCT workflow HOT 1
- High doublet rate? HOT 5
- non-interpretable error message when providing non-integer as nfeatures argument HOT 1
- Clarify recommended nFeatures/artificialDoublets for scATACseq doublet removal in vignette HOT 2
- Doublet filtering in Parse Biosciences data HOT 6
- Unable to run scDblFinder - "as_cholmod_sparse" does not exist HOT 5
- Unable to install scDblFinder HOT 2
- Ambient RNA Removal HOT 4
- Compatibility between Seurat, matrix and scDblFinder versions HOT 4
- error in scATAC HOT 1
- Does ‘Size factors should be positive’ error matter? HOT 4
- How can I add results to back my original file HOT 2
- Error running scDblFinder HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scdblfinder.