# BulkSignalR : Inference of ligand-receptor interactions from bulk data or spatial transcriptomics

    library(BulkSignalR)

## Configure local cache and hidden environment variables

`BulkSignalR` donwloads resource files just once after the first installation.

A mecanism handled by `BioCFileCache` package informs the user if the local files are up to date. Several functions as `cacheVersion` and `cacheInfo` give informations about the content of the local cache and its synchronization state with its remote source.

Cache directory can be cleaned by `cacheClear` function and and forced to be created again using `createResources(onRequest=TRUE)`. Otherwise it will be automatically recreated when the package is next loaded.

The knowledge database (pathways - GO-BP / Reactome, Ligand & recepors - LRdb, and gene Network are handled inside a hidden environment variable called `.SignalR`)

The sources can be rewritten using `resetPathways`, `resetLRdb` and `resetNetwork`.

Several data versions can be access remotely from : here These datasets can be used to reset the sources locally.

    # You can see hidden environment variable list as follows.
    ls(BulkSignalR:::.SignalR)

    # Setup Pathways for reactome (can be done for GO-BP also)

    subset <- c("REACTOME_BASIGIN_INTERACTIONS",
    "REACTOME_SYNDECAN_INTERACTIONS",
    "REACTOME_ECM_PROTEOGLYCANS",
    "REACTOME_CELL_JUNCTION_ORGANIZATION")

    reactSubset <- BulkSignalR:::.SignalR$BulkSignalR_Reactome[
    BulkSignalR:::.SignalR$BulkSignalR_Reactome$`Reactome name` %in% subset,]

    resetPathways(dataframe = reactSubset,
    resourceName = "Reactome")

    cacheInfo()
    cacheVersion()

    cacheClear()

    # Ask to download again
    createResources(onRequest=TRUE)

    # Set up LRdb
    df <- data.frame(
      ligand    = c("A2M", "AANAT", "AANAT", "ACE", "ACE"),
      receptor  = c("LRP1", "MTNR1A", "MTNR1B", "AGTR2", "BDKRB2")
    )
    resetLRdb(df,switch=TRUE)

    # Set up Network
    df <- data.frame(
      a.gn   = c("A2M", "AANAT", "AANAT", "ACE", "ACE"),
      type  = c("regulates-transcription-of",
       "regulates-transcription-of",
       "regulates-transcription-of",
       "regulates-transcription-of",
       "regulates-transcription-of"),
      b.gn  = c("LRP1", "MTNR1A", "MTNR1B", "AGTR2", "BDKRB2")
    )

    resetNetwork(df)

Thank you for reading this guide and for using `BulkSignalR`.

