# Overview of concordexR

Lambda Moses, Kayla Jackson

#### Mar 25, 2025

The goal of concordexR is to identify spatial homogeneous regions (SHRs) as defined in the recent manuscrpt“Identification of spatial homogenous regions in tissues with concordex”. Briefly, SHRs are are domains that are homogeneous with respect to cell type composition. concordex relies on the the k-nearest-neighbor (kNN) graph to representing similarities between cells and uses common clustering algorithms to identify SHRs.

## 0.1 Installation

This package is under active development will be available in the Bioconductor version 3.20 release.

Until then, please install the package from Github or from the Bioconductor devel branch.

    if (!requireNamespace("BiocManager", quietly=TRUE))
        install.packages("BiocManager")

    #BiocManager::install("concordexR", version="devel")
    devtools::install_github("pachterlab/concordexR")

## 0.2 Example of main functionality

This is a basic example which shows you how to solve a common problem:

    library(concordexR)
    library(SFEData)

    sfe <- McKellarMuscleData("small")
    #> see ?SFEData and browseVignettes('SFEData') for documentation
    #> loading from cache
    #> require("SpatialFeatureExperiment")

    res <- calculateConcordex(sfe, labels=colData(sfe)[["in_tissue"]])

## 0.3 SessionInfo

    sessionInfo()
    #> R Under development (unstable) (2025-03-01 r87860 ucrt)
    #> Platform: x86_64-w64-mingw32/x64
    #> Running under: Windows Server 2022 x64 (build 20348)
    #>
    #> Matrix products: default
    #>   LAPACK version 3.12.0
    #>
    #> locale:
    #> [1] LC_COLLATE=C
    #> [2] LC_CTYPE=English_United States.utf8
    #> [3] LC_MONETARY=English_United States.utf8
    #> [4] LC_NUMERIC=C
    #> [5] LC_TIME=English_United States.utf8
    #>
    #> time zone: America/New_York
    #> tzcode source: internal
    #>
    #> attached base packages:
    #> [1] stats4    stats     graphics  grDevices utils     datasets  methods
    #> [8] base
    #>
    #> other attached packages:
    #>  [1] SpatialFeatureExperiment_1.9.9 SFEData_1.9.1
    #>  [3] patchwork_1.3.0                scater_1.35.4
    #>  [5] ggplot2_3.5.1                  scuttle_1.17.0
    #>  [7] bluster_1.17.0                 BiocNeighbors_2.1.3
    #>  [9] TENxPBMCData_1.25.0            HDF5Array_1.35.16
    #> [11] h5mread_0.99.4                 rhdf5_2.51.2
    #> [13] DelayedArray_0.33.6            SparseArray_1.7.7
    #> [15] S4Arrays_1.7.3                 abind_1.4-8
    #> [17] Matrix_1.7-3                   SingleCellExperiment_1.29.2
    #> [19] SummarizedExperiment_1.37.0    Biobase_2.67.0
    #> [21] GenomicRanges_1.59.1           GenomeInfoDb_1.43.4
    #> [23] IRanges_2.41.3                 S4Vectors_0.45.4
    #> [25] BiocGenerics_0.53.6            generics_0.1.3
    #> [27] MatrixGenerics_1.19.1          matrixStats_1.5.0
    #> [29] concordexR_1.7.1               BiocStyle_2.35.0
    #>
    #> loaded via a namespace (and not attached):
    #>   [1] splines_4.5.0             bitops_1.0-9
    #>   [3] filelock_1.0.3            tibble_3.2.1
    #>   [5] R.oo_1.27.0               lifecycle_1.0.4
    #>   [7] sf_1.0-20                 edgeR_4.5.9
    #>   [9] lattice_0.22-6            MASS_7.3-65
    #>  [11] magrittr_2.0.3            limma_3.63.10
    #>  [13] sass_0.4.9                rmarkdown_2.29
    #>  [15] jquerylib_0.1.4           yaml_2.3.10
    #>  [17] sp_2.2-0                  cowplot_1.1.3
    #>  [19] DBI_1.2.3                 multcomp_1.4-28
    #>  [21] spatialreg_1.3-6          purrr_1.0.4
    #>  [23] R.utils_2.13.0            RCurl_1.98-1.17
    #>  [25] TH.data_1.1-3             sandwich_3.1-1
    #>  [27] rappdirs_0.3.3            GenomeInfoDbData_1.2.14
    #>  [29] ggrepel_0.9.6             irlba_2.3.5.1
    #>  [31] terra_1.8-29              units_0.8-7
    #>  [33] dqrng_0.4.1               DelayedMatrixStats_1.29.1
    #>  [35] codetools_0.2-20          DropletUtils_1.27.2
    #>  [37] tidyselect_1.2.1          UCSC.utils_1.3.1
    #>  [39] farver_2.1.2              ScaledMatrix_1.15.0
    #>  [41] viridis_0.6.5             BiocFileCache_2.15.1
    #>  [43] jsonlite_1.9.1            e1071_1.7-16
    #>  [45] survival_3.8-3            tools_4.5.0
    #>  [47] Rcpp_1.0.14               glue_1.8.0
    #>  [49] gridExtra_2.3             xfun_0.51
    #>  [51] EBImage_4.49.0            dplyr_1.1.4
    #>  [53] withr_3.0.2               BiocManager_1.30.25
    #>  [55] fastmap_1.2.0             boot_1.3-31
    #>  [57] rhdf5filters_1.19.2       spData_2.3.4
    #>  [59] digest_0.6.37             rsvd_1.0.5
    #>  [61] R6_2.6.1                  mime_0.13
    #>  [63] colorspace_2.1-1          wk_0.9.4
    #>  [65] LearnBayes_2.15.1         jpeg_0.1-11
    #>  [67] RSQLite_2.3.9             R.methodsS3_1.8.2
    #>  [69] data.table_1.17.0         FNN_1.1.4.1
    #>  [71] class_7.3-23              httr_1.4.7
    #>  [73] htmlwidgets_1.6.4         spdep_1.3-10
    #>  [75] uwot_0.2.3                pkgconfig_2.0.3
    #>  [77] gtable_0.3.6              blob_1.2.4
    #>  [79] XVector_0.47.2            htmltools_0.5.8.1
    #>  [81] bookdown_0.42             fftwtools_0.9-11
    #>  [83] scales_1.3.0              png_0.1-8
    #>  [85] SpatialExperiment_1.17.0  knitr_1.50
    #>  [87] rjson_0.2.23              nlme_3.1-167
    #>  [89] coda_0.19-4.1             curl_6.2.2
    #>  [91] zoo_1.8-13                proxy_0.4-27
    #>  [93] cachem_1.1.0              BiocVersion_3.21.1
    #>  [95] KernSmooth_2.23-26        parallel_4.5.0
    #>  [97] vipor_0.4.7               AnnotationDbi_1.69.0
    #>  [99] s2_1.1.7                  pillar_1.10.1
    #> [101] grid_4.5.0                vctrs_0.6.5
    #> [103] BiocSingular_1.23.0       dbplyr_2.5.0
    #> [105] beachmat_2.23.7           sfheaders_0.4.4
    #> [107] cluster_2.1.8.1           beeswarm_0.4.0
    #> [109] evaluate_1.0.3            zeallot_0.1.0
    #> [111] isoband_0.2.7             tinytex_0.56
    #> [113] magick_2.8.6              mvtnorm_1.3-3
    #> [115] cli_3.6.4                 locfit_1.5-9.12
    #> [117] compiler_4.5.0            rlang_1.1.5
    #> [119] crayon_1.5.3              labeling_0.4.3
    #> [121] classInt_0.4-11           ggbeeswarm_0.7.2
    #> [123] viridisLite_0.4.2         deldir_2.0-4
    #> [125] BiocParallel_1.41.2       munsell_0.5.1
    #> [127] Biostrings_2.75.4         tiff_0.1-12
    #> [129] ExperimentHub_2.15.0      sparseMatrixStats_1.19.0
    #> [131] bit64_4.6.0-1             Rhdf5lib_1.29.2
    #> [133] KEGGREST_1.47.0           statmod_1.5.0
    #> [135] AnnotationHub_3.15.0      igraph_2.1.4
    #> [137] memoise_2.0.1             bslib_0.9.0
    #> [139] bit_4.6.0