HelenaLC / CATALYST

Cytometry dATa anALYsis Tools
66 stars 30 forks source link

pbMDS Function Stopped Working #384

Closed LukaTandaric closed 5 months ago

LukaTandaric commented 6 months ago

Hello Helena. I have returned to my code after a few weeks, during which I had completely re-installed Windows (and R). I am trying to get a plot from this function:

pbMDS(
    SCE_HUMAN,
    features = c(type_markers(SCE_HUMAN), state_markers(SCE_HUMAN)),
    by = sample_id,
    color_by = "target",
    label_by = "patient_id",
    shape_by = "sample_type"
)

Unlike previously, when the pbMDS function would return an MDS plot, now I get this error no matter how I set up the plotting arguments:

Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.

traceback() gives me:

15: stop(errorCondition(msg, old = fname, new = new, package = package, 
        class = "defunctError"))
14: .Defunct(msg = "useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.", 
        package = .packageName)
13: deprecatedUseNamesNA()
12: matrixStats::rowVars(x, rows = rows, cols = cols, na.rm = na.rm, 
        center = center, dim. = dim., ..., useNames = useNames)
11: .local(x, rows, cols, na.rm, center, ..., useNames = useNames)
10: candidate(S, ...)
9: .smart_seed_dispatcher(x, generic = MatrixGenerics::rowVars, 
       blockfun = .DelayedMatrix_block_rowVars, force_block_processing = force_block_processing, 
       rows = rows, cols = cols, na.rm = na.rm, center = center, 
       ..., useNames = useNames)
8: .local(x, rows, cols, na.rm, center, ..., useNames = useNames)
7: rowVars(DelayedArray(x))
6: rowVars(DelayedArray(x))
5: .get_mat_for_reddim(x, subset_row = subset_row, ntop = ntop, 
       scale = scale)
4: .local(x, ...)
3: calculateMDS(pbs, ncomponents = max(dims))
2: calculateMDS(pbs, ncomponents = max(dims))
1: pbMDS(SCE_HUMAN, features = c(type_markers(SCE_HUMAN), state_markers(SCE_HUMAN)), 
       by = "sample_id", color_by = "target", label_by = "patient_id", 
       shape_by = "sample_type")

I do have a few NA's in my metadata, which I tried changing to "Test", but the function still returns an error.

I am not sure if the CATALYST package has been updated or not, since I cannot find when each CATALYST version was released. I am on R version 4.2.0, RStudio version 2022.07.1 and CATALYST version 1.22.0. As you may notice, I am not running the latest updates of everything, which is to avoid things like this happening to my code, since I am not done with my project.

What could be the cause of this error?

83years commented 5 months ago

I too am having the same issue. It started after updating RStudio to 2023.12.1 Build 402 when some packages were also updated by the IT guys installing FlowJo at the same time.

The same error is seen with

> sce <- runDR(sce,
+              "PCA",
+              features = rownames(sce)[c(1:5, 7:14, 16, 18:24, 26, 27, 29, 30)])
Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.