## Session Information

    sessionInfo()

    ## R version 4.5.2 (2025-10-31)
    ## Platform: x86_64-pc-linux-gnu
    ## Running under: Ubuntu 24.04.3 LTS
    ##
    ## Matrix products: default
    ## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
    ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
    ##
    ## locale:
    ##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
    ##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C
    ##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
    ##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
    ##  [9] LC_ADDRESS=C               LC_TELEPHONE=C
    ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
    ##
    ## time zone: Etc/UTC
    ## tzcode source: system (glibc)
    ##
    ## attached base packages:
    ## [1] stats     graphics  grDevices utils     datasets  methods   base
    ##
    ## other attached packages:
    ## [1] BulkSignalR_1.2.1 rmarkdown_2.30
    ##
    ## loaded via a namespace (and not attached):
    ##   [1] RColorBrewer_1.1-3          sys_3.4.3
    ##   [3] jsonlite_2.0.0              shape_1.4.6.1
    ##   [5] magrittr_2.0.4              magick_2.9.0
    ##   [7] farver_2.1.2                GlobalOptions_0.1.3
    ##   [9] fs_1.6.6                    vctrs_0.7.1
    ##  [11] multtest_2.66.0             memoise_2.0.1
    ##  [13] RCurl_1.98-1.17             ggtree_4.0.4
    ##  [15] rstatix_0.7.3               htmltools_0.5.9
    ##  [17] S4Arrays_1.10.1             curl_7.0.0
    ##  [19] broom_1.0.11                SparseArray_1.10.8
    ##  [21] Formula_1.2-5               gridGraphics_0.5-1
    ##  [23] sass_0.4.10                 bslib_0.9.0
    ##  [25] htmlwidgets_1.6.4           httr2_1.2.2
    ##  [27] plotly_4.11.0               cachem_1.1.0
    ##  [29] buildtools_1.0.0            igraph_2.2.1
    ##  [31] lifecycle_1.0.5             iterators_1.0.14
    ##  [33] pkgconfig_2.0.3             Matrix_1.7-4
    ##  [35] R6_2.6.1                    fastmap_1.2.0
    ##  [37] MatrixGenerics_1.22.0       clue_0.3-66
    ##  [39] digest_0.6.39               aplot_0.2.9
    ##  [41] colorspace_2.1-2            patchwork_1.3.2
    ##  [43] S4Vectors_0.48.0            GenomicRanges_1.62.1
    ##  [45] RSQLite_2.4.5               ggpubr_0.6.2
    ##  [47] filelock_1.0.3              httr_1.4.7
    ##  [49] abind_1.4-8                 compiler_4.5.2
    ##  [51] withr_3.0.2                 bit64_4.6.0-1
    ##  [53] fontquiver_0.2.1            doParallel_1.0.17
    ##  [55] S7_0.2.1                    backports_1.5.0
    ##  [57] orthogene_1.16.1            carData_3.0-5
    ##  [59] DBI_1.2.3                   homologene_1.4.68.19.3.27
    ##  [61] ggsignif_0.6.4              MASS_7.3-65
    ##  [63] rappdirs_0.3.4              DelayedArray_0.36.0
    ##  [65] rjson_0.2.23                tools_4.5.2
    ##  [67] otel_0.2.0                  ape_5.8-1
    ##  [69] glue_1.8.0                  stabledist_0.7-2
    ##  [71] nlme_3.1-168                grid_4.5.2
    ##  [73] Rtsne_0.17                  cluster_2.1.8.1
    ##  [75] generics_0.1.4              gtable_0.3.6
    ##  [77] tidyr_1.3.2                 data.table_1.18.0
    ##  [79] car_3.1-3                   XVector_0.50.0
    ##  [81] BiocGenerics_0.56.0         ggrepel_0.9.6
    ##  [83] RANN_2.6.2                  foreach_1.5.2
    ##  [85] pillar_1.11.1               yulab.utils_0.2.3
    ##  [87] babelgene_22.9              circlize_0.4.17
    ##  [89] splines_4.5.2               dplyr_1.1.4
    ##  [91] treeio_1.34.0               BiocFileCache_3.0.0
    ##  [93] lattice_0.22-7              survival_3.8-6
    ##  [95] bit_4.6.0                   tidyselect_1.2.1
    ##  [97] fontLiberation_0.1.0        ComplexHeatmap_2.26.0
    ##  [99] SingleCellExperiment_1.32.0 maketools_1.3.2
    ## [101] knitr_1.51                  fontBitstreamVera_0.1.1
    ## [103] gridExtra_2.3               IRanges_2.44.0
    ## [105] Seqinfo_1.0.0               SummarizedExperiment_1.40.0
    ## [107] stats4_4.5.2                xfun_0.56
    ## [109] Biobase_2.70.0              matrixStats_1.5.0
    ## [111] lazyeval_0.2.2              ggfun_0.2.0
    ## [113] yaml_2.3.12                 evaluate_1.0.5
    ## [115] codetools_0.2-20            gdtools_0.4.4
    ## [117] tibble_3.3.1                ggplotify_0.1.3
    ## [119] cli_3.6.5                   systemfonts_1.3.1
    ## [121] jquerylib_0.1.4             Rcpp_1.1.1
    ## [123] gprofiler2_0.2.4            dbplyr_2.5.1
    ## [125] png_0.1-8                   parallel_4.5.2
    ## [127] ggplot2_4.0.1               blob_1.3.0
    ## [129] ggalluvial_0.12.5           bitops_1.0-9
    ## [131] glmnet_4.1-10               SpatialExperiment_1.20.0
    ## [133] viridisLite_0.4.2           tidytree_0.4.7
    ## [135] ggiraph_0.9.3               scales_1.4.0
    ## [137] purrr_1.2.1                 crayon_1.5.3
    ## [139] GetoptLong_1.1.0            rlang_1.1.7