MarioniLab / miloR

R package implementation of Milo for testing for differential abundance in KNN graphs
https://bioconductor.org/packages/release/bioc/html/miloR.html
GNU General Public License v3.0
316 stars 20 forks source link

Color scale missing (res_column) in plotNhoodGraphDA() #308

Closed KatjaRM closed 4 months ago

KatjaRM commented 4 months ago

Dear Team,

When plotting plotNhoodGraphDA() with either res_column setting, the color scale does not appear and just displays 0 although there are different log2FC values:

plotNhoodGraphDA(my_milo, da_results, alpha=0.05)

head(da_results)
      logFC   logCPM         F      PValue        FDR Nhood SpatialFDR
1 -2.442872 8.711629 1.4593562 0.227038184 0.44041913     1  0.4739169
2  4.789656 8.964949 2.6010330 0.106800275 0.41724667     2  0.4584977
3 -7.029371 9.047345 9.6280305 0.001917347 0.09314409     3  0.1609961
4  1.942164 9.163903 0.5547697 0.456378748 0.67971048     4  0.6835947
5  2.397317 8.550487 0.8500251 0.356549588 0.57007732     5  0.5849455
6  4.356098 8.727962 2.2838951 0.130729403 0.41724667     6  0.4584977

The color scheme also does not appear when I chose any of the other colomns in res_column.

What could be the reason for the missing color scheme?

Best,

Katja

`sessionInfo() R version 4.3.2 (2023-10-31) Platform: x86_64-apple-darwin20 (64-bit) Running under: macOS Sonoma 14.3.1

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Berlin tzcode source: internal

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

other attached packages: [1] patchwork_1.2.0 scran_1.30.2 scater_1.30.1
[4] ggplot2_3.5.0 scuttle_1.12.0 singleCellTK_2.12.2
[7] DelayedArray_0.28.0 SparseArray_1.2.4 S4Arrays_1.2.0
[10] abind_1.4-5 Matrix_1.6-5 SingleCellExperiment_1.24.0 [13] BiocManager_1.30.22 dplyr_1.1.4 SummarizedExperiment_1.32.0 [16] Biobase_2.62.0 GenomicRanges_1.54.1 GenomeInfoDb_1.38.6
[19] IRanges_2.36.0 S4Vectors_0.40.2 BiocGenerics_0.48.1
[22] MatrixGenerics_1.14.0 matrixStats_1.2.0 Seurat_5.0.1
[25] SeuratObject_5.0.1 sp_2.1-3 miloR_1.10.0
[28] edgeR_4.0.16 limma_3.58.1

loaded via a namespace (and not attached): [1] RcppAnnoy_0.0.22 splines_4.3.2 later_1.3.2
[4] bitops_1.0-7 R.oo_1.26.0 tibble_3.2.1
[7] polyclip_1.10-6 fastDummies_1.7.3 lifecycle_1.0.4
[10] processx_3.8.3 globals_0.16.2 lattice_0.22-5
[13] MASS_7.3-60.0.1 magrittr_2.0.3 plotly_4.10.4
[16] remotes_2.4.2.1 metapod_1.10.1 httpuv_1.6.14
[19] sctransform_0.4.1 spam_2.10-0 pkgbuild_1.4.3
[22] spatstat.sparse_3.0-3 reticulate_1.35.0 cowplot_1.1.3
[25] pbapply_1.7-2 RColorBrewer_1.1-3 zlibbioc_1.48.0
[28] Rtsne_0.17 R.utils_2.12.3 purrr_1.0.2
[31] ggraph_2.2.0 RCurl_1.98-1.14 tweenr_2.0.3
[34] GenomeInfoDbData_1.2.11 ggrepel_0.9.5 irlba_2.3.5.1
[37] listenv_0.9.1 spatstat.utils_3.0-4 eds_1.4.0
[40] goftest_1.2-3 RSpectra_0.16-1 dqrng_0.3.2
[43] spatstat.random_3.2-2 fitdistrplus_1.1-11 parallelly_1.37.0
[46] DelayedMatrixStats_1.24.0 DropletUtils_1.22.0 leiden_0.4.3.1
[49] codetools_0.2-19 ggforce_0.4.2 tidyselect_1.2.0
[52] farver_2.1.1 ScaledMatrix_1.10.0 viridis_0.6.5
[55] spatstat.explore_3.2-6 jsonlite_1.8.8 BiocNeighbors_1.20.2
[58] ellipsis_0.3.2 tidygraph_1.3.1 progressr_0.14.0
[61] ggridges_0.5.6 survival_3.5-8 tools_4.3.2
[64] ica_1.0-3 Rcpp_1.0.12 glue_1.7.0
[67] gridExtra_2.3 HDF5Array_1.30.0 withr_3.0.0
[70] fastmap_1.1.1 bluster_1.12.0 rhdf5filters_1.14.1
[73] fansi_1.0.6 callr_3.7.5 digest_0.6.34
[76] rsvd_1.0.5 R6_2.5.1 mime_0.12
[79] colorspace_2.1-0 scattermore_1.2 gtools_3.9.5
[82] tensor_1.5 spatstat.data_3.0-4 R.methodsS3_1.8.2
[85] utf8_1.2.4 tidyr_1.3.1 generics_0.1.3
[88] data.table_1.15.0 FNN_1.1.4 graphlayouts_1.1.0
[91] httr_1.4.7 htmlwidgets_1.6.4 uwot_0.1.16
[94] pkgconfig_2.0.3 gtable_0.3.4 lmtest_0.9-40
[97] XVector_0.42.0 htmltools_0.5.7 dotCall64_1.1-1
[100] scales_1.3.0 png_0.1-8 rstudioapi_0.15.0
[103] reshape2_1.4.4 curl_5.2.0 nlme_3.1-164
[106] rhdf5_2.46.1 zoo_1.8-12 stringr_1.5.1
[109] KernSmooth_2.23-22 parallel_4.3.2 miniUI_0.1.1.1
[112] vipor_0.4.7 desc_1.4.3 pillar_1.9.0
[115] grid_4.3.2 vctrs_0.6.5 RANN_2.6.1
[118] promises_1.2.1 BiocSingular_1.18.0 beachmat_2.18.1
[121] xtable_1.8-4 cluster_2.1.6 beeswarm_0.4.0
[124] cli_3.6.2 locfit_1.5-9.8 compiler_4.3.2
[127] rlang_1.1.3 crayon_1.5.2 future.apply_1.11.1
[130] labeling_0.4.3 ps_1.7.6 plyr_1.8.9
[133] ggbeeswarm_0.7.2 stringi_1.8.3 viridisLite_0.4.2
[136] deldir_2.0-4 BiocParallel_1.36.0 munsell_0.5.0
[139] lazyeval_0.2.2 spatstat.geom_3.2-9 RcppHNSW_0.6.0
[142] GSVAdata_1.38.0 sparseMatrixStats_1.14.0 future_1.33.1
[145] Rhdf5lib_1.24.2 statmod_1.5.0 shiny_1.8.0
[148] ROCR_1.0-11 igraph_2.0.2 `

MikeDMorgan commented 4 months ago

Hi @KatjaRM - the default behaviour is to only show nhoods that are statistically significantly DA (5% FDR) - you can adjust this behaviour using e.g. alpha=0.1 to show DA nhoods at 10% FDR. If you want to show all nhoods then set alpha=1.0.

KatjaRM commented 4 months ago

Perfect! Thank you so much for the quick reply :)