-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SummarizedExperiment::assay: on fastMNN object : object of type 'S4' is not subsettable #45
Comments
Sorry for the late reply. I don't have any issues running the example: library(batchelor)
example(fastMNN, echo=FALSE)
out
## class: SingleCellExperiment
## dim: 200 100
## metadata(2): merge.info pca.info
## assays(1): reconstructed
## rownames: NULL
## rowData names(1): rotation
## colnames: NULL
## colData names(1): batch
## reducedDimNames(1): corrected
## mainExpName: NULL
## altExpNames(0):
assay(out)
## <200 x 100> LowRankMatrix object of type "double":
## [,1] [,2] [,3] ... [,99] [,100]
## [1,] -0.041500974 -0.041187990 -0.065122142 . -0.01857182 -0.08582027
## [2,] 0.019251114 -0.047421044 -0.020124255 . -0.04065221 0.01079485
## [3,] -0.001653034 0.017117968 -0.038393065 . -0.07142613 -0.07357877
## [4,] -0.044129094 -0.061465542 -0.093328064 . -0.02522488 -0.05275507
## [5,] -0.028562310 -0.022114883 -0.047984941 . -0.12481886 -0.01802864
## ... . . . . . .
## [196,] -0.034075842 -0.121444735 -0.007966894 . -0.04559586 -0.06874582
## [197,] -0.077225050 0.003219620 -0.070414809 . 0.03878306 -0.07472732
## [198,] -0.068255656 -0.021519339 -0.018424398 . -0.05250330 -0.09911245
## [199,] -0.034577621 -0.086351051 -0.045710427 . -0.08996022 -0.01574235
## [200,] -0.034046424 -0.049210218 -0.092373174 . -0.08422264 -0.13358312 It would be helpful to see |
Dear @LTLA , I also encounter this error even when running the example provided in fastMNN function's Documentation. > library(batchelor)
> B1 <- matrix(rnorm(10000, -1), ncol=50) # Batch 1
> B2 <- matrix(rnorm(10000, 1), ncol=50) # Batch 2
> out <- fastMNN(B1, B2)
Warning in (function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE, :
You're computing too large a percentage of total singular values, use a standard svd instead.
> out
class: SingleCellExperiment
dim: 200 100
metadata(2): merge.info pca.info
assays(1): reconstructed
rownames: NULL
rowData names(1): rotation
colnames: NULL
colData names(1): batch
reducedDimNames(1): corrected
mainExpName: NULL
altExpNames(0):
> assay(out)
Error in (function (cond) :
error in evaluating the argument 'x' in selecting a method for function 'type': object of type 'S4' is not subsettable > str(assay(out, withDimnames=FALSE))
Formal class 'LowRankMatrix' [package "BiocSingular"] with 1 slot
..@ seed:Formal class 'LowRankMatrixSeed' [package "BiocSingular"] with 2 slots
.. .. ..@ rotation : num [1:200, 1:50] -0.0622 -0.0752 -0.0614 -0.0641 -0.0696 ...
.. .. ..@ components: num [1:100, 1:50] 0.709 0.706 0.71 0.709 0.707 ... Here is my session info:
Thank you in advance for your time and consideration. :) |
I have no such problems with running > example(fastMNN)
fstMNN> B1 <- matrix(rnorm(10000, -1), ncol=50) # Batch 1
fstMNN> B2 <- matrix(rnorm(10000, 1), ncol=50) # Batch 2
fstMNN> out <- fastMNN(B1, B2)
Warning in (function (A, nv = 5, nu = nv, maxit = 1000, work = nv + 7, reorth = TRUE, :
You're computing too large a percentage of total singular values, use a standard svd instead.
fstMNN> # Corrected values for use in clustering, etc.
fstMNN> str(reducedDim(out))
num [1:100, 1:50] -0.715 -0.71 -0.71 -0.71 -0.706 ...
fstMNN> # Extracting corrected expression values for gene 10.
fstMNN> summary(assay(out)[10,])
Min. 1st Qu. Median Mean 3rd Qu. Max.
-0.163524 -0.070971 -0.037425 -0.040175 -0.008362 0.063427 I will note that you are one BioC release behind, based on the version numbers in your session information. Perhaps try updating to the latest BioC release. (That said, I didn't change anything in any of the affected packages between releases, so I don't know whether this would really help; but you'd want to update anyway, because if there really is a problem, I'll only be updating the latest release, and not any of the older releases.) |
Thanks for your time. Strange indeed. |
Hello,
I have an issue with the 'fastMNN' function in batchelor.
I can't access the assay of the generated object as I get an error.
assay(out)
When I manually create an sce object, I don't encounter this problem.
Similarly, when I convert a Seurat object into an sce object, there are no issues accessing the assays.
Here's my SessionInfo()
Thank you for your help
The text was updated successfully, but these errors were encountered: