Comments (8)
good idea, thanks, will do that in the next days!
from scdblfinder.
So the lines you suggested to replace with sumCountsAcrossCells
were not summing counts but averaging pca values. For the moment I just replaced names with indexes.
(I changed the other point to a direct bluster
call)
from scdblfinder.
Didn't notice they were PCA values - in that case, you could shorten it down to:
#' @importFrom DelayedArray rowsum DelayedArray
y <- rowsum(DelayedArray(x), k) # DelayArray is only necessary if the reddims might not be ordinary matrices.
y / as.integer(table(k)[rownames(y)]) # subsetting is probably not necessary, but just to be safe.
This should be more efficient too, based on the comments in ?rowsum
examples.
from scdblfinder.
will do. Why the DelayedArray(x)
? If we import it, shouldn't R use the DelayedArray rowsum method anyway iff that's what x
is?
from scdblfinder.
If you believe that your reduced dimensions will only be ordinary matrices, then you can get rid of the DelayedArray()
(plus the import statements). But if you think that your reduced dimensions might be other matrix-like objects, like sparse matrices or whatever, then the wrapping in a DelayedArray()
(plus the imports) will ensure that those are handled correctly. base::rowsum
won't handle such weird objects correctly, and DelayedArray::rowsum
will only do so if the object is wrapped in a DA.
from scdblfinder.
will only do so if the object is wrapped in a DA.
That's the bit I don't get and would like to understand. This all works fine:
m <- matrix(1:12, nrow=4)
rowsum(m, c(1,1,2,2))
m2 <- as(m,"dgCMatrix")
rowsum(m2, c(1,1,2,2))
m3 <- DelayedArray(m)
rowsum(m3, c(1,1,2,2))
(Also works fine with DelayedArray::rowsum)
...)
I'll have to make the whole scDblFinder DelayedArray-friendly...
from scdblfinder.
Ah. Looks like DA added a rowsum.dgCMatrix
, for some reason. Probably because I nagged about it for so long.
Note that other matrices won't work, though:
m2.1 <- as(m, 'dgTMatrix')
rowsum(m2.1, c(1,1,2,2))
## Error in rowsum.default(m2.1, c(1, 1, 2, 2)) : 'x' must be numeric
Of course, none of this is relevant if you think that the reduced dims are going to be ordinary matrices, which they usually are. The DA stuff is primarily important for the assays. Good test is to see whether you can run scDblFinder on one of the small HDF5-backed PBMC datasets in TENxPBMCData without loading everything into memory.
from scdblfinder.
I'm pretty sure it won't run off memory at the moment, I haven't done anything yet to make it DelayedArray-friendly. Now I'm optimizing a few details and DA will be next...
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
- Error running scDblFinder HOT 3
- 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
- "did not converge" Error on cellbender3 HOT 8
- 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.