Perf on DIABLO with one component

Hi,
I am currently using DIABLO algorithm to integrate 4 -omics in order to extract a biomarker in the context of auto-immune diseases. My sample size is 51 with 27 samples belonging to a class and 24 to the other. I run the block.splsda using only 1 component but I get the following error:

Error in colnames<-(*tmp*, value = (names(crit) = paste0(“fold”, 1:M))) :
attempt to set ‘colnames’ on an object with less than two dimensions

I do not get it when I increase the number of components to 2. What is the explanation for this?
does that mean that it is not possible to evaluate the performance of a model on 1 component?

Also, when I run the model with 2 components, the perf function does not fill up the “average.predict.class” slot -it gives me an empty list- but I have bestParameters$perf$AveragedPredict.error.rate filled with values…

I use to run it without any issue untill maybe a couple of weeks ago…

Thank you very much in advance for your help!

Hi @Feeedis,

I did not face any issues running block.splsda using one component and cannot reproduce this. Please refer to the following post to submit an example that could help us identify the issue.

Best,

Al

Hello, thank you for your reply!
here an example of the bug on the perf() function evaluation on a block.splsda object with only one component!

I would really appreciate your help on this issue!

Hi @Feeedis,

I still cannot reproduce and I had to type in this code. Please follow step 2 meticulously and paste the actual code which is stored in your clipboard, as opposed to a screenshot of results.

Best,

Al

Hi again,
I am sorry I realized I had an issue with the reprex package.
Here is the right format. Thank you for your patience.

## loading mixOmics package
library(mixOmics)
#> Loading required package: MASS
#> Loading required package: lattice
#> Loading required package: ggplot2
#> 
#> Loaded mixOmics 6.15.0
#> Thank you for using mixOmics!
#> Tutorials: http://mixomics.org
#> Bookdown vignette: https://mixomicsteam.github.io/Bookdown
#> Questions, issues: Follow the prompts at http://mixomics.org/contact-us
#> Cite us:  citation('mixOmics')

data("breast.TCGA")
# this is the X data as a list of mRNA, miRNA and proteins
data = list(mrna = breast.TCGA$data.train$mrna, mirna = breast.TCGA$data.train$mirna,
            protein = breast.TCGA$data.train$protein)
# set up a full design where every block is connected
design = matrix(1, ncol = length(data), nrow = length(data),
                dimnames = list(names(data), names(data)))
diag(design) =  0
design
#>         mrna mirna protein
#> mrna       0     1       1
#> mirna      1     0       1
#> protein    1     1       0

# set number of variables to select
list.keepX = list(mrna =20, mirna =2, protein = 10)

TCGA.block.splsda = block.splsda(X = data, Y = breast.TCGA$data.train$subtype,
                                 ncomp = 1, keepX = list.keepX, design = design)
#> Design matrix has changed to include Y; each block will be
#>             linked to Y.

## with perf function is where I get the error 
perf(TCGA.block.splsda)
#> Error in `colnames<-`(`*tmp*`, value = (names(crit) = paste0("fold", 1:M))): attempt to set 'colnames' on an object with less than two dimensions

