ROGUE icon indicating copy to clipboard operation
ROGUE copied to clipboard

Error in expr[i, ] : incorrect number of dimensions

Open MartaBenegas opened this issue 8 months ago • 1 comments

Hi, I'm encountering different errors while running ROGUE.

My data: https://drive.google.com/drive/folders/1ePMiDRiDg98yYqcJxNi0f5zzvtE90R2p?usp=sharing

How I'm loading it:

library(anndata)
library(nbHelpers)

counts <- read_h5ad("/home/marta/Downloads/eccb25/pbmc_multimodal.h5ad")$X
counts <- transpose_dgRMatrix(counts)
labels <- read.csv("/home/marta/Downloads/eccb25/15D_06R.tsv", header = TRUE, sep = "\t")$seurat_clusters
samples <-  sapply(strsplit(colnames(counts), "_"), `[`, 1)

ROGUE error with default values:

>  rogue.res <- ROGUE::rogue(counts, 
+                               labels = labels, 
+                               samples = samples,
+                               platform = "UMI")
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  pseudoinverse used at 0.052644
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  neighborhood radius 0.066052
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  reciprocal condition number  5.0004e-15
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  There are other near singularities as well. 0.0033163
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  pseudoinverse used at 0.052644
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  neighborhood radius 0.066052
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  reciprocal condition number  5.003e-15
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  There are other near singularities as well. 0.0033163
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  at  0.031507
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  radius  0.00011886
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  all data on boundary of neighborhood. make span bigger
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  pseudoinverse used at 0.031507
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  neighborhood radius 0.010902
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  reciprocal condition number  1
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  zero-width neighborhood. make span bigger
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  There are other near singularities as well. 0.00057595
Error in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  : 
  NA/NaN/Inf in foreign function call (arg 5)

With an increasing span:

>  rogue.res <- ROGUE::rogue(counts, 
+                               labels = labels, 
+                               samples = samples,
+                               platform = "UMI", span = 0.8)
Error in expr[i, ] : incorrect number of dimensions
> rogue.res <- ROGUE::rogue(counts, 
+                           labels = labels, 
+                           samples = samples,
+                           platform = "UMI", span = 0.9)
Error in expr[i, ] : incorrect number of dimensions

Could you please help me solve this issue? Let me know if you need any further data/tests from my side.

Thanks!!

> sessionInfo()
R version 4.5.0 (2025-04-11)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0  LAPACK version 3.10.0

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

time zone: Europe/Madrid
tzcode source: system (glibc)

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

other attached packages:
[1] tibble_3.2.1    ROGUE_1.0       nbHelpers_0.1.0 anndata_0.7.5.6

loaded via a namespace (and not attached):
 [1] Matrix_1.7-3      jsonlite_2.0.0    dplyr_1.1.4       compiler_4.5.0    gtools_3.9.5      tidyselect_1.2.1 
 [7] Rcpp_1.0.14       parallel_4.5.0    assertthat_0.2.1  png_0.1-8         yaml_2.3.10       fastmap_1.2.0    
[13] reticulate_1.42.0 lattice_0.22-5    here_1.0.1        R6_2.6.1          generics_0.1.4    knitr_1.50       
[19] rprojroot_2.0.4   pillar_1.10.2     rlang_1.1.6       xfun_0.52         cli_3.6.5         withr_3.0.2      
[25] magrittr_2.0.3    stringdist_0.9.15 digest_0.6.37     grid_4.5.0        rstudioapi_0.17.1 rappdirs_0.3.3   
[31] lifecycle_1.0.4   vctrs_0.6.5       evaluate_1.0.3    glue_1.8.0        rmarkdown_2.29    tools_4.5.0      
[37] pkgconfig_2.0.3   matrixcalc_1.0-6  htmltools_0.5.8.1

MartaBenegas avatar Jun 06 '25 15:06 MartaBenegas

I've encountered the same issue. I found that the code runs without errors when I don't specify the span value. However, I'm not sure what the purpose of the span parameter is.

Felix-Xie avatar Jul 08 '25 06:07 Felix-Xie