Edge_Network() performs miRNA gene interaction (MGI)
enrichment analysis through network propagation. It builds a combined
MGI and GGI network, converts it to its line graph so that edges become
nodes, and runs a random walk with restart seeded from the
differentially expressed MGIs. Each pathway is scored by how much of the
propagated signal lands on its own MGIs, with significance assessed
against permuted restart sets, controlled by iter. It needs
a gene-gene interaction (GGI) network in addition to
background_MGI. Because the line graph scales with the
combined size of the background MGI and GGI networks, this method can be
memory and time intensive on real sized data. Consider increasing
ncores for large analyses.
This vignette uses the same toy BLCA example data as the package’s
main Quick Start vignette. See vignette("miREA") for a
description of that data and for running all nine methods together
through miREA().
pathway, a three column data frame with columns
pathway, miRNA, and gene.mir_DEdata, a four column data frame with columns
miRNA, log2FoldChange, stat, and
padj.gene_DEdata, a four column data frame with columns
gene, log2FoldChange, stat, and
padj.mir_mat and gene_mat, raw expression
matrices with samples as columns.background_MGI, a two column data frame with columns
miRNA and gene, or NULL to use
the bundled default (see vignette("miREA"), Step 1, for
details on background_MGI).GGI_source or background_GGI, selecting
the gene to gene interaction network (see
vignette("miREA"), Step 1, for details on
background_GGI and GGI_source).iter, the number of permuted restart sets. The function
default is
iter = 10 to keep build time short
on the small toy dataset.seed, an optional integer for reproducible permutation
draws.input_data <- getAllInputData(
methods = "Edge_Network",
pathway = toy_pathway,
mir_DEdata = toy_mir_DEdata,
gene_DEdata = toy_gene_DEdata,
background_MGI = background_MGI,
GGI_source = "Reactome",
gene_mat = toy_gene_mat,
mir_mat = toy_mir_mat
)
#> Generate all input data...
#> No [scoreFun] parameter has been specified. Use the default [rank] instead!
#> No background_GGI is given. Using the bundled default background_GGI_Reactome instead.
#> Start generate expression data...
#> Start generate pathway data...
#> Start generate pathway_GGI data...
#> Start generate GGI data for whole network...
#> Start generate MGI data for whole network...
#> All the input data is ready!input_data$data$Edge_Network holds the differentially
expressed MGIs. input_data$pathway$TG,
input_data$pathway$Edge, and
input_data$pathway_GGI hold the pathway gene, MGI, and GGI
sets. input_data$MGI and input_data$GGI hold
the background MGI and GGI networks restricted to the genes and miRNAs
relevant to toy_pathway and
toy_mir_DEdata/toy_gene_DEdata.
res <- Edge_Network(
DEMGI = input_data$data$Edge_Network,
pathway_gene = input_data$pathway$TG,
pathway_MGI = input_data$pathway$Edge,
pathway_GGI = input_data$pathway_GGI,
MGI = input_data$MGI,
GGI = input_data$GGI,
minSize = 2,
maxSize = 5000,
iter = 10,
ncores = 1,
pvalueCutoff = 1,
seed = 42
)
#>
#> Start Edge-Network analysis ...
#> Build restart list...
#> Size of sparse restart_matrix: 5.23351287841797 MB.
#> You are use unparallel computing. It could cause huge amount of time.
#>
#> For parallel computing, please specify [ncores] parameter to be larger than 1 (We highly recommend that).
#> Build transition matrix...
#> Size of transition_matrix: 63.4355773925781 MB.
#> Execute RWR with 10 iterations on 1 cores...
#> Summarise by pathways...
#> Edge-Network analysis have finished!
res_display <- head(res)
res_display$contribute_edge <- NULL
res_display
#> pathway
#> 1 Negative regulation of TCF-dependent signaling by WNT ligand antagonists
#> 2 WNT ligand biogenesis and trafficking
#> 3 Cell Cycle, Mitotic
#> 4 Interleukin-4 and Interleukin-13 signaling
#> 5 Cell Cycle
#> 6 Interferon alpha/beta signaling
#> n_MGI score rand_score_dist z
#> 1 395 19.70885 8.1873,10.7890,10.8242,11.1973,12.5459,13.5222 5.101096
#> 2 413 12.02901 3.9293,6.1041,6.8118,6.7310,7.1975,10.1523 3.273075
#> 3 10446 34.54931 26.3206,29.2289,30.2729,29.8629,30.6278,33.4463 2.257891
#> 4 1768 39.34467 25.0321,27.8145,30.6714,30.4074,32.8371,36.6328 2.323690
#> 5 13870 42.71448 35.5802,38.6136,39.7876,39.5982,40.5439,42.5816 1.448120
#> 6 1847 33.62050 21.4909,27.0374,29.6986,28.3658,30.2993,31.9305 1.522279
#> p_value nMoreExtreme p_empirical padj n_contribute_edge
#> 1 1.688461e-07 0 0.09090909 1.688461e-06 153
#> 2 5.319217e-04 0 0.09090909 2.659608e-03 74
#> 3 1.197623e-02 0 0.09090909 2.994057e-02 29265
#> 4 1.007106e-02 0 0.09090909 2.994057e-02 738
#> 5 7.379173e-02 0 0.09090909 1.229862e-01 36339
#> 6 6.396964e-02 0 0.09090909 1.229862e-01 482contribute_edge is omitted from the display above
because it lists every contributing edge for a pathway as a single
string, which can be very long on the toy network and is better
inspected directly on res than printed in full here.
n_contribute_edge reports how many edges that string
holds.
Edge_Network() can also be run through the
miREA() wrapper, which is useful when you want its result
alongside other methods’ results in a single miREAResult
object (see vignette("miREA"), Step 2, for the multi-method
case). Edge_Network() itself has no background
argument, it uses
input_data$MGI/input_data$GGI directly
instead, but miREA() still requires a
background for the Edge target, since
Edge_ORA()/Edge_Score2D()/Edge_Topology()
share that target and do use it. For a single target,
background can be a plain character vector instead of a
named list.
background <- unique(paste0(background_MGI$miRNA, ":", background_MGI$gene))
result <- miREA(
methods = "Edge_Network",
input_data = input_data,
background = background,
minSize = 2,
maxSize = 5000,
iter = 10,
ncores = 1,
pvalueCutoff = 1,
seed = 42
)
#> Start Enrichment analysis...
#> === Start time: 2026-11-25 13:11:56 ===
#>
#> Start Edge-Network analysis ...
#> Build restart list...
#> Size of sparse restart_matrix: 5.23351287841797 MB.
#> You are use unparallel computing. It could cause huge amount of time.
#>
#> For parallel computing, please specify [ncores] parameter to be larger than 1 (We highly recommend that).
#> Build transition matrix...
#> Size of transition_matrix: 63.4355773925781 MB.
#> Execute RWR with 10 iterations on 1 cores...
#> Summarise by pathways...
#> Edge-Network analysis have finished!
#> - Edge_Network finished, time cost: 6.35 s.
#>
#> miREA analysis have finished!...
#> === End time: 2026-11-25 13:12:03 ===
result_display <- head(result$result$Edge_Network)
result_display$contribute_edge <- NULL
result_display
#> pathway
#> 1 Negative regulation of TCF-dependent signaling by WNT ligand antagonists
#> 2 WNT ligand biogenesis and trafficking
#> 3 Cell Cycle, Mitotic
#> 4 Interleukin-4 and Interleukin-13 signaling
#> 5 Cell Cycle
#> 6 Interferon alpha/beta signaling
#> n_MGI score rand_score_dist z
#> 1 395 19.70885 8.1873,10.7890,10.8242,11.1973,12.5459,13.5222 5.101096
#> 2 413 12.02901 3.9293,6.1041,6.8118,6.7310,7.1975,10.1523 3.273075
#> 3 10446 34.54931 26.3206,29.2289,30.2729,29.8629,30.6278,33.4463 2.257891
#> 4 1768 39.34467 25.0321,27.8145,30.6714,30.4074,32.8371,36.6328 2.323690
#> 5 13870 42.71448 35.5802,38.6136,39.7876,39.5982,40.5439,42.5816 1.448120
#> 6 1847 33.62050 21.4909,27.0374,29.6986,28.3658,30.2993,31.9305 1.522279
#> p_value nMoreExtreme p_empirical padj n_contribute_edge
#> 1 1.688461e-07 0 0.09090909 1.688461e-06 153
#> 2 5.319217e-04 0 0.09090909 2.659608e-03 74
#> 3 1.197623e-02 0 0.09090909 2.994057e-02 29265
#> 4 1.007106e-02 0 0.09090909 2.994057e-02 738
#> 5 7.379173e-02 0 0.09090909 1.229862e-01 36339
#> 6 6.396964e-02 0 0.09090909 1.229862e-01 482sessionInfo()
#> R version 4.6.2 (2026-10-29)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04.1 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.32.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=en_US.UTF-8
#> [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] miREA_0.99.5 BiocStyle_2.41.0
#>
#> loaded via a namespace (and not attached):
#> [1] sass_0.5.0 generics_0.1.4 shape_1.4.6.1
#> [4] lattice_0.23-1 digest_0.6.39 magrittr_2.0.5
#> [7] evaluate_1.0.5 grid_4.6.2 RColorBrewer_1.1-3
#> [10] iterators_1.0.14 circlize_0.4.18 fastmap_1.2.0
#> [13] foreach_1.5.2 doParallel_1.0.17 jsonlite_2.0.0
#> [16] Matrix_1.7-6 ggnewscale_0.5.2 GlobalOptions_0.1.4
#> [19] BiocManager_1.30.27 ComplexHeatmap_2.29.0 scales_1.4.0
#> [22] codetools_0.2-20 jquerylib_0.1.4 cli_3.6.6
#> [25] rlang_1.3.0 crayon_1.5.3 withr_3.0.3
#> [28] cachem_1.1.0 yaml_2.3.12 otel_0.3.0
#> [31] tools_4.6.2 parallel_4.6.2 BiocParallel_1.47.0
#> [34] dplyr_1.2.1 ggplot2_4.0.4 colorspace_2.1-4
#> [37] GetoptLong_1.1.1 BiocGenerics_0.59.13 buildtools_1.0.0
#> [40] vctrs_0.7.3 R6_2.6.1 png_0.1-9
#> [43] matrixStats_1.5.0 stats4_4.6.2 lifecycle_1.0.5
#> [46] S4Vectors_0.53.0 IRanges_2.47.5 clue_0.3-68
#> [49] cluster_2.1.8.3 pkgconfig_2.0.3 gtable_0.3.6
#> [52] bslib_0.12.0 pillar_1.11.1 data.table_1.18.6.1
#> [55] glue_1.8.1 tidyselect_1.2.1 tibble_3.3.1
#> [58] xfun_0.62 sys_3.4.3 knitr_1.52
#> [61] farver_2.1.2 rjson_0.2.23 patchwork_1.3.2
#> [64] igraph_2.3.4 htmltools_0.5.9 rmarkdown_2.32
#> [67] maketools_1.3.2 ggalluvial_0.12.6 compiler_4.6.2
#> [70] S7_1.0.0