sessionInfo() R version 4.2.2 (2022-10-31 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

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

other attached packages: [1] tidySingleCellExperiment_1.8.2 ttservice_0.4.0 ggcyto_1.26.4 flowWorkspace_4.10.1 ncdfFlow_2.44.0
[6] BH_1.84.0-0 ComplexHeatmap_2.14.0 cowplot_1.1.3 dplyr_1.1.4 slingshot_2.6.0
[11] TrajectoryUtils_1.6.0 princurve_2.1.6 ggplot2_3.4.4 RColorBrewer_1.1-3 readxl_1.4.3
[16] flowCore_2.10.0 CATALYST_1.22.0 SingleCellExperiment_1.20.1 SummarizedExperiment_1.28.0 Biobase_2.58.0
[21] GenomicRanges_1.50.2 GenomeInfoDb_1.34.9 IRanges_2.32.0 S4Vectors_0.36.2 BiocGenerics_0.44.0
[26] MatrixGenerics_1.10.0 matrixStats_1.2.0

loaded via a namespace (and not attached): [1] backports_1.4.1 circlize_0.4.15 drc_3.0-1 systemfonts_1.0.5 plyr_1.8.9
[6] igraph_2.0.1.1 lazyeval_0.2.2 ConsensusClusterPlus_1.62.0 splines_4.2.2 BiocParallel_1.32.6
[11] scater_1.26.1 TH.data_1.1-2 digest_0.6.34 foreach_1.5.2 htmltools_0.5.7
[16] viridis_0.6.5 fansi_1.0.6 magrittr_2.0.3 ScaledMatrix_1.6.0 cluster_2.1.4
[21] doParallel_1.0.17 sandwich_3.1-0 cytolib_2.10.1 colorspace_2.1-0 ggrepel_0.9.5
[26] textshaping_0.3.7 xfun_0.42 jsonlite_1.8.8 hexbin_1.28.3 crayon_1.5.2
[31] RCurl_1.98-1.14 graph_1.76.0 survival_3.4-0 zoo_1.8-12 iterators_1.0.14
[36] glue_1.7.0 polyclip_1.10-6 gtable_0.3.4 nnls_1.5 zlibbioc_1.44.0
[41] XVector_0.38.0 GetoptLong_1.0.5 DelayedArray_0.24.0 car_3.1-2 BiocSingular_1.14.0
[46] Rgraphviz_2.42.0 shape_1.4.6 abind_1.4-5 scales_1.3.0 mvtnorm_1.2-4
[51] DBI_1.2.1 rstatix_0.7.2 Rcpp_1.0.12 plotrix_3.8-4 viridisLite_0.4.2
[56] clue_0.3-65 rsvd_1.0.5 FlowSOM_2.6.0 httr_1.4.7 htmlwidgets_1.6.4
[61] ellipsis_0.3.2 pkgconfig_2.0.3 XML_3.99-0.16.1 farver_2.1.1 scuttle_1.8.4
[66] utf8_1.2.4 labeling_0.4.3 tidyselect_1.2.0 rlang_1.1.3 reshape2_1.4.4
[71] munsell_0.5.0 cellranger_1.1.0 tools_4.2.2 cli_3.6.1 generics_0.1.3
[76] broom_1.0.5 ggridges_0.5.6 evaluate_0.23 stringr_1.5.1 fastmap_1.1.1
[81] ragg_1.2.7 yaml_2.3.8 knitr_1.45 purrr_1.0.2 sparseMatrixStats_1.10.0
[86] compiler_4.2.2 rstudioapi_0.15.0 plotly_4.10.4 beeswarm_0.4.0 png_0.1-8
[91] ggsignif_0.6.4 tibble_3.2.1 tweenr_2.0.2 stringi_1.8.3 lattice_0.20-45
[96] Matrix_1.6-5 vctrs_0.6.5 pillar_1.9.0 lifecycle_1.0.4 GlobalOptions_0.1.2
[101] BiocNeighbors_1.16.0 data.table_1.15.0 bitops_1.0-7 irlba_2.3.5.1 colorRamps_2.3.1
[106] R6_2.5.1 gridExtra_2.3 RProtoBufLib_2.10.0 vipor_0.4.7 codetools_0.2-18
[111] MASS_7.3-58.1 gtools_3.9.5 rjson_0.2.21 withr_3.0.0 multcomp_1.4-25
[116] GenomeInfoDbData_1.2.9 parallel_4.2.2 beachmat_2.14.2 tidyr_1.3.1 rmarkdown_2.25
[121] DelayedMatrixStats_1.20.0 carData_3.0-5 Rtsne_0.17 ggpubr_0.6.0 ggnewscale_0.4.10
[126] ggforce_0.4.1

SamGG commented 5 months ago

Hi @HelenaLC scater::calculateMDS(t(iris[,-5])) is OK.

markrobinsonuzh commented 5 months ago

From what I can see, it has to do with the matrixStats package: https://github.com/satijalab/seurat/issues/7501#issuecomment-1854571904

83years commented 5 months ago

I've downgraded Matrix to 1.5-3 and my issues resolved.