BulkSignalR
now allows the user to request different pairwise comparisons from a large cohort of samples.
In this mode, ligand-receptor interactions are inferred based on gene or protein regulation-associated P-values when comparing two clusters of samples.
The user must first perform a differential expression analysis (using the tool of his choice as DESeq2, EdgeR…) between a pair of sample clusters.
In the next chunk of code, we describe an application to Salivary Duct Carcinoma (SDC) samples where we compare two clusters of patients.
We first create a BSR-DataModel object as follows :
As an example here, we generate random values but user should provide his own logFC and associated pvalues from DGE ouputs.
colA <- as.integer(1:3)
colB <- as.integer(12:15)
# We then coerce the initial **BSRDataModel** object to
# a **BSRDataModelComp** object.
bsrdm.comp <- as(bsrdm, "BSRDataModelComp")
n <- nrow(ncounts(bsrdm.comp))
stats <- data.frame(pval = runif(n),
logFC = rnorm(n, 0, 2),
expr = runif(n, 0, 10))
rownames(stats) <- rownames(ncounts(bsrdm.comp))
We define the cluster comparison and add it.
Finally we infer ligand-receptor interactions from the comparison. We use a subset of the reference to speed up inference in the context of the vignette.
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")
bsrinf.comp <- BSRInferenceComp(bsrdm.comp,
reference="REACTOME",
max.pval = 1,
"random.example")
head(LRinter(bsrinf.comp))
## L R pw.id pw.name pval
## 1 ADAM12 ITGB1 R-HSA-210991 REACTOME_BASIGIN_INTERACTIONS 0.03065734
## 2 ADAM12 ITGB1 R-HSA-3000170 REACTOME_SYNDECAN_INTERACTIONS 0.02662729
## 3 ADAM12 ITGB1 R-HSA-3000178 REACTOME_ECM_PROTEOGLYCANS 0.04034943
## 4 ADAM12 ITGB1 R-HSA-446728 REACTOME_CELL_JUNCTION_ORGANIZATION 0.01717515
## 21 ADAM23 ITGB3 R-HSA-3000170 REACTOME_SYNDECAN_INTERACTIONS 0.09988055
## 22 ADAM23 ITGB3 R-HSA-3000178 REACTOME_ECM_PROTEOGLYCANS 0.04244555
## qval L.logFC R.logFC LR.pval LR.corr rank len rank.pval rank.corr
## 1 0.08929869 2.096193 1.057512 0.05142979 1 6 11 0.5358046 1
## 2 0.08929869 2.096193 1.057512 0.05142979 1 6 11 0.5065554 1
## 3 0.08929869 2.096193 1.057512 0.05142979 1 15 28 0.5559318 1
## 4 0.08929869 2.096193 1.057512 0.05142979 1 18 33 0.4331731 1
## 21 0.11788995 1.658150 3.187042 0.12536368 1 4 9 0.7308502 1
## 22 0.08929869 1.658150 3.187042 0.12536368 1 11 20 0.4297423 1
## LR.score L.expr R.expr
## 1 0.1483121 4.809874 2.113111
## 2 0.1483121 4.809874 2.113111
## 3 0.1483121 4.809874 2.113111
## 4 0.1483121 4.809874 2.113111
## 21 0.1486901 1.620489 7.057691
## 22 0.1486901 1.620489 7.057691
Three previously described S4 objects (BSR-DataModel, BSR-Inference, BSR-Signature) have been extented :
bsrdm.comp
is an extension from BSR-DataModel, previously denoted bsrdm
bsrinf.comp
is an extension from BSR-Inference, previously denoted bsrinf
bsrsig.comp
is an extension from BSR-Signature, previously denoted bsrsig
A new S4 object BSR-ClusterComp representing the comparison of two clusters of samples to infer LR interactions based on the resulting P-values and log-fold-changes (logFC) has been added.
This new desgin let us handle sample cluster comparisons.
as.BSRDataModelComp
converts of BSR-DataModel into BSR-DataModelComp In case ligand-receptor inferences should be obtained based on gene/protein regulation P-values comparing two clusters of samples, it is necessary to first promote the BSR-DataModel object that contains the count matrix into a BSR-DataModelComp object able to contain a list of such cluster pairs comparisons. This function performs this promotion, adding an empty list of comparisons.
BSRClusterComp
is used to define the comparison between two clusters of samples by using defined column indexes of the expression matrix that belong to each cluster, and storing the result of the cluster difference statistical analysis obtained by an external tool such as edgeR, DESeq2, etc.
addClusterComp
add a comparison between two clusters of samples to a BSR-DataModelComp object.
Several comparison can be defined and added sequentially.
Thank you for reading this guide and for using BulkSignalR
.
## R version 4.5.0 beta (2025-04-02 r88102)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.2 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.22-bioc/R/lib/libRblas.so
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_GB 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: America/New_York
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] BulkSignalR_1.1.0
##
## loaded via a namespace (and not attached):
## [1] DBI_1.2.3 grr_0.9.5
## [3] gridExtra_2.3 rlang_1.1.6
## [5] magrittr_2.0.3 clue_0.3-66
## [7] GetoptLong_1.0.5 matrixStats_1.5.0
## [9] compiler_4.5.0 RSQLite_2.3.9
## [11] gprofiler2_0.2.3 png_0.1-8
## [13] vctrs_0.6.5 ggalluvial_0.12.5
## [15] pkgconfig_2.0.3 SpatialExperiment_1.19.0
## [17] shape_1.4.6.1 crayon_1.5.3
## [19] fastmap_1.2.0 backports_1.5.0
## [21] dbplyr_2.5.0 magick_2.8.6
## [23] XVector_0.49.0 rmarkdown_2.29
## [25] UCSC.utils_1.5.0 purrr_1.0.4
## [27] bit_4.6.0 xfun_0.52
## [29] glmnet_4.1-8 cachem_1.1.0
## [31] aplot_0.2.5 GenomeInfoDb_1.45.0
## [33] jsonlite_2.0.0 blob_1.2.4
## [35] DelayedArray_0.35.0 broom_1.0.8
## [37] parallel_4.5.0 cluster_2.1.8.1
## [39] R6_2.6.1 bslib_0.9.0
## [41] RColorBrewer_1.1-3 car_3.1-3
## [43] GenomicRanges_1.61.0 jquerylib_0.1.4
## [45] Rcpp_1.0.14 SummarizedExperiment_1.39.0
## [47] iterators_1.0.14 knitr_1.50
## [49] IRanges_2.43.0 Matrix_1.7-3
## [51] splines_4.5.0 igraph_2.1.4
## [53] tidyselect_1.2.1 abind_1.4-8
## [55] yaml_2.3.10 doParallel_1.0.17
## [57] codetools_0.2-20 curl_6.2.2
## [59] lattice_0.22-7 tibble_3.2.1
## [61] withr_3.0.2 treeio_1.33.0
## [63] Biobase_2.69.0 evaluate_1.0.3
## [65] Rtsne_0.17 gridGraphics_0.5-1
## [67] survival_3.8-3 BiocFileCache_2.17.0
## [69] circlize_0.4.16 ggtree_3.17.0
## [71] pillar_1.10.2 ggpubr_0.6.0
## [73] filelock_1.0.3 carData_3.0-5
## [75] MatrixGenerics_1.21.0 foreach_1.5.2
## [77] stats4_4.5.0 plotly_4.10.4
## [79] ggfun_0.1.8 generics_0.1.3
## [81] S4Vectors_0.47.0 ggplot2_3.5.2
## [83] tidytree_0.4.6 munsell_0.5.1
## [85] scales_1.3.0 glue_1.8.0
## [87] orthogene_1.15.0 lazyeval_0.2.2
## [89] tools_4.5.0 data.table_1.17.0
## [91] ggsignif_0.6.4 babelgene_22.9
## [93] RANN_2.6.2 fs_1.6.6
## [95] grid_4.5.0 ape_5.8-1
## [97] tidyr_1.3.1 colorspace_2.1-1
## [99] SingleCellExperiment_1.31.0 patchwork_1.3.0
## [101] nlme_3.1-168 GenomeInfoDbData_1.2.14
## [103] homologene_1.4.68.19.3.27 Formula_1.2-5
## [105] cli_3.6.4 viridisLite_0.4.2
## [107] S4Arrays_1.9.0 ComplexHeatmap_2.25.0
## [109] dplyr_1.1.4 gtable_0.3.6
## [111] stabledist_0.7-2 yulab.utils_0.2.0
## [113] rstatix_0.7.2 sass_0.4.10
## [115] digest_0.6.37 BiocGenerics_0.55.0
## [117] ggplotify_0.1.2 SparseArray_1.9.0
## [119] ggrepel_0.9.6 htmlwidgets_1.6.4
## [121] farver_2.1.2 rjson_0.2.23
## [123] memoise_2.0.1 htmltools_0.5.8.1
## [125] multtest_2.65.0 lifecycle_1.0.4
## [127] httr_1.4.7 GlobalOptions_0.1.2
## [129] bit64_4.6.0-1 MASS_7.3-65