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
342 stars 22 forks source link

Spatial FDR threshold #252

Closed zeniazen5 closed 1 year ago

zeniazen5 commented 1 year ago

Hey there, first of all thank you for Milo. I really like working with it and it is pretty straight forward when you understand better the concept and your data of course. I wanted to ask something regarding the Spatial FDR threshold. I have run Milo to my dataset and specifically to each of the cell types separately . After a round of optimizations for the k the overall result is that no DA is detected in the cell types. This results comes when the plotNhoodGraphDA has the a=0.05 which from what understood is the spatial FDR threshold which makes statistically sense. When i set the a=1.0, Milo detects DA (of course since the threshold now is too big) but we cannot say that this is statistically correct right? The cell types that are abundant when a=1.0 are super interesting for downstream analysis. So i want to make sure that i can continue with that or it's not worth it? I would really appreciate your opinion on that! Thank you in advance Cheers Zenia

Session info R version 4.2.1 (2022-06-23 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044)

Matrix products: default

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

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

other attached packages: [1] RANN_2.6.1 igraph_1.3.5 MouseGastrulationData_1.11.1 SpatialExperiment_1.7.2
[5] patchwork_1.1.2 dplyr_1.0.10 scran_1.25.1 scater_1.25.7
[9] ggplot2_3.3.6 scuttle_1.7.4 SingleCellExperiment_1.19.1 SummarizedExperiment_1.27.3 [13] Biobase_2.57.1 GenomicRanges_1.49.1 GenomeInfoDb_1.33.7 IRanges_2.31.2
[17] S4Vectors_0.35.4 BiocGenerics_0.43.4 MatrixGenerics_1.9.1 matrixStats_0.62.0
[21] miloR_1.5.0 edgeR_3.39.6 limma_3.53.10 SeuratWrappers_0.3.0
[25] sp_1.5-0 SeuratObject_4.1.1 Seurat_4.1.1 SeuratDisk_0.0.0.9020

loaded via a namespace (and not attached): [1] utf8_1.2.2 reticulate_1.26 R.utils_2.12.0 tidyselect_1.2.0
[5] AnnotationDbi_1.59.1 RSQLite_2.2.18 htmlwidgets_1.5.4 grid_4.2.1
[9] BiocParallel_1.31.12 Rtsne_0.16 DropletUtils_1.17.3 munsell_0.5.0
[13] ScaledMatrix_1.6.0 codetools_0.2-18 ica_1.0-3 statmod_1.4.37
[17] future_1.29.0 miniUI_0.1.1.1 withr_2.5.0 spatstat.random_2.2-0
[21] colorspace_2.0-3 progressr_0.11.0 filelock_1.0.2 rstudioapi_0.14
[25] ROCR_1.0-11 tensor_1.5 listenv_0.8.0 GenomeInfoDbData_1.2.9
[29] polyclip_1.10-0 bit64_4.0.5 farver_2.1.1 rhdf5_2.41.1
[33] parallelly_1.32.1 vctrs_0.5.0 generics_0.1.3 BiocFileCache_2.5.2
[37] R6_2.5.1 ggbeeswarm_0.6.0 graphlayouts_0.8.2 rsvd_1.0.5
[41] locfit_1.5-9.6 hdf5r_1.3.5 cachem_1.0.6 rhdf5filters_1.9.0
[45] bitops_1.0-7 spatstat.utils_2.3-1 DelayedArray_0.23.2 BumpyMatrix_1.5.0
[49] assertthat_0.2.1 promises_1.2.0.1 scales_1.2.1 ggraph_2.0.6
[53] rgeos_0.5-9 beeswarm_0.4.0 gtable_0.3.1 beachmat_2.13.4
[57] globals_0.16.1 goftest_1.2-3 tidygraph_1.2.2 rlang_1.0.6
[61] splines_4.2.1 lazyeval_0.2.2 spatstat.geom_2.4-0 yaml_2.3.6
[65] BiocManager_1.30.18 reshape2_1.4.4 abind_1.4-5 httpuv_1.6.5
[69] tools_4.2.1 ellipsis_0.3.2 spatstat.core_2.4-4 RColorBrewer_1.1-3
[73] ggridges_0.5.4 Rcpp_1.0.9 plyr_1.8.7 sparseMatrixStats_1.9.0
[77] zlibbioc_1.43.0 purrr_0.3.4 RCurl_1.98-1.9 rpart_4.1.16
[81] deldir_1.0-6 pbapply_1.5-0 viridis_0.6.2 cowplot_1.1.1
[85] zoo_1.8-10 ggrepel_0.9.1 cluster_2.1.4 magrittr_2.0.3
[89] magick_2.7.3 data.table_1.14.2 scattermore_0.8 lmtest_0.9-40
[93] fitdistrplus_1.1-8 mime_0.12 xtable_1.8-4 gridExtra_2.3
[97] compiler_4.2.1 tibble_3.1.8 KernSmooth_2.23-20 crayon_1.5.2
[101] R.oo_1.25.0 htmltools_0.5.3 mgcv_1.8-40 later_1.3.0
[105] tidyr_1.2.1 DBI_1.1.3 ExperimentHub_2.5.0 tweenr_2.0.2
[109] dbplyr_2.2.1 rappdirs_0.3.3 MASS_7.3-58.1 Matrix_1.5-1
[113] cli_3.3.0 R.methodsS3_1.8.2 parallel_4.2.1 metapod_1.5.0
[117] pkgconfig_2.0.3 plotly_4.10.0 spatstat.sparse_2.1-1 vipor_0.4.5
[121] dqrng_0.3.0 XVector_0.37.1 stringr_1.4.1 digest_0.6.29
[125] sctransform_0.3.4 RcppAnnoy_0.0.19 Biostrings_2.65.6 spatstat.data_2.2-0
[129] leiden_0.4.3 uwot_0.1.14 DelayedMatrixStats_1.20.0 curl_4.3.2
[133] shiny_1.7.2 gtools_3.9.3 rjson_0.2.21 lifecycle_1.0.3
[137] nlme_3.1-159 jsonlite_1.8.3 Rhdf5lib_1.19.2 BiocNeighbors_1.15.1
[141] viridisLite_0.4.1 fansi_1.0.3 pillar_1.8.1 lattice_0.20-45
[145] KEGGREST_1.37.3 fastmap_1.1.0 httr_1.4.4 survival_3.4-0
[149] interactiveDisplayBase_1.35.0 glue_1.6.2 remotes_2.4.2 png_0.1-7
[153] BiocVersion_3.16.0 bluster_1.7.0 bit_4.0.4 HDF5Array_1.25.2
[157] ggforce_0.4.1 stringi_1.7.8 blob_1.2.3 AnnotationHub_3.5.2
[161] BiocSingular_1.13.1 memoise_2.0.1 irlba_2.3.5.1 future.apply_1.10.0

MikeDMorgan commented 1 year ago

I would recommend that you familiarise yourself with the concept of a false discovery rate: https://en.wikipedia.org/wiki/False_discovery_rate