knitr::opts_chunk$set( collapse = TRUE, message = TRUE, warning = FALSE, cache = FALSE, fig.align = 'center', fig.width = 5, fig.height = 4, crop = NULL )
if(!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager') BiocManager::install("BioNERO")
# Load package after installation library(BioNERO) set.seed(123) # for reproducibility
In the previous vignette, we explored all aspects of gene coexpression networks (GCNs), which are represented as undirected weighted graphs. It is undirected because, for a given link between gene A and gene B, we can only say that these genes are coexpressed, but we cannot know whether gene A controls gene B or otherwise. Further, weighted means that some coexpression relationships between gene pairs are stronger than others. In this vignette, we will demonstrate how to infer gene regulatory networks (GRNs) from expression data with BioNERO. GRNs display interactions between regulators (e.g., transcription factors or miRNAs) and their targets (e.g., genes). Hence, they are represented as directed unweighted graphs.
Numerous algorithms have been developed to infer GRNs from expression data.
However, the algorithm performances are highly dependent on the benchmark
data set. To solve this uncertainty, @Marbach2012 proposed the application
of the "wisdom of the crowds" principle to GRN inference. This approach
consists in inferring GRNs with different algorithms, ranking the interactions
identified by each method, and calculating the average rank for each
interaction across all algorithms used. This way, we can have consensus,
high-confidence edges to be used in biological interpretations.
For that, BioNERO
implements three popular algorithms:
GENIE3 [@Huynh-Thu2010], ARACNE [@Margolin2006] and CLR [@Faith2007].
Before inferring the GRN, we will preprocess the expression data the same way we did in the previous vignette.
# Load example data set data(zma.se) # Preprocess the expression data final_exp <- exp_preprocess( zma.se, min_exp = 10, variance_filter = TRUE, n = 2000 )
BioNERO
requires only 2 objects for GRN inference: the expression data
(SummarizedExperiment, matrix or data frame) and a character vector
of regulators (transcription factors or miRNAs). The transcription factors
used in this vignette were downloaded from PlantTFDB 4.0 [@Jin2017].
data(zma.tfs) head(zma.tfs)
Inferring GRNs based on the wisdom of the crowds principle can be done with
a single function: exp2grn()
. This function will infer GRNs with GENIE3,
ARACNE and CLR, calculate average ranks for each interaction and filter the
resulting network based on the optimal scale-free topology (SFT) fit. In the
filtering step, n different networks are created by subsetting the top n
quantiles. For instance, if a network of 10,000 edges is given as input
with nsplit = 10
, 10 different networks will be created: the first
with 1,000 edges, the second with 2,000 edges, and so on, with the last
network being the original input network. Then, for each network, the function
will calculate the SFT fit and select the best fit.
# Using 10 trees for demonstration purposes. Use the default: 1000 grn <- exp2grn( exp = final_exp, regulators = zma.tfs$Gene, nTrees = 10 ) head(grn)
This section is directed to users who, for some reason (e.g., comparison, exploration), want to infer GRNs with particular algorithms. The available algorithms are:
GENIE3: a regression-tree based algorithm that decomposes the prediction of GRNs for n genes into n regression problems. For each regression problem, the expression profile of a target gene is predicted from the expression profiles of all other genes using random forests (default) or extra-trees.
# Using 10 trees for demonstration purposes. Use the default: 1000 genie3 <- grn_infer( final_exp, method = "genie3", regulators = zma.tfs$Gene, nTrees = 10) head(genie3) dim(genie3)
ARACNE: information-theoretic algorithm that aims to remove indirect interactions inferred by coexpression.
aracne <- grn_infer(final_exp, method = "aracne", regulators = zma.tfs$Gene) head(aracne) dim(aracne)
CLR: extension of the relevance networks algorithm that uses mutual information to identify regulatory interactions.
clr <- grn_infer(final_exp, method = "clr", regulators = zma.tfs$Gene) head(clr) dim(clr)
Users can also infer GRNs with the 3 algorithms at once using the
function exp_combined()
. The resulting edge lists are stored in a list
of 3 elements. [^1]
[^1]: NOTE: Under the hood, exp2grn()
uses exp_combined()
followed
by averaging ranks with grn_average_rank()
and filtering with grn_filter()
.
grn_list <- grn_combined(final_exp, regulators = zma.tfs$Gene, nTrees = 10) head(grn_list$genie3) head(grn_list$aracne) head(grn_list$clr)
After inferring the GRN, BioNERO
allows users to perform some common
downstream analyses.
GRN hubs are defined as the top 10% most highly connected regulators, but
this percentile is flexible in BioNERO
.[^2] They can be identified
with get_hubs_grn()
.
[^2]: NOTE: Remember: GRNs are represented as directed graphs. This implies that only regulators are taken into account when identifying hubs. The goal here is to identify regulators (e.g., transcription factors) that control the expression of several genes.
hubs <- get_hubs_grn(grn) hubs
plot_grn(grn)
GRNs can also be visualized interactively for exploratory purposes.
plot_grn(grn, interactive = TRUE, dim_interactive = c(500,500))
Finally, BioNERO
can also be used for visualization and hub identification
in protein-protein (PPI) interaction networks. The functions get_hubs_ppi()
and plot_ppi()
work the same way as their equivalents for
GRNs (get_hubs_grn()
and plot_grn()
).
This vignette was created under the following conditions:
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.