waldronlab / MultiAssayExperiment

Bioconductor package for management of multi-assay data
https://waldronlab.io/MultiAssayExperiment/
69 stars 32 forks source link

Error subscript contains invalid rownames (guess when one experiment has 0 rows) #322

Closed danielinteractive closed 1 year ago

danielinteractive commented 1 year ago

With version 1.25.6 under R devel we see:

library(MultiAssayExperiment)
m <- matrix(0, 3, 3, dimnames=list(letters[1:3], letters[1:3]))
m2 <- matrix(0, 0, 0)
m3 <- matrix(0, 1, 1, dimnames=list("d", "d"))
obs <- MultiAssayExperiment(list(m=m, m2=m2, m3=m3))
obs[["m"]] <- obs[["m"]][, c("a", "b")]

giving Error: subscript contains invalid rownames. This worked in previous Bioconductor release 3.16 with R 4.2.2 nicely.

Session Info:

R Under development (unstable) (2022-11-21 r83371)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS:   /usr/local/lib/R/lib/libRblas.so
LAPACK: /usr/local/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=C                 LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] MultiAssayExperiment_1.25.6 SummarizedExperiment_1.29.1
 [3] Biobase_2.59.0              GenomicRanges_1.51.4       
 [5] GenomeInfoDb_1.35.13        IRanges_2.33.0             
 [7] S4Vectors_0.37.3            BiocGenerics_0.45.0        
 [9] MatrixGenerics_1.11.0       matrixStats_0.63.0         

loaded via a namespace (and not attached):
 [1] zlibbioc_1.45.0        Matrix_1.5-3           lattice_0.20-45       
 [4] GenomeInfoDbData_1.2.9 XVector_0.39.0         RCurl_1.98-1.9        
 [7] bitops_1.0-7           grid_4.3.0             DelayedArray_0.25.0   
[10] compiler_4.3.0         tools_4.3.0
LiNk-NY commented 1 year ago

Thanks Daniel! It should be fixed now. Thanks for the reproducible example. I've used it for the unit test. Best, Marcel

danielinteractive commented 1 year ago

That was fast, thanks a lot Marcel!