NathanSkene / EWCE

Expression Weighted Celltype Enrichment. See the package website for up-to-date instructions on usage.
https://nathanskene.github.io/EWCE/index.html
53 stars 25 forks source link

`EWCE::standardise_ctd`: not enforcing "specificity_quantiles" matrix #74

Closed bschilder closed 1 year ago

bschilder commented 1 year ago

Originally came up here: https://github.com/neurogenomics/MAGMA_Celltyping/issues/107

Basically, if a ctd doesn't have the matrix "specificity_quantiles" in it to begin with, it won't be generated by EWCE::standardise_ctd due to how I now iterate over existing matrices (not hard-coded predetermined ones).

I'll modify this and re-standardise the CTDs in MAGMA.Celltyping releases.

Reprex

ctd <- ewceData::ctd()
ctd2 <- lapply(ctd, function(lvl){lvl$specificity_quantiles=NULL; lvl})
ctd3 <- EWCE::standardise_ctd(ctd2)

testthat::expect_true("specificity_quantiles" %in% names(ctd3$level_1))
## Fails (FALSE)

Session info

``` R version 4.2.0 (2022-04-22) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.4 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] MAGMA.Celltyping_2.0.6 data.table_1.14.2 ewceData_1.4.0 ExperimentHub_2.4.0 [5] AnnotationHub_3.4.0 BiocFileCache_2.4.0 dbplyr_2.2.1 BiocGenerics_0.42.0 [9] dplyr_1.0.9 ggplot2_3.3.6 loaded via a namespace (and not attached): [1] utf8_1.2.2 R.utils_2.12.0 tidyselect_1.1.2 [4] lme4_1.1-30 RSQLite_2.2.14 AnnotationDbi_1.58.0 [7] htmlwidgets_1.5.4 grid_4.2.0 BiocParallel_1.30.3 [10] devtools_2.4.3 munsell_0.5.0 codetools_0.2-18 [13] DT_0.23 withr_2.5.0 colorspace_2.0-3 [16] Biobase_2.56.0 filelock_1.0.2 knitr_1.39 [19] rstudioapi_0.13 orthogene_1.3.1 stats4_4.2.0 [22] SingleCellExperiment_1.18.0 ggsignif_0.6.3 labeling_0.4.2 [25] MatrixGenerics_1.8.1 GenomeInfoDbData_1.2.8 farver_2.1.1 [28] bit64_4.0.5 rprojroot_2.0.3 vctrs_0.4.1 [31] treeio_1.20.0 generics_0.1.3 xfun_0.31 [34] R6_2.5.1 GenomeInfoDb_1.32.2 bitops_1.0-7 [37] cachem_1.0.6 gridGraphics_0.5-1 DelayedArray_0.22.0 [40] assertthat_0.2.1 promises_1.2.0.1 BiocIO_1.6.0 [43] scales_1.2.0 gtable_0.3.0 processx_3.7.0 [46] rlang_1.0.3 MungeSumstats_1.4.5 splines_4.2.0 [49] rtracklayer_1.56.1 rstatix_0.7.0 lazyeval_0.2.2 [52] gargle_1.2.0 broom_1.0.0 BiocManager_1.30.18 [55] yaml_2.3.5 reshape2_1.4.4 abind_1.4-5 [58] GenomicFeatures_1.48.3 backports_1.4.1 httpuv_1.6.5 [61] usethis_2.1.6 tools_4.2.0 ggplotify_0.1.0 [64] ellipsis_0.3.2 ggdendro_0.1.23 sessioninfo_1.2.2 [67] Rcpp_1.0.9 plyr_1.8.7 progress_1.2.2 [70] zlibbioc_1.42.0 purrr_0.3.4 RCurl_1.98-1.7 [73] ps_1.7.1 prettyunits_1.1.1 ggpubr_0.4.0 [76] S4Vectors_0.34.0 SummarizedExperiment_1.26.1 fs_1.5.2 [79] magrittr_2.0.3 matrixStats_0.62.0 pkgload_1.3.0 [82] hms_1.1.1 patchwork_1.1.1 mime_0.12 [85] evaluate_0.15 xtable_1.8-4 XML_3.99-0.10 [88] EWCE_1.5.3 IRanges_2.30.0 gridExtra_2.3 [91] testthat_3.1.4 compiler_4.2.0 biomaRt_2.52.0 [94] tibble_3.1.7 crayon_1.5.1 minqa_1.2.4 [97] R.oo_1.25.0 htmltools_0.5.2 ggfun_0.0.6 [100] later_1.3.0 tidyr_1.2.0 aplot_0.1.6 [103] DBI_1.1.3 gprofiler2_0.2.1 MASS_7.3-57 [106] rappdirs_0.3.3 boot_1.3-28 babelgene_22.3 [109] Matrix_1.4-1 car_3.1-0 piggyback_0.1.3 [112] brio_1.1.3 cli_3.3.0 R.methodsS3_1.8.2 [115] parallel_4.2.0 GenomicRanges_1.48.0 pkgconfig_2.0.3 [118] GenomicAlignments_1.32.0 plotly_4.10.0 roxygen2_7.2.0 [121] xml2_1.3.3 ggtree_3.4.0 XVector_0.36.0 [124] yulab.utils_0.0.5 stringr_1.4.0 VariantAnnotation_1.42.1 [127] callr_3.7.0 digest_0.6.29 Biostrings_2.64.0 [130] rmarkdown_2.14 HGNChelper_0.8.1 tidytree_0.3.9 [133] restfulr_0.0.15 curl_4.3.2 shiny_1.7.1 [136] Rsamtools_2.12.0 rjson_0.2.21 nloptr_2.0.3 [139] lifecycle_1.0.1 nlme_3.1-158 jsonlite_1.8.0 [142] carData_3.0-5 desc_1.4.1 viridisLite_0.4.0 [145] limma_3.52.2 BSgenome_1.64.0 fansi_1.0.3 [148] pillar_1.7.0 lattice_0.20-45 homologene_1.4.68.19.3.27 [151] KEGGREST_1.36.2 fastmap_1.1.0 httr_1.4.3 [154] pkgbuild_1.3.1 googleAuthR_2.0.0 remotes_2.4.2 [157] waldo_0.4.0 interactiveDisplayBase_1.34.0 glue_1.6.2 [160] RNOmni_1.0.0 diffobj_0.3.5 png_0.1-7 [163] BiocVersion_3.15.2 bit_4.0.4 stringi_1.7.8 [166] rematch2_2.1.2 blob_1.2.3 memoise_2.0.1 [169] ape_5.6-2 ```
bschilder commented 1 year ago

Just pushed this fix @Al-Murphy

Al-Murphy commented 1 year ago

@bschilder seems to have failed the GHA, can you look into it and check if it's a real fail or something strange - I'll push upstream if it appears to be a strange GHA issue

bschilder commented 1 year ago

Ok, so it seems that the checks passed on Linux and Windows, but not Mac again. I think this is some image rendering issue with knitr on GHA's Mac machines.

So it's unrelated to my updates, but would nevertheless be good to figure out why it keeps happening! "``{r, error=TRUE}" at the top of code chunk and addingtry()` doesn't seem sufficient to avoid this. Can't think of another way besides not running those code chunks at all.

bschilder commented 1 year ago

The GHA issue has since resolved itself