bhklab / CoreGx

Shared code for both PharmacoGx and RadioGx
https://bhklab.github.io/CoreGx/
GNU General Public License v3.0
2 stars 3 forks source link

no slot of name error #156

Closed spocks closed 1 year ago

spocks commented 1 year ago

Hi Team, PharmacoGx is giving error related to slot name and is breaking all the old code/pSet.

library(PharmacoGx)
downloadPSet("CTRPv2_2015", saveDir = '~/Downloads/')
#trying URL 'https://zenodo.org/record/3905470/files/CTRPv2.rds?download=1'
#Content type 'application/octet-stream' length 43118179 bytes (41.1 MB)
#==================================================
#  downloaded 41.1 MB

CTRPv2 <- readRDS('~/Downloads/CTRPv2_2015.rds')

print(CTRPv2)
# <PharmacoSet>
#   Name:  CTRPv2 
# Date Created:  Tue Jun 23 23:32:05 2020 
# Error in .local(object, ...) : 
#   no slot of name "sample" for this object of class "PharmacoSet"
# Error during wrapup: no slot of name "treatmentResponse" for this object of class "PharmacoSet"
# Error: no more error handlers available (recursive errors?); invoking 'abort' restart

drugInfo(CTRPv2)
#Error in .local(object, ...) : 
#  no slot of name "treatment" for this object of class "PharmacoSet"

Here is the session_info:

session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.1 (2022-06-23)
 os       Linux Mint 20.3
 system   x86_64, linux-gnu
 ui       RStudio
 language en_CA
 collate  en_CA.UTF-8
 ctype    en_CA.UTF-8
 tz       America/Toronto
 date     2022-07-12
 rstudio  2022.02.3+492 Prairie Trillium (desktop)
 pandoc   NA

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package              * version   date (UTC) lib source
 assertthat             0.2.1     2019-03-21 [1] CRAN (R 4.1.2)
 backports              1.4.1     2021-12-13 [1] CRAN (R 4.1.2)
 bench                  1.1.2     2021-11-30 [1] CRAN (R 4.2.1)
 Biobase              * 2.56.0    2022-04-26 [1] Bioconductor
 BiocGenerics         * 0.42.0    2022-04-26 [1] Bioconductor
 BiocParallel           1.30.3    2022-06-05 [1] Bioconductor
 bitops                 1.0-7     2021-04-24 [1] CRAN (R 4.1.2)
 boot                   1.3-28    2021-05-03 [4] CRAN (R 4.0.5)
 BumpyMatrix            1.4.0     2022-04-26 [1] Bioconductor
 cachem                 1.0.6     2021-08-19 [1] CRAN (R 4.1.2)
 callr                  3.7.0     2021-04-20 [1] CRAN (R 4.1.2)
 caTools                1.18.2    2021-03-28 [1] CRAN (R 4.1.2)
 celestial              1.4.6     2018-11-29 [1] CRAN (R 4.1.2)
 checkmate              2.1.0     2022-04-21 [1] CRAN (R 4.2.1)
 cli                    3.3.0     2022-04-25 [1] CRAN (R 4.2.1)
 cluster                2.1.3     2022-03-28 [4] CRAN (R 4.1.3)
 codetools              0.2-18    2020-11-04 [4] CRAN (R 4.0.3)
 colorspace             2.0-3     2022-02-21 [1] CRAN (R 4.1.2)
 coop                   0.6-3     2021-09-19 [1] CRAN (R 4.2.1)
 CoreGx               * 2.1.4     2022-07-12 [1] Github (bhklab/CoreGx@6c7e434)
 crayon                 1.5.1     2022-03-26 [1] CRAN (R 4.1.3)
 curl                   4.3.2     2021-06-23 [1] CRAN (R 4.1.2)
 data.table             1.14.2    2021-09-27 [1] CRAN (R 4.1.2)
 DBI                    1.1.3     2022-06-18 [1] CRAN (R 4.2.1)
 DelayedArray           0.22.0    2022-04-26 [1] Bioconductor
 devtools             * 2.4.3     2021-11-30 [1] CRAN (R 4.1.2)
 digest                 0.6.29    2021-12-01 [1] CRAN (R 4.1.2)
 downloader             0.4       2015-07-09 [1] CRAN (R 4.1.2)
 dplyr                  1.0.9     2022-04-28 [1] CRAN (R 4.2.1)
 DT                     0.23      2022-05-10 [1] CRAN (R 4.2.1)
 ellipsis               0.3.2     2021-04-29 [1] CRAN (R 4.1.2)
 fansi                  1.0.3     2022-03-24 [1] CRAN (R 4.1.3)
 fastmap                1.1.0     2021-01-25 [1] CRAN (R 4.1.2)
 fastmatch              1.1-3     2021-07-23 [1] CRAN (R 4.1.2)
 fgsea                  1.22.0    2022-04-26 [1] Bioconductor
 fs                     1.5.2     2021-12-08 [1] CRAN (R 4.1.2)
 generics               0.1.3     2022-07-05 [1] CRAN (R 4.2.1)
 GenomeInfoDb         * 1.32.2    2022-05-15 [1] Bioconductor
 GenomeInfoDbData       1.2.8     2022-07-06 [1] Bioconductor
 GenomicRanges        * 1.48.0    2022-04-26 [1] Bioconductor
 ggplot2                3.3.6     2022-05-03 [1] CRAN (R 4.2.1)
 glue                   1.6.2     2022-02-24 [1] CRAN (R 4.1.2)
 gplots                 3.1.3     2022-04-25 [1] CRAN (R 4.2.1)
 gridExtra              2.3       2017-09-09 [1] CRAN (R 4.1.2)
 gtable                 0.3.0     2019-03-25 [1] CRAN (R 4.1.2)
 gtools                 3.9.2.2   2022-06-13 [1] CRAN (R 4.2.1)
 htmltools              0.5.2     2021-08-25 [1] CRAN (R 4.1.2)
 htmlwidgets            1.5.4     2021-09-08 [1] CRAN (R 4.1.2)
 httpuv                 1.6.5     2022-01-05 [1] CRAN (R 4.1.2)
 igraph                 1.3.2     2022-06-13 [1] CRAN (R 4.2.1)
 IRanges              * 2.30.0    2022-04-26 [1] Bioconductor
 jsonlite               1.8.0     2022-02-22 [1] CRAN (R 4.1.2)
 KernSmooth             2.23-20   2021-05-03 [4] CRAN (R 4.0.5)
 later                  1.3.0     2021-08-18 [1] CRAN (R 4.1.2)
 lattice                0.20-45   2021-09-22 [4] CRAN (R 4.2.0)
 lifecycle              1.0.1     2021-09-24 [1] CRAN (R 4.1.2)
 limma                  3.52.2    2022-06-19 [1] Bioconductor
 lsa                    0.73.3    2022-05-09 [1] CRAN (R 4.2.1)
 magicaxis              2.2.14    2022-02-22 [1] CRAN (R 4.1.2)
 magrittr               2.0.3     2022-03-30 [1] CRAN (R 4.1.3)
 mapproj                1.2.8     2022-01-12 [1] CRAN (R 4.1.2)
 maps                   3.4.0     2021-09-25 [1] CRAN (R 4.1.2)
 marray                 1.74.0    2022-04-26 [1] Bioconductor
 MASS                   7.3-57    2022-04-22 [4] CRAN (R 4.2.0)
 Matrix                 1.4-1     2022-03-23 [4] CRAN (R 4.1.3)
 MatrixGenerics       * 1.8.1     2022-06-26 [1] Bioconductor
 matrixStats          * 0.62.0    2022-04-19 [1] CRAN (R 4.2.1)
 memoise                2.0.1     2021-11-26 [1] CRAN (R 4.1.2)
 mime                   0.12      2021-09-28 [1] CRAN (R 4.1.2)
 MultiAssayExperiment   1.22.0    2022-04-26 [1] Bioconductor
 munsell                0.5.0     2018-06-12 [1] CRAN (R 4.1.2)
 NISTunits              1.0.1     2016-08-11 [1] CRAN (R 4.1.2)
 PharmacoGx           * 3.1.3     2022-07-12 [1] Github (bhklab/PharmacoGx@f680088)
 piano                  2.12.0    2022-04-26 [1] Bioconductor
 pillar                 1.7.0     2022-02-01 [1] CRAN (R 4.1.2)
 pkgbuild               1.3.1     2021-12-20 [1] CRAN (R 4.1.2)
 pkgconfig              2.0.3     2019-09-22 [1] CRAN (R 4.1.2)
 pkgload                1.3.0     2022-06-27 [1] CRAN (R 4.2.1)
 plotrix                3.8-2     2021-09-08 [1] CRAN (R 4.1.2)
 plyr                   1.8.7     2022-03-24 [1] CRAN (R 4.1.3)
 pracma                 2.3.8     2022-03-04 [1] CRAN (R 4.1.3)
 prettyunits            1.1.1     2020-01-24 [1] CRAN (R 4.1.2)
 processx               3.6.1     2022-06-17 [1] CRAN (R 4.2.1)
 promises               1.2.0.1   2021-02-11 [1] CRAN (R 4.1.2)
 ps                     1.7.1     2022-06-18 [1] CRAN (R 4.2.1)
 purrr                  0.3.4     2020-04-17 [1] CRAN (R 4.1.2)
 R6                     2.5.1     2021-08-19 [1] CRAN (R 4.1.2)
 RANN                   2.6.1     2019-01-08 [1] CRAN (R 4.1.2)
 RColorBrewer           1.1-3     2022-04-03 [1] CRAN (R 4.2.1)
 Rcpp                   1.0.8.3   2022-03-17 [1] CRAN (R 4.1.3)
 RCurl                  1.98-1.7  2022-06-09 [1] CRAN (R 4.2.1)
 relations              0.6-12    2022-03-18 [1] CRAN (R 4.1.3)
 remotes                2.4.2     2021-11-30 [1] CRAN (R 4.2.0)
 reshape2               1.4.4     2020-04-09 [1] CRAN (R 4.1.2)
 rlang                  1.0.3     2022-06-27 [1] CRAN (R 4.2.1)
 rprojroot              2.0.3     2022-04-02 [1] CRAN (R 4.2.1)
 rstudioapi             0.13      2020-11-12 [1] CRAN (R 4.1.2)
 S4Vectors            * 0.34.0    2022-04-26 [1] Bioconductor
 scales                 1.2.0     2022-04-13 [1] CRAN (R 4.2.1)
 sessioninfo            1.2.2     2021-12-06 [1] CRAN (R 4.1.2)
 sets                   1.0-21    2022-02-09 [1] CRAN (R 4.1.2)
 shiny                  1.7.1     2021-10-02 [1] CRAN (R 4.1.2)
 shinydashboard         0.7.2     2021-09-30 [1] CRAN (R 4.1.2)
 shinyjs                2.1.0     2021-12-23 [1] CRAN (R 4.1.2)
 slam                   0.1-50    2022-01-08 [1] CRAN (R 4.1.2)
 sm                     2.2-5.7.1 2022-07-04 [1] CRAN (R 4.2.1)
 SnowballC              0.7.0     2020-04-01 [1] CRAN (R 4.1.2)
 stringi                1.7.6     2021-11-29 [1] CRAN (R 4.1.2)
 stringr                1.4.0     2019-02-10 [1] CRAN (R 4.1.2)
 SummarizedExperiment * 1.26.1    2022-04-29 [1] Bioconductor
 tibble                 3.1.7     2022-05-03 [1] CRAN (R 4.2.1)
 tidyselect             1.1.2     2022-02-21 [1] CRAN (R 4.1.2)
 usethis              * 2.1.6     2022-05-25 [1] CRAN (R 4.2.1)
 utf8                   1.2.2     2021-07-24 [1] CRAN (R 4.1.2)
 vctrs                  0.4.1     2022-04-13 [1] CRAN (R 4.2.1)
 visNetwork             2.1.0     2021-09-29 [1] CRAN (R 4.1.2)
 withr                  2.5.0     2022-03-03 [1] CRAN (R 4.1.3)
 xtable                 1.8-4     2019-04-21 [1] CRAN (R 4.1.2)
 XVector                0.36.0    2022-04-26 [1] Bioconductor
 zlibbioc               1.42.0    2022-04-26 [1] Bioconductor

 [1] /home/think/.R/x86_64-pc-linux-gnu-library/4.1
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library
ChristopherEeles commented 1 year ago

You just need to run:

pSet <- updateObject(pSet)

And that will fix it.

spocks commented 1 year ago

Great, this solved the problem. How about implementing updateObject internally before checking the slots? Do you think it will be too complected? Otherwise I would suggest to include a message " try running pSet <- updateObject(pSet) " with the error message.

ChristopherEeles commented 1 year ago

I am already updating the object automatically inside downloadPSet. I can catch the error in the show method and include the message though. I think that would be helpful.

ChristopherEeles commented 1 year ago

Pull request with new message is open at #157

ChristopherEeles commented 1 year ago

I also noticed that in PharmacoGx I am only updating the object returned from the function. I have a fix that also resaves the object so any newly downloaded PSets shouldn't need to be updated.

Will open a PR for that once the CoreGx one is merged.

ChristopherEeles commented 1 year ago

See bhklab/PharmacoGx#123 for PR fixing downloadPSet

ChristopherEeles commented 1 year ago

Both of these fixes have been pushed to Bioconductor.

Look for CoreGx version 2.1.5 and PharmacoGx version 3.1.4 on Bioconductor (probably in the Friday build).

Best, Christopher Eeles Software Developer Haibe-Kains Lab | PM-Research University Health Network