Created on 2020-12-04 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.3 (2020-10-10)
#>  os       Ubuntu 18.04.5 LTS          
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en_US:en                    
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       Europe/Paris                
#>  date     2020-12-04                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version date       lib source                                
#>  assertthat     0.2.1   2019-03-21 [1] CRAN (R 4.0.2)                        
#>  callr          3.5.1   2020-10-13 [1] CRAN (R 4.0.3)                        
#>  cli            2.2.0   2020-11-20 [1] CRAN (R 4.0.3)                        
#>  colorspace     2.0-0   2020-11-11 [1] CRAN (R 4.0.3)                        
#>  corpcor        1.6.9   2017-04-01 [1] CRAN (R 4.0.2)                        
#>  crayon         1.3.4   2017-09-16 [1] CRAN (R 4.0.2)                        
#>  desc           1.2.0   2018-05-01 [1] CRAN (R 4.0.2)                        
#>  devtools       2.3.2   2020-09-18 [1] CRAN (R 4.0.3)                        
#>  digest         0.6.27  2020-10-24 [1] CRAN (R 4.0.3)                        
#>  dplyr          1.0.2   2020-08-18 [1] CRAN (R 4.0.2)                        
#>  ellipse        0.4.2   2020-05-27 [1] CRAN (R 4.0.2)                        
#>  ellipsis       0.3.1   2020-05-15 [1] CRAN (R 4.0.2)                        
#>  evaluate       0.14    2019-05-28 [1] CRAN (R 4.0.2)                        
#>  fansi          0.4.1   2020-01-08 [1] CRAN (R 4.0.2)                        
#>  fs             1.5.0   2020-07-31 [1] CRAN (R 4.0.2)                        
#>  generics       0.1.0   2020-10-31 [1] CRAN (R 4.0.3)                        
#>  ggplot2      * 3.3.2   2020-06-19 [1] CRAN (R 4.0.2)                        
#>  ggrepel        0.8.2   2020-03-08 [1] CRAN (R 4.0.2)                        
#>  glue           1.4.2   2020-08-27 [1] CRAN (R 4.0.2)                        
#>  gridExtra      2.3     2017-09-09 [1] CRAN (R 4.0.2)                        
#>  gtable         0.3.0   2019-03-25 [1] CRAN (R 4.0.2)                        
#>  highr          0.8     2019-03-20 [1] CRAN (R 4.0.2)                        
#>  htmltools      0.5.0   2020-06-16 [1] CRAN (R 4.0.2)                        
#>  igraph         1.2.6   2020-10-06 [1] CRAN (R 4.0.3)                        
#>  knitr          1.30    2020-09-22 [1] CRAN (R 4.0.2)                        
#>  lattice      * 0.20-41 2020-04-02 [1] CRAN (R 4.0.2)                        
#>  lifecycle      0.2.0   2020-03-06 [1] CRAN (R 4.0.2)                        
#>  magrittr       2.0.1   2020-11-17 [1] CRAN (R 4.0.3)                        
#>  MASS         * 7.3-53  2020-09-09 [1] CRAN (R 4.0.2)                        
#>  Matrix         1.2-18  2019-11-27 [1] CRAN (R 4.0.2)                        
#>  matrixStats    0.57.0  2020-09-25 [1] CRAN (R 4.0.2)                        
#>  memoise        1.1.0   2017-04-21 [1] CRAN (R 4.0.2)                        
#>  mixOmics     * 6.15.0  2017-02-06 [1] Github (mixOmicsTeam/mixOmics@2c22e7f)
#>  munsell        0.5.0   2018-06-12 [1] CRAN (R 4.0.2)                        
#>  pillar         1.4.7   2020-11-20 [1] CRAN (R 4.0.3)                        
#>  pkgbuild       1.1.0   2020-07-13 [1] CRAN (R 4.0.2)                        
#>  pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.0.2)                        
#>  pkgload        1.1.0   2020-05-29 [1] CRAN (R 4.0.2)                        
#>  plyr           1.8.6   2020-03-03 [1] CRAN (R 4.0.2)                        
#>  prettyunits    1.1.1   2020-01-24 [1] CRAN (R 4.0.2)                        
#>  processx       3.4.5   2020-11-30 [1] CRAN (R 4.0.3)                        
#>  ps             1.4.0   2020-10-07 [1] CRAN (R 4.0.2)                        
#>  purrr          0.3.4   2020-04-17 [1] CRAN (R 4.0.2)                        
#>  R6             2.5.0   2020-10-28 [1] CRAN (R 4.0.3)                        
#>  rARPACK        0.11-0  2016-03-10 [1] CRAN (R 4.0.3)                        
#>  RColorBrewer   1.1-2   2014-12-07 [1] CRAN (R 4.0.2)                        
#>  Rcpp           1.0.5   2020-07-06 [1] CRAN (R 4.0.2)                        
#>  remotes        2.2.0   2020-07-21 [1] CRAN (R 4.0.2)                        
#>  reshape2       1.4.4   2020-04-09 [1] CRAN (R 4.0.2)                        
#>  rlang          0.4.9   2020-11-26 [1] CRAN (R 4.0.3)                        
#>  rmarkdown      2.5     2020-10-21 [1] CRAN (R 4.0.3)                        
#>  rprojroot      2.0.2   2020-11-15 [1] CRAN (R 4.0.3)                        
#>  RSpectra       0.16-0  2019-12-01 [1] CRAN (R 4.0.2)                        
#>  scales         1.1.1   2020-05-11 [1] CRAN (R 4.0.2)                        
#>  sessioninfo    1.1.1   2018-11-05 [1] CRAN (R 4.0.2)                        
#>  stringi        1.5.3   2020-09-09 [1] CRAN (R 4.0.2)                        
#>  stringr        1.4.0   2019-02-10 [1] CRAN (R 4.0.2)                        
#>  testthat       3.0.0   2020-10-31 [1] CRAN (R 4.0.3)                        
#>  tibble         3.0.4   2020-10-12 [1] CRAN (R 4.0.3)                        
#>  tidyr          1.1.2   2020-08-27 [1] CRAN (R 4.0.2)                        
#>  tidyselect     1.1.0   2020-05-11 [1] CRAN (R 4.0.2)                        
#>  usethis        1.6.3   2020-09-17 [1] CRAN (R 4.0.2)                        
#>  vctrs          0.3.5   2020-11-17 [1] CRAN (R 4.0.3)                        
#>  withr          2.3.0   2020-09-22 [1] CRAN (R 4.0.2)                        
#>  xfun           0.19    2020-10-30 [1] CRAN (R 4.0.3)                        
#>  yaml           2.2.1   2020-02-01 [1] CRAN (R 4.0.2)                        
#> 
#> [1] /home/fma/R/x86_64-pc-linux-gnu-library/4.0
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library

Hi @Feeedis,

Thanks for the reprex example. This issue is resolved in the latest development version as explained in step 0 in the above post. Please follow the guidelines to update and resolve the issue.

Best,

Al