Closed pablo-rodr-bio2 closed 3 years ago
Strangely, if I try with another big HDF5Array, scale() works perfectly too, so maybe the problem is in the TENxBrainData end
library(scRNAseq)
sce <- ReprocessedAllenData("tophat_counts")
sce <- as(assay(sce, "tophat_counts"), "HDF5Array")
DelayedArray::scale(sce)
# <20816 x 379> matrix of class DelayedMatrix and type "double":
# SRR2140028 SRR2140022 SRR2140055 ... SRR2139341 SRR2139336
# 0610007P14Rik -0.003141943 0.118237602 1.154833503 . 0.24846387 0.05805555
# 0610009B22Rik -0.056619890 -0.191826493 0.077402182 . 0.15019342 0.38569442
# 0610009L18Rik -0.198670686 -0.191826493 -0.206755529 . -0.18358724 -0.17519212
# 0610009O20Rik -0.198670686 0.812372858 -0.206755529 . 0.03865082 0.15946758
# 0610010F05Rik -0.198670686 -0.191826493 -0.141636054 . 0.13409740 0.02295138
# ... . . . . . .
# Zyg11a -0.1986707 -0.1918265 -0.2067555 . -0.18358724 -0.17519212
# Zyg11b 0.1163478 0.2643378 0.3773464 . 0.05079343 -0.09250231
# Zyx -0.1986707 -0.1848086 -0.2067555 . 0.04316900 -0.17519212
# Zzef1 -0.1677537 0.2534919 -0.2047822 . -0.18358724 0.35371062
# Zzz3 -0.1978351 -0.1375972 -0.2067555 . -0.18245769 -0.17519212
Thanks @pablo-rodr-bio2 for the report. The scale()
method for DelayedMatrix objects uses rowVars()
internally, which unfortunately seems to be broken on DelayedMatrix objects for certain block sizes:
library(HDF5Array)
M <- as(matrix(runif(300), ncol=15), "HDF5Matrix")
setAutoBlockSize(500)
library(DelayedMatrixStats)
rowVars(M, center=0)
# Error in center[subset] : invalid subscript type 'S4'
The rowVars()
method for DelayedMatrix objects is defined in DelayedMatrixStats.
I started to work on a PR that addresses this issue plus other issues related to how various DelayedMatrixStats methods handle the center
argument.
Hi @pablo-rodr-bio2 ,
This should be addressed in DelayedMatrixStats 1.13.1 which will become available via BiocManager::install()
in the next 15h or so. Please let me know if that addresses the issue for you so we can close this.
Thanks, H.
Yes! Now it works correctly, thank you so much!
I've tried using the new function
DelayedArray::scale()
on the assay ofTENxBrainData20k()
and it's giving back an errorThis is on a bioconductor_docker container after installing all the proper packages:
First I do a test with a simple hdf5 matrix and everything works:
But then, when using the TENx experiment, there's an error: