Title: | Differential Network Analysis using Gene Pathways |
---|---|
Description: | Integrates pathway information into the differential network analysis of two gene expression datasets as described in Grimes, Potter, and Datta (2019) <doi:10.1038/s41598-019-41918-3>. Provides summary functions to break down the results at the pathway, gene, or individual connection level. The differential networks for each pathway of interest can be plotted, and the visualization will highlight any differentially expressed genes and all of the gene-gene associations that are significantly differentially connected. |
Authors: | Tyler Grimes [aut, cre], Somnath Datta [aut] |
Maintainer: | Tyler Grimes <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 0.7.6 |
Built: | 2025-02-22 06:58:57 UTC |
Source: | https://github.com/cran/dnapath |
Extract results of a single pathway from a 'dnapath' object.
## S3 method for class 'dnapath' x[i, ...]
## S3 method for class 'dnapath' x[i, ...]
x |
A 'dnapath' object. |
i |
The index specifying which pathway to extract. |
... |
Additional arguments are ignored. |
The 'dnapath' object unmodified
In the current implementation, there is nothing to subset on for individual pathway results, so the original object is returned unmodified.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways[[1]], group_labels = meso$groups, n_perm = 10) results[1]
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways[[1]], group_labels = meso$groups, n_perm = 10) results[1]
Extract parts of a 'dnapath_list' object.
## S3 method for class 'dnapath_list' x[i, ...]
## S3 method for class 'dnapath_list' x[i, ...]
x |
A 'dnapath_list' object from |
i |
The indices of pathways to extract. |
... |
Additional arguments are ignored. |
A 'dnapath_list' object containing pathways indexed by 'i'.
Extract results of a single pathway from a 'dnapath' object.
## S3 method for class 'dnapath' x[[i, ...]]
## S3 method for class 'dnapath' x[[i, ...]]
x |
A 'dnapath' object. |
i |
The index specifying which pathway to extract. |
... |
Additional arguments are ignored. |
The 'dnapath' object unmodified
In the current implementation, there is nothing to subset on for individual pathway results, so the original object is returned unmodified.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways[[1]], group_labels = meso$groups, n_perm = 10) results[[1]]
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways[[1]], group_labels = meso$groups, n_perm = 10) results[[1]]
Extract results of a single pathway from a 'dnapath_list' object.
## S3 method for class 'dnapath_list' x[[i, ...]]
## S3 method for class 'dnapath_list' x[[i, ...]]
x |
A 'dnapath_list' object from |
i |
The index specifying which pathway to extract. |
... |
Additional arguments are ignored. |
A 'dnapath' object containing a single pathway result.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) results[[1]]
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) results[[1]]
This functionality is not implemented and will return an error.
## S3 replacement method for class 'dnapath' x[...] <- value
## S3 replacement method for class 'dnapath' x[...] <- value
x |
A 'dnapath' object from |
... |
Additional arguments are ignored. |
value |
A 'dnapath' object. |
Replacement is not defined; an error is generated.
This functionality is not implemented and will return an error.
## S3 replacement method for class 'dnapath_list' x[...] <- value
## S3 replacement method for class 'dnapath_list' x[...] <- value
x |
A 'dnapath_list' object from |
... |
Additional arguments are ignored. |
value |
A 'dnapath_list' object. |
Replacement is not defined; an error is generated.
This dataset is used by default if the connection to biomaRt fails. It is highly recommended to retry the function call that attempted to connect to biomaRt. Using this dataset in general may not produce the correct results.
biomart_hsapiens
biomart_hsapiens
A data.frame containing a mapping between entrezgene IDs and HGNC gene symbols.
This functionality is not implemented and will return an error.
## S3 method for class 'dnapath' c(...)
## S3 method for class 'dnapath' c(...)
... |
'dnapath' objects to be concatenated. |
Concatenation is not defined; an error is generated.
This functionality is not implemented and will return an error.
## S3 method for class 'dnapath_list' c(...)
## S3 method for class 'dnapath_list' c(...)
... |
'dnapath_list' objects to be concatenated. |
Concatenation is not defined; an error is generated.
Calculates differential network score for each edge in a network
d_edgesC(nw1, nw2, lp)
d_edgesC(nw1, nw2, lp)
nw1 |
The association scores for network 1 |
nw2 |
The association scores for network 2 |
lp |
The lp value to use. |
A matrix of differential network scores for the edges.
Calculates differential network score for a set of genes
d_genesC(nw1, nw2, lp)
d_genesC(nw1, nw2, lp)
nw1 |
The association scores for network 1 |
nw2 |
The association scores for network 2 |
lp |
The lp value to use. |
A vector of differential network scores for the genes.
Calculates differential network score for an entire pathway.
d_pathwayC(nw1, nw2, lp)
d_pathwayC(nw1, nw2, lp)
nw1 |
The association scores for network 1 |
nw2 |
The association scores for network 2 |
lp |
The lp value to use. |
The differential network score for the pathway.
Integrates pathways into the differential network analysis of gene expression data (Grimes et al. 2019).
dnapath( x, pathway_list, group_labels = NULL, network_inference = run_pcor, n_perm = 100, lp = 2, seed = NULL, verbose = FALSE, mc.cores = 1, ... )
dnapath( x, pathway_list, group_labels = NULL, network_inference = run_pcor, n_perm = 100, lp = 2, seed = NULL, verbose = FALSE, mc.cores = 1, ... )
x |
The gene expression data to be analyzed. This can be either (1) a
list of two matrices or data frames that contain the gene expression profile
from each of two populations (groups) – with rows corresponding to samples
and columns to genes – or (2) a single matrix or data frame
that contains the expression profiles for both groups. For case (2), the
|
pathway_list |
A single vector or list of vectors containing gene names
to indicate pathway membership. The vectors are used to subset the columns
of the matrices in |
group_labels |
If |
network_inference |
A function used to infer the pathway network. It
should take in an n by p matrix and return a p by p matrix of association
scores. (Built-in options include: |
n_perm |
The number of random permutations to perform during
permutation testing. If |
lp |
The lp value used to compute differential connectivity
scores. (Note: If a vector is provided, then the results are returned as
a list of |
seed |
(Optional) Used to set.seed prior to permutation test for each pathway. This allows results for individual pathways to be easily reproduced. |
verbose |
Set to TRUE to turn on messages. |
mc.cores |
Used in |
... |
Additional arguments are passed into the network inference function. |
A 'dnapath_list' or 'dnapath' object containing results for each
pathway in pathway_list
.
Grimes T, Potter SS, Datta S (2019). “Integrating Gene Regulatory Pathways into Differential Network Analysis of Gene Expression Data.” Scientific reports, 9(1), 5479.
filter_pathways
, summary.dnapath_list
subset.dnapath_list
, sort.dnapath_list
,
plot.dnapath
, rename_genes
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) results summary(results) # Summary over all pathways in the pathway list. # Remove results for pathways with p-values above 0.2. top_results <- filter_pathways(results, 0.2) # Sort the top results by the pathway DC score. top_results <- sort(top_results, by = "dc_score") top_results summary(top_results[[1]]) # Summary of pathway 1. plot(results[[1]]) # Plot of the differential network for pathway 1. # Use ... to adjust arguments in the network inference function. # For example, using run_corr() with method = "spearman": results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10, network_inference = run_corr, method = "spearman") results
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) results summary(results) # Summary over all pathways in the pathway list. # Remove results for pathways with p-values above 0.2. top_results <- filter_pathways(results, 0.2) # Sort the top results by the pathway DC score. top_results <- sort(top_results, by = "dc_score") top_results summary(top_results[[1]]) # Summary of pathway 1. plot(results[[1]]) # Plot of the differential network for pathway 1. # Use ... to adjust arguments in the network inference function. # For example, using run_corr() with method = "spearman": results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10, network_inference = run_corr, method = "spearman") results
Uses biomaRt
(Durinck et al. 2009) to map entrezgene IDs to gene
symbols for a given species. Obtains MGI symbols for mouse species and
HGNC symbols for other species.
(Note: this mapping may not work for all species.)
The output of this function can be used in rename_genes
.
entrez_to_symbol( x, species, symbol_name = NULL, dir_save = tempdir(), verbose = TRUE )
entrez_to_symbol( x, species, symbol_name = NULL, dir_save = tempdir(), verbose = TRUE )
x |
A vector of entrezgene IDs. |
species |
The species used to obtain the entrezgene IDs. For example: "Homo sapiens", "m musculus", "C. elegans", or "S cerevisiae". "Human" and "mouse" can also be used and will be converted to the correct species name. |
symbol_name |
The type of gene symbol to use. If NULL, then "hgnc_symbol"
is used for HGNC symbols, unless |
dir_save |
The directory to store annotation reference. Future
calls to this function will use the stored annotations. This speeds up the
operation and allows for reproducibility in the event that the |
verbose |
Set to FALSE to avoid messages. |
If entrezgene IDs are used in a dnapath_list
or dnapath
object, or a pathway list, then get_genes
can be used to
extract them and used for the x
argument here.
A data frame with two columns: the first contains the original
entrezgene IDs, and the second contains the corresponding gene symbols.
MGI symbols are returned when species = "Mus musculus"
and HGNC symbols
are returned otherwise.
Internet connection is required to connect to biomaRt. If unavailable, the default biomart and default species contained in the package is used, but this may not match the desired species.
Durinck S, Spellman PT, Birney E, Huber W (2009). “Mapping Identifiers for the Integration of Genomic Datasets with the R/Bioconductor Package biomaRt.” Nature Protocols, 4, 1184–1191.
data(meso) # The meso gene expression data contains entrezgene IDs. # These can be converted to gene symbols. gene_mat <- entrez_to_symbol(colnames(meso$gene_expression), species = "human")
data(meso) # The meso gene expression data contains entrezgene IDs. # These can be converted to gene symbols. gene_mat <- entrez_to_symbol(colnames(meso$gene_expression), species = "human")
Remove pathways with non-significant DC scores.
filter_pathways(x, alpha_pathway = NULL, monotonized = FALSE)
filter_pathways(x, alpha_pathway = NULL, monotonized = FALSE)
x |
A 'dnapath_list' object from |
alpha_pathway |
Threshold for pathway p-values to determine significance. If NULL, defaults to 0.05 or the minimum possible threshold (based on the number of permutatiosn that were run). |
monotonized |
If TRUE, monotonized p-values are used. |
A 'dnapath_list' object containing only those pathways with differential
connectivity p-values below alpha
.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) results_sig <- filter_pathways(results)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) results_sig <- filter_pathways(results)
Get the gene names from a differential network analysis
get_genes(x)
get_genes(x)
x |
A 'dnapath_list' or 'dnapath' object from |
Returns a vector containing all the genes in x
.
rename_genes
, entrez_to_symbol
,
symbol_to_entrez
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) genes <- get_genes(results)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) genes <- get_genes(results)
This method is used internally by several methods to determine the minimum significance threshold (alpha value) that can be applied to the permutation p-values obtained in the differential network analysis.
get_min_alpha(x)
get_min_alpha(x)
x |
A 'dnapath_list' or 'dnapath' object from |
The minimum alpha level that can be used based on the number of permutations performed in the analysis.
data(meso) data(p53_pathways) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 5) get_min_alpha(results) # 1 / (5 + 1) = 0.167 results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) get_min_alpha(results) # 1 / (10 + 1) = 0.091
data(meso) data(p53_pathways) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 5) get_min_alpha(results) # 1 / (5 + 1) = 0.167 results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) get_min_alpha(results) # 1 / (10 + 1) = 0.091
Extracts the estimated association network for each group from the differential network analysis results.
get_networks(x)
get_networks(x)
x |
A 'dnapath' object from |
A list of two association matrices.
The two matrices can be plotted using the
plot_network
function from the SeqNet package, as
illustrated in the examples below.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Extract the two estimated association networks for the first pathway nw <- get_networks(results[[1]]) # Plot the networks using the SeqNet::plot_network function. # Note that the `compare_graph` argument is used so that the same node layout # is used across all of the plots. # Plot the two networks (in separate plots) g <- SeqNet::plot_network(nw[[1]]) SeqNet::plot_network(nw[[1]], compare_graph = g) # Plot of the differential network for pathway 1. # Again, the `compare_graph` argument is used to maintain the same layout. plot(results[[1]], compare_graph = g) # We see that genes 51230 and 7311 show strong differential connectivity. # The plot_pair() function can be used to investigate these two genes further. plot_pair(results[[1]], "51230", "7311")
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Extract the two estimated association networks for the first pathway nw <- get_networks(results[[1]]) # Plot the networks using the SeqNet::plot_network function. # Note that the `compare_graph` argument is used so that the same node layout # is used across all of the plots. # Plot the two networks (in separate plots) g <- SeqNet::plot_network(nw[[1]]) SeqNet::plot_network(nw[[1]], compare_graph = g) # Plot of the differential network for pathway 1. # Again, the `compare_graph` argument is used to maintain the same layout. plot(results[[1]], compare_graph = g) # We see that genes 51230 and 7311 show strong differential connectivity. # The plot_pair() function can be used to investigate these two genes further. plot_pair(results[[1]], "51230", "7311")
Connects to reactome.db
(Ligtenberg 2019)
to obtain a list of pathways for a given species.
The pathway list is processed by combining any two pathways that have
substantial overlap (default is over 90% overlap). This output if this
function can be used for the pathway_list
argument in
dnapath
.
get_reactome_pathways( species, overlap_limit = 0.9, min_size = 10, max_size = 50, verbose = TRUE )
get_reactome_pathways( species, overlap_limit = 0.9, min_size = 10, max_size = 50, verbose = TRUE )
species |
A string, for example "Homo sapiens" or "Mus musculus", indicating the species to use. |
overlap_limit |
(Optional) Any pathways that have an overlap greater than overlap_limit are combined. Set to NULL to disable this option. |
min_size |
The minimum pathway size. Any Reactome pathways with fewer
than |
max_size |
The maximum pathway size. Any Reactome pathways with more
than |
verbose |
Set to FALSE to turn off messages. |
A named list of vectors. Each vector corresponds to a Reactome pathway and contains the entrezgene IDs of the genes in that pathway.
Ligtenberg W (2019). reactome.db: A Set of Annotation Maps for Reactome. R package version 1.68.0.
The genes in the Reactome pathways use entrezgene IDs. These can be converted
to gene symbols, if desired, using the entrez_to_symbol
and
rename_genes
functions.
# Obtaining a pathway list for human (Homo sapiens). # In this example, overlapping pathways are not combined (this is # specified by setting overlap_limit to NULL). pathway_list <- get_reactome_pathways("Homo sapiens", overlap_limit = NULL, min_size = 10, max_size = 20)
# Obtaining a pathway list for human (Homo sapiens). # In this example, overlapping pathways are not combined (this is # specified by setting overlap_limit to NULL). pathway_list <- get_reactome_pathways("Homo sapiens", overlap_limit = NULL, min_size = 10, max_size = 20)
Return the first part of the dnapath results.
## S3 method for class 'dnapath_list' head(x, ...)
## S3 method for class 'dnapath_list' head(x, ...)
x |
A 'dnapath_list' object. |
... |
Additional paramters are passed into
|
Returns the first five rows of the summary table of the 'dnapath_list' object.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) head(results)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) head(results)
The number of pathways in a 'dnapath_list' object.
## S3 method for class 'dnapath_list' length(x)
## S3 method for class 'dnapath_list' length(x)
x |
A 'dnapath_list' object from |
The number of pathways.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) length(results)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) length(results)
meso
is a list containing gene expression data from Mesothelioma tumors
generated by The Cancer Genome Atlas (TCGA) and obtained using the
LinkedOmics portal. The first element in the list, named "gene_expression",
contains 32 samples (rows) with 150 genes (columns). The second element,
named "groups", is a vector of length 32 indicating which group (stage ii
or stage iv) each gene expression sample belongs to. See the "Package data"
vignette for details.
meso
meso
A list containing two items:
A 32 by 150 matrix of gene expression values
A vector of length 32 indicating which group (stageii or stageiv) each of the rows in the gene expression data belong to.
http://www.linkedomics.org/data_download/TCGA-GBMLGG/
The pathway names in a 'dnapath' object.
## S3 method for class 'dnapath' names(x)
## S3 method for class 'dnapath' names(x)
x |
A 'dnapath' object from |
The pathway's name.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) names(results[[1]])
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) names(results[[1]])
The pathway names in a 'dnapath_list' object.
## S3 method for class 'dnapath_list' names(x)
## S3 method for class 'dnapath_list' names(x)
x |
A 'dnapath_list' object from |
The pathway names.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) names(results)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) names(results)
This is a pathway list obtained from get_reactome_pathways
with species = "human"
(used reactome.db
version 1.68.0).
Only pathways with "p53" in their name are retained (to subset on some
cancer-related pathways). The list contains 13 total pathways. See the
"Package data" vignette for details.
p53_pathways
p53_pathways
A list of 13 vectors each containing a set of entregene IDs.
Inspired by the plotCors
function from the DGCA package,
this function is used to plot the expression values of two genes contained
in the differential network analysis results. This is useful for comparing
the marginal relationship between two genes. Note, however, that this
visualization is not able to show conditional associations.
plot_pair( x, gene_A, gene_B, method = "loess", alpha = 0.5, se_alpha = 0.1, use_facet = FALSE, scales = "fixed", colors = c(rgb(0.31, 0.58, 0.8, 0.9), rgb(1, 0.19, 0.19, 0.9)) )
plot_pair( x, gene_A, gene_B, method = "loess", alpha = 0.5, se_alpha = 0.1, use_facet = FALSE, scales = "fixed", colors = c(rgb(0.31, 0.58, 0.8, 0.9), rgb(1, 0.19, 0.19, 0.9)) )
x |
A 'dnapath' or 'dnapath_list' object from |
gene_A |
The name of the first gene to plot. Must be one of the names
in |
gene_B |
The name of the second gene to plot. Must be one of the names
in |
method |
A charater string, either "lm" or "loess" (the default)
used by |
alpha |
Sets the transparancy of the points, used to set alpha in
|
se_alpha |
Sets the transparancy of the confidence band around the association trend line. Set to 0 to remove the band. |
use_facet |
If TRUE, the groups are plotted in separate graphs
using the |
scales |
Only used if do_facet_wrap is TRUE. See
|
colors |
A vector of length two containing the rgb colors used for the two groups. |
Plots the differential network and returns the ggplot object. Additional modifications can be applied to this object just like any other ggplot.
Grimes T, Datta S (2019). SeqNet: Generate RNA-Seq Data from Gene-Gene Association Networks. R package version 1.1.0, https://CRAN.R-project.org/package=SeqNet.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Plot of the marginal association between the first two genes. genes <- get_genes(results)[1:2] g <- plot_pair(results, genes[1], genes[2]) # The ggplot object, g, can be further modified. # Here we move the legend and use a log scale for the expression values # (the log scale doesn't help with these data but is shown for demonstration). g <- g + ggplot2::theme(legend.position = "bottom") + ggplot2::scale_x_log10() + ggplot2::scale_y_log10() g
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Plot of the marginal association between the first two genes. genes <- get_genes(results)[1:2] g <- plot_pair(results, genes[1], genes[2]) # The ggplot object, g, can be further modified. # Here we move the legend and use a log scale for the expression values # (the log scale doesn't help with these data but is shown for demonstration). g <- g + ggplot2::theme(legend.position = "bottom") + ggplot2::scale_x_log10() + ggplot2::scale_y_log10() g
Uses the plotting functions for networks from the SeqNet
package
(Grimes and Datta 2019)
## S3 method for class 'dnapath' plot( x, alpha = NULL, monotonized = FALSE, only_dc = FALSE, require_dc_genes = FALSE, scale_edges = 1, scale_nodes = 1, ... )
## S3 method for class 'dnapath' plot( x, alpha = NULL, monotonized = FALSE, only_dc = FALSE, require_dc_genes = FALSE, scale_edges = 1, scale_nodes = 1, ... )
x |
A 'dnapath' object from |
alpha |
Threshold for p-values to infer differentially connected edges. If NULL (the default) then no edges are removed from the plot. |
monotonized |
If TRUE, monotonized (i.e. step-down) p-values from the permutation test will be used. |
only_dc |
If TRUE, only differentially connected edges will be shown; any edges that are present in both groups are hidden. If FALSE, the edges shared by both groups are shown. If a non-sparse estimator for network edges is used, then the graph may be dense and setting this argument to TRUE will be useful for highlighting the DC edges. |
require_dc_genes |
If TRUE, the gene-level differential connectivity p-value of the two genes for a given edge are also considered when deciding whether an edge is differentially connected. If neither gene is significantly differentially connected, then the edge between them will not be either. |
scale_edges |
(Optional) multiplier for edge widths. |
scale_nodes |
(Optional) multiplier for node radius |
... |
Additional arguments are passed into the plotting function
|
Plots the differential network and returns the graph object.
See plot_network
for details.
Grimes T, Datta S (2019). SeqNet: Generate RNA-Seq Data from Gene-Gene Association Networks. R package version 1.1.0, https://CRAN.R-project.org/package=SeqNet.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Plot of the differential network for pathway 1. plot(results[[1]]) # Plot of the differential network for pathway 1; remove any edges from # the plot that have p-values above 0.1. plot(results[[1]], alpha = 0.1)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Plot of the differential network for pathway 1. plot(results[[1]]) # Plot of the differential network for pathway 1; remove any edges from # the plot that have p-values above 0.1. plot(results[[1]], alpha = 0.1)
Print function for 'dnapath' object.
## S3 method for class 'dnapath' print(x, ...)
## S3 method for class 'dnapath' print(x, ...)
x |
A 'dnapath' object from |
... |
Additional arguments are ignored. |
Prints a summary of the module.
Print function for 'dnapath_list' object.
## S3 method for class 'dnapath_list' print(x, ...)
## S3 method for class 'dnapath_list' print(x, ...)
x |
A 'dnapath_list' object from |
... |
Additional arguments are ignored. |
Prints a summary of the module.
Rename genes in the differential network analysis
rename_genes(x, gene_mat = NULL, to = NULL, species = NULL, ...)
rename_genes(x, gene_mat = NULL, to = NULL, species = NULL, ...)
x |
A 'dnapath_list' or 'dnapath' object from |
gene_mat |
(Optional) A matrix of key value pairs. The first column should contain
current gene names, and the second column the new names. Any genes that are
not in this matrix will retain their current names. This can be any
user-defined mapping, or the mapping obtained using
|
to |
(Optional) Setting |
species |
(Optional) Must be specified when setting |
... |
Additional arugments are passed into |
Returns x
with all gene names updated according to gene_mat
.
Internet connection is required to connect to use
entrez_to_symbol
or symbol_to_entrez
.
entrez_to_symbol
, symbol_to_entrez
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summary(results[[1]]) # Summary of pathway 1; note that it uses entrezgene IDs. # Rename the entrezgene IDs into gene symbols. results_sym <- rename_genes(results, to = "symbol", species = "human") summary(results_sym[[1]]) # Now the summary uses gene symbols.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summary(results[[1]]) # Summary of pathway 1; note that it uses entrezgene IDs. # Rename the entrezgene IDs into gene symbols. results_sym <- rename_genes(results, to = "symbol", species = "human") summary(results_sym[[1]]) # Now the summary uses gene symbols.
Reverse the order of pathways in a 'dnapath_list' object.
## S3 method for class 'dnapath_list' rev(x, ...)
## S3 method for class 'dnapath_list' rev(x, ...)
x |
A 'dnapath_list' object from |
... |
Additional arguments are ignored. |
A 'dnapath_list' object containing the pathways in 'x' in reverse order.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Filter out pathways that have p-values above 0.2. results <- filter_pathways(results, 0.2) results <- sort(results, by = "dc_score") # Sort by the pathway DC score. results <- rev(results) # Reverse the ordering.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Filter out pathways that have p-values above 0.2. results <- filter_pathways(results, 0.2) results <- sort(results, by = "dc_score") # Sort by the pathway DC score. results <- rev(results) # Reverse the ordering.
Conducts co-expression analysis using ARACNE (Margolin et al. 2006).
Uses the implementation from the minet
package (Meyer et al. 2008).
Can be used for the network_inference
argument in dnapath
.
run_aracne( x, weights = NULL, estimator = "spearman", disc = "none", nbins = NULL, eps = 0, ... )
run_aracne( x, weights = NULL, estimator = "spearman", disc = "none", nbins = NULL, eps = 0, ... )
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
estimator |
Argument is passed into |
disc |
Argument is passed into |
nbins |
Argument is passed into |
eps |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Margolin AA, Nemenman I, Basso K, Wiggins C, Stolovitzky G, Dalla Favera R, Califano A (2006). “ARACNE: An Algorithm for the Reconstruction of Gene Regulatory Networks in a Mammalian Cellular Context.” In BMC Bioinformatics, volume 7(1), S7. BioMed Central.
Meyer PE, Lafitte F, Bontempi G (2008). “minet: A R/Bioconductor Package for Inferring Large Transcriptional Networks using Mutual Information.” BMC Bioinformatics, 9(1), 461.
run_bc3net
, run_c3net
,
run_clr
, run_corr
, run_genie3
,
run_glasso
, run_mrnet
,
run_pcor
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_aracne() can be adjusted using the ... argument. # For example, the 'estimator' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_aracne, estimator = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_aracne() can be adjusted using the ... argument. # For example, the 'estimator' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_aracne, estimator = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using BC3Net (Matos Simoes and Emmert-Streib 2012).
Uses the implementation from the bc3net
package (de Matos Simoes and Emmert-Streib 2016).
Can be used for the network_inference
argument in dnapath
.
run_bc3net( x, weights = NULL, boot = 100, estimator = "spearman", disc = "equalwidth", mtc1 = TRUE, adj1 = "bonferroni", alpha1 = 0.05, mtc2 = TRUE, adj2 = "bonferroni", alpha2 = 0.05, ... )
run_bc3net( x, weights = NULL, boot = 100, estimator = "spearman", disc = "equalwidth", mtc1 = TRUE, adj1 = "bonferroni", alpha1 = 0.05, mtc2 = TRUE, adj2 = "bonferroni", alpha2 = 0.05, ... )
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
boot |
Argument is passed into |
estimator |
Argument is passed into |
disc |
Argument is passed into |
mtc1 |
Argument is passed into |
adj1 |
Argument is passed into |
alpha1 |
Argument is passed into |
mtc2 |
Argument is passed into |
adj2 |
Argument is passed into |
alpha2 |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Matos Simoes Rd, Emmert-Streib F (2012). “Bagging Statistical Network Inference from Large-Scale Gene Expression Data.” PloS ONE, 7(3), e33624.
de Matos Simoes R, Emmert-Streib F (2016). bc3net: Gene Regulatory Network Inference with Bc3net. R package version 1.0.4, https://CRAN.R-project.org/package=bc3net.
run_aracne
, run_c3net
,
run_clr
, run_corr
, run_genie3
,
run_glasso
, run_mrnet
,
run_pcor
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on one pathway from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_bc3net() can be adjusted using the ... argument. # For example, the 'estimator' and 'boot' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_bc3net, boot = 10, estimator = "pearson", mtc1 = FALSE, mtc2 = FALSE) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on one pathway from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_bc3net() can be adjusted using the ... argument. # For example, the 'estimator' and 'boot' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_bc3net, boot = 10, estimator = "pearson", mtc1 = FALSE, mtc2 = FALSE) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using C3Net (Altay and Emmert-Streib 2010).
Uses the implementation from the bc3net
package (de Matos Simoes and Emmert-Streib 2016).
Can be used for the network_inference
argument in dnapath
.
run_c3net( x, weights = NULL, estimator = "spearman", disc = "equalwidth", mtc = TRUE, adj = "bonferroni", alpha = 0.05, ... )
run_c3net( x, weights = NULL, estimator = "spearman", disc = "equalwidth", mtc = TRUE, adj = "bonferroni", alpha = 0.05, ... )
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
estimator |
Argument is passed into |
disc |
Argument is passed into |
mtc |
Argument is passed into |
adj |
Argument is passed into |
alpha |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Altay G, Emmert-Streib F (2010). “Inferring the Conservative Causal Core of Gene Regulatory Networks.” BMC Systems Biology, 4(1), 132.
de Matos Simoes R, Emmert-Streib F (2016). bc3net: Gene Regulatory Network Inference with Bc3net. R package version 1.0.4, https://CRAN.R-project.org/package=bc3net.
run_aracne
,
run_bc3net
,
run_clr
, run_corr
, run_genie3
,
run_glasso
, run_mrnet
,
run_pcor
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on one pathway from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_c3net() can be adjusted using the ... argument. # For example, the 'estimator' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_c3net, estimator = "pearson", mtc = FALSE) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for the pathway. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on one pathway from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_c3net() can be adjusted using the ... argument. # For example, the 'estimator' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_c3net, estimator = "pearson", mtc = FALSE) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for the pathway. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using CLR (Faith et al. 2007).
Uses the implementation from the minet
package (Meyer et al. 2008).
Can be used for the network_inference
argument in dnapath
.
run_clr(x, weights = NULL, estimator = "spearman", ...)
run_clr(x, weights = NULL, estimator = "spearman", ...)
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
estimator |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Faith JJ, Hayete B, Thaden JT, Mogno I, Wierzbowski J, Cottarel G, Kasif S, Collins JJ, Gardner TS (2007). “Large-Scale Mapping and Validation of Escherichia Coli Transcriptional Regulation from a Compendium of Expression Profiles.” PLoS Biology, 5(1), e8.
Meyer PE, Lafitte F, Bontempi G (2008). “minet: A R/Bioconductor Package for Inferring Large Transcriptional Networks using Mutual Information.” BMC Bioinformatics, 9(1), 461.
run_aracne
,
run_bc3net
, run_c3net
, run_corr
,
run_genie3
, run_glasso
, run_mrnet
,
run_pcor
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_clr() can be adjusted using the ... argument. # For example, the 'estimator' paramter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_clr, estimator = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_clr() can be adjusted using the ... argument. # For example, the 'estimator' paramter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_clr, estimator = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using correlation for association measure.
Can be used for the network_inference
argument in dnapath
.
run_corr( x, weights = NULL, threshold = NULL, method = c("pearson", "spearman"), ... )
run_corr( x, weights = NULL, threshold = NULL, method = c("pearson", "spearman"), ... )
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
threshold |
Cutoff for significant associations. If NULL, all correlations are returned. Otherwise, correlations of magnitude at or below this threshold are set to zero. |
method |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
run_aracne
,
run_bc3net
, run_c3net
,
run_clr
, run_genie3
,
run_glasso
, run_mrnet
,
run_pcor
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_corr() can be adjusted using the ... argument. # For example, the 'method' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_corr, method = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_corr() can be adjusted using the ... argument. # For example, the 'method' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_corr, method = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using GENIE3 (Huynh-Thu et al. 2010).
Uses the implementation from the GENIE3
package.
Can be used for the network_inference
argument in dnapath
.
run_genie3(x, weights = NULL, nTrees = 200, ...)
run_genie3(x, weights = NULL, nTrees = 200, ...)
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
nTrees |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Huynh-Thu VA, Irrthum A, Wehenkel L, Geurts P (2010). “Inferring Regulatory Networks from Expression Data using Tree-Based Methods.” PloS ONE, 5(9), e12776.
run_aracne
,
run_bc3net
, run_c3net
,
run_clr
, run_corr
,
run_glasso
, run_mrnet
,
run_pcor
, and run_silencer
if(!requireNamespace("GENIE3", quietly = TRUE)) { data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_genie3() can be adjusted using the ... argument. # For example, the 'nTrees' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_genie3, nTrees = 100) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]]) }
if(!requireNamespace("GENIE3", quietly = TRUE)) { data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 5 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 5 # Use this method to perform differential network analysis. # The parameters in run_genie3() can be adjusted using the ... argument. # For example, the 'nTrees' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_genie3, nTrees = 100) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]]) }
Conducts co-expression analysis using glasso (Friedman et al. 2018).
Uses the implementation from the huge
package (Jiang et al. 2019).
Can be used for the network_inference
argument in dnapath
.
run_glasso( x, method = c("glasso", "mb", "ct"), criterion = c("ric", "stars"), verbose = FALSE, weights = NULL, ... )
run_glasso( x, method = c("glasso", "mb", "ct"), criterion = c("ric", "stars"), verbose = FALSE, weights = NULL, ... )
x |
A n by p matrix of gene expression data (n samples and p genes). |
method |
Argument is passed into |
criterion |
Argument is passed into |
verbose |
Argument is passed into |
weights |
An optional vector of weights. This is used by |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Friedman J, Hastie T, Tibshirani R (2018). glasso: Graphical Lasso: Estimation of Gaussian Graphical Models. R package version 1.10.
Jiang H, Fei X, Liu H, Roeder K, Lafferty J, Wasserman L, Li X, Zhao T (2019). huge: High-Dimensional Undirected Graph Estimation. R package version 1.3.3, https://CRAN.R-project.org/package=huge.
run_aracne
,
run_bc3net
, run_c3net
,
run_clr
, run_corr
,
run_genie3
, run_mrnet
,
run_pcor
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on one pathway from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_glasso() can be adjusted using the ... argument. # For example, the 'criterion' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_glasso, criterion = "ric") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on one pathway from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_glasso() can be adjusted using the ... argument. # For example, the 'criterion' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_glasso, criterion = "ric") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using MRNET (Meyer et al. 2007).
Uses the implementation from the minet
package (Meyer et al. 2008).
Can be used for the network_inference
argument in dnapath
.
run_mrnet(x, estimator = "spearman", weights = NULL, ...)
run_mrnet(x, estimator = "spearman", weights = NULL, ...)
x |
A n by p matrix of gene expression data (n samples and p genes). |
estimator |
Argument is passed into |
weights |
An optional vector of weights. This is used by |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Meyer PE, Kontos K, Lafitte F, Bontempi G (2007). “Information-Theoretic Inference of Large Transcriptional Regulatory Networks.” EURASIP Journal on Bioinformatics and Systems Biology, 2007, 8–8.
Meyer PE, Lafitte F, Bontempi G (2008). “minet: A R/Bioconductor Package for Inferring Large Transcriptional Networks using Mutual Information.” BMC Bioinformatics, 9(1), 461.
run_aracne
,
run_bc3net
, run_c3net
,
run_clr
, run_corr
,
run_genie3
, run_glasso
,
run_pcor
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 3 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 3 # Use this method to perform differential network analysis. # The parameters in run_mrnet() can be adjusted using the ... argument. # For example, the 'estimator' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_mrnet, estimator = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 3 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 3 # Use this method to perform differential network analysis. # The parameters in run_mrnet() can be adjusted using the ... argument. # For example, the 'estimator' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_mrnet, estimator = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using full partial correlations; these are
computed using the shrinkage approach for covariance estimation
(Schäfer and Strimmer 2005) from the
corpcor
package (Schafer et al. 2017).
Can be used for the network_inference
argument in dnapath
.
run_pcor(x, weights = NULL, ranks = FALSE, verbose = FALSE, ...)
run_pcor(x, weights = NULL, ranks = FALSE, verbose = FALSE, ...)
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
ranks |
If TRUE, the gene expression values will be converted to ranks (across samples) prior to covariance estimation. |
verbose |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Schäfer J, Strimmer K (2005). “A Shrinkage Approach to Large-Scale Covariance Matrix Estimation and Implications for Functional Genomics.” Statistical Applications in Genetics and Molecular Biology, 4(1), Article 32.
Schafer J, Opgen-Rhein R, Zuber V, Ahdesmaki M, Silva APD, Strimmer. K (2017). corpcor: Efficient Estimation of Covariance and (Partial) Correlation. R package version 1.6.9, https://CRAN.R-project.org/package=corpcor.
run_aracne
,
run_bc3net
, run_c3net
,
run_clr
, run_corr
, run_genie3
,
run_glasso
, run_mrnet
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 3 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 3 # Use this method to perform differential network analysis. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_pcor) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 3 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 3 # Use this method to perform differential network analysis. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_pcor) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using full partial correlations; these are
computed using the shrinkage approach for covariance estimation
(Schäfer and Strimmer 2005) from the
corpcor
package (Schafer et al. 2017).
Can be used for the network_inference
argument in dnapath
.
This method will use Empirical Bayes FDR to set some estimates to zero.
run_pcor_fdr( x, weights = NULL, ranks = TRUE, thrsh = 1.5, verbose = FALSE, ... )
run_pcor_fdr( x, weights = NULL, ranks = TRUE, thrsh = 1.5, verbose = FALSE, ... )
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
ranks |
If TRUE, the gene expression values will be converted to ranks (across samples) prior to covariance estimation. |
thrsh |
A positive value (defaults to 1.5). This is used as the cutoff for the likelihood ratio of the estimate local FDR. |
verbose |
Argument is passed into |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Schäfer J, Strimmer K (2005). “A Shrinkage Approach to Large-Scale Covariance Matrix Estimation and Implications for Functional Genomics.” Statistical Applications in Genetics and Molecular Biology, 4(1), Article 32.
Schafer J, Opgen-Rhein R, Zuber V, Ahdesmaki M, Silva APD, Strimmer. K (2017). corpcor: Efficient Estimation of Covariance and (Partial) Correlation. R package version 1.6.9, https://CRAN.R-project.org/package=corpcor.
run_aracne
,
run_bc3net
, run_c3net
,
run_clr
, run_corr
, run_genie3
,
run_glasso
, run_mrnet
, and run_silencer
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 3 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 3 # Use this method to perform differential network analysis. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_pcor) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 3 permutations for significance testing. pathway_list <- p53_pathways[c(8, 13)] n_perm <- 3 # Use this method to perform differential network analysis. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_pcor) summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results[[1]]) # Get networks for pathway 1. # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results[[1]]) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Conducts co-expression analysis using the matrix silencer method
(Barzel and Barabási 2013).
Can be used for the network_inference
argument in dnapath
.
run_silencer(x, weights = NULL, method = "spearman", verbose = FALSE, ...)
run_silencer(x, weights = NULL, method = "spearman", verbose = FALSE, ...)
x |
A n by p matrix of gene expression data (n samples and p genes). |
weights |
An optional vector of weights. This is used by |
method |
Argument is passed into |
verbose |
If TRUE, updates are printed during the estimation process. |
... |
Additional arguments are ignored. |
A p by p matrix of association scores.
Barzel B, Barabási A (2013). “Network Link Prediction by Global Silencing of Indirect Correlations.” Nature Biotechnology, 31(8), 720.
run_aracne
,
run_bc3net
, run_c3net
,
run_clr
, run_corr
, run_genie3
,
run_glasso
, run_mrnet
, and
run_pcor
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_silencer() can be adjusted using the ... argument. # For example, the 'method' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_silencer, method = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for the pathway # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
data(meso) data(p53_pathways) # To create a short example, we subset on two pathways from the p53 pathway list, # and will only run 1 permutation for significance testing. pathway_list <- p53_pathways[13] n_perm <- 1 # Use this method to perform differential network analysis. # The parameters in run_silencer() can be adjusted using the ... argument. # For example, the 'method' parameter can be specified as shown here. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = n_perm, network_inference = run_silencer, method = "spearman") summary(results) # The group-specific association matrices can be extracted using get_networks(). nw_list <- get_networks(results) # Get networks for the pathway # nw_list has length 2 and contains the inferred networks for the two groups. # The gene names are the Entrezgene IDs from the original expression dataset. # Renaming the genes in the dnapath results to rename those in the networks. # NOTE: The temporary directory, tempdir(), is used in this example. In practice, # this argument can be removed or changed to an existing directory results <- rename_genes(results, to = "symbol", species = "human", dir_save = tempdir()) nw_list <- get_networks(results) # The genes (columns) will have new names. # (Optional) Plot the network using SeqNet package (based on igraph plotting). # First rename entrezgene IDs into gene symbols. SeqNet::plot_network(nw_list[[1]])
Sort function for 'dnapath_list' object.
## S3 method for class 'dnapath_list' sort(x, decreasing = TRUE, by = "dc_score", ...)
## S3 method for class 'dnapath_list' sort(x, decreasing = TRUE, by = "dc_score", ...)
x |
A 'dnapath_list' object from |
decreasing |
Logical. If TRUE (the default), results are sorted in decreasing order. |
by |
The variable to sort the results by. Must be one of: "mean_expr", the mean expression of each pathway across both groups; "mean_expr1" or "mean_expr2", the mean expression of each pathway in group 1 or 2, respectively; "dc_score", the differential connectivity score of the pathway; "p_value", the p-value of the dc score; "n_genes", the number of genes in each pathway; "pathway", the pathway names; or "n_dc" the number of significantly differentially conncted genes in each pathway. |
... |
Additional arguments are ignored. |
The differential network analysis results ordered by DC pathway score.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Filter out pathways that have p-values above 0.2. results_sig <- filter_pathways(results, 0.2) sort(results_sig, by = "dc_score") # Sort by the pathway DC score. sort(results_sig, by = "n_genes") # Sort by the pathway size. sort(results_sig, by = "mean_expr") # Sort by the mean expression.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) # Filter out pathways that have p-values above 0.2. results_sig <- filter_pathways(results, 0.2) sort(results_sig, by = "dc_score") # Sort by the pathway DC score. sort(results_sig, by = "n_genes") # Sort by the pathway size. sort(results_sig, by = "mean_expr") # Sort by the mean expression.
Subset function for 'dnapath_list' object.
## S3 method for class 'dnapath_list' subset(x, pathways = NULL, genes = NULL, ...)
## S3 method for class 'dnapath_list' subset(x, pathways = NULL, genes = NULL, ...)
x |
A 'dnapath_list' object from |
pathways |
A set of pathways to index on. This can be (1) a vector of
character strings, corresponding to
pathway names or regular expressions used to find pathways, (2) a vector of
indices to select pathways, (3) a vector of
negative indices indicating pathways to remove, or (4) a logical (boolean)
vector that is the same length of current number of pathways in |
genes |
A set of gene names to index on; exact matching is used. Only pathways containing these genes are retained. |
... |
Additional arguments are ignored. |
A subset of the differential network analysis results.
data(meso) # Obtain a pathway list for this short example: pathway_list <- get_reactome_pathways("human", overlap_limit = NULL, min_size = 13, max_size = 19) # Run the differential network analysis. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = 5, seed = 0) summary(results) # Summary over all pathways in the pathway list. # Subset on pathways that contain "cell cycle" in its name. cell_cycle_pathways <- subset(results, pathways = "cell cycle") summary(cell_cycle_pathways) # Subset on pathways that contain the gene 1026 (Entrezgene ID). pathways_with_1026 <- subset(results, genes = "1026") summary(pathways_with_1026) # Multiple pathways and/or genes can also be specified. # Specifying both acts as an "OR" operation. For example, the following subset # will contain pathways containing the words "acetylation" or "methylation" # OR pathways that contain the genes "1108" or "11200". results_OR <- subset(results, pathways = c("acetylation", "methylation"), genes = c("1108", "11200")) summary(results_OR) # To subset on pathways that have both a specific pathway name AND # certain genes, call the subset function twice: once specifying the # `pathways` argument, then pass those results back into subset() with the # `genes` argument specified. For example: results_AND <- subset(results, pathways = c("acetylation", "methylation")) results_AND <- subset(results_AND, genes = c("1108", "11200")) summary(results_AND)
data(meso) # Obtain a pathway list for this short example: pathway_list <- get_reactome_pathways("human", overlap_limit = NULL, min_size = 13, max_size = 19) # Run the differential network analysis. results <- dnapath(x = meso$gene_expression, pathway_list = pathway_list, group_labels = meso$groups, n_perm = 5, seed = 0) summary(results) # Summary over all pathways in the pathway list. # Subset on pathways that contain "cell cycle" in its name. cell_cycle_pathways <- subset(results, pathways = "cell cycle") summary(cell_cycle_pathways) # Subset on pathways that contain the gene 1026 (Entrezgene ID). pathways_with_1026 <- subset(results, genes = "1026") summary(pathways_with_1026) # Multiple pathways and/or genes can also be specified. # Specifying both acts as an "OR" operation. For example, the following subset # will contain pathways containing the words "acetylation" or "methylation" # OR pathways that contain the genes "1108" or "11200". results_OR <- subset(results, pathways = c("acetylation", "methylation"), genes = c("1108", "11200")) summary(results_OR) # To subset on pathways that have both a specific pathway name AND # certain genes, call the subset function twice: once specifying the # `pathways` argument, then pass those results back into subset() with the # `genes` argument specified. For example: results_AND <- subset(results, pathways = c("acetylation", "methylation")) results_AND <- subset(results_AND, genes = c("1108", "11200")) summary(results_AND)
Summarize differential connections for a pathway
summarize_edges(x, alpha = 0.1, monotonized = FALSE, require_dc_genes = FALSE)
summarize_edges(x, alpha = 0.1, monotonized = FALSE, require_dc_genes = FALSE)
x |
A 'dnapath' object from |
alpha |
Threshold for p-values of edge DC scores. Defaults to 0.1 or the minimum possible threshold for the number of permutations performed, whichever is greater. |
monotonized |
If TRUE, monotonized p-values are used. |
require_dc_genes |
If TRUE, the gene-level differential connectivity p-value of the two genes for a given edge are also considered when deciding whether an edge is differentially connected. If neither gene is significantly differentially connected, then the edge between them will not be either. |
A tibble summarizing the differential connections in the pathway.
summarize_pathways
, summarize_genes
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summarize_edges(results[[1]])
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summarize_edges(results[[1]])
Summarize the differential connectivity of genes over all pathways.
summarize_genes(x, alpha = 0.1, monotonized = FALSE)
summarize_genes(x, alpha = 0.1, monotonized = FALSE)
x |
A 'dnapath_list' object from |
alpha |
Threshold for p-values of gene DC scores. Used to determine the number of pathways that each gene is differentially connected in. Defaults to 0.1 or the minimum possible threshold for the number of permutations performed, whichever is greater. |
monotonized |
If TRUE, monotonized p-values are used. |
A tibble summarizing the differential connectivity of genes across all pathways.
summarize_pathways
, summarize_edges
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summarize_genes(results) # Summary of genes across all pathways. summarize_genes(results[[1]]) # Summary of genes within the first pathway.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summarize_genes(results) # Summary of genes across all pathways. summarize_genes(results[[1]]) # Summary of genes within the first pathway.
Summarize the differential connectivity of pathways.
summarize_pathways(x, alpha = 1, alpha_gene = 0.1, monotonized = FALSE)
summarize_pathways(x, alpha = 1, alpha_gene = 0.1, monotonized = FALSE)
x |
A 'dnapath_list' object from |
alpha |
Threshold for p-values of pathway DC scores. Defaults to 1, which leads to results for all pathways being shown. |
alpha_gene |
Threshold for p-values of gene DC scores. Used to determine the number of genes that are differentially connected within each pathway. Defaults to 0.1 or the minimum possible threshold for the number of permutations performed, whichever is greater. |
monotonized |
If TRUE, monotonized p-values are used. |
A tibble summarizing the differential connectivity of genes in the pathway.
summarize_genes
, summarize_edges
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summarize_pathways(results)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summarize_pathways(results)
Summary function for 'dnapath' object.
## S3 method for class 'dnapath' summary(object, by_gene = TRUE, alpha = 1, monotonized = FALSE, ...)
## S3 method for class 'dnapath' summary(object, by_gene = TRUE, alpha = 1, monotonized = FALSE, ...)
object |
A 'dnapath' object from |
by_gene |
If TRUE, summarizes the differential network analysis by genes; otherwise, summarizes by gene-gene interactions. |
alpha |
Threshold for p-values to determine significance; defaults to 1 and returns all results. If 'by_gene' is FALSE, then 'alpha' is used to filter edges. If 'by_gene' is TRUE, then 'alpha' is used to filter genes. |
monotonized |
If TRUE, monotonized p-values are used. |
... |
Additional arguments are ignored. |
Summarizes the differential network analysis result.
summarize_genes
, summarize_edges
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summary(results[[1]]) # Summary of the first pathway in the results.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summary(results[[1]]) # Summary of the first pathway in the results.
Summary function for 'dnapath_list' object.
## S3 method for class 'dnapath_list' summary( object, by_gene = FALSE, alpha_pathway = 1, alpha_gene = 0.1, monotonized = FALSE, ... )
## S3 method for class 'dnapath_list' summary( object, by_gene = FALSE, alpha_pathway = 1, alpha_gene = 0.1, monotonized = FALSE, ... )
object |
A 'dnapath_list' object from |
by_gene |
If TRUE, summarizes the differential network analysis by genes instead of by pathways. |
alpha_pathway |
Threshold for p-values of pathway DC scores; used to subset the results. If NULL (or 1), results for all pathways are shown. |
alpha_gene |
Threshold for p-values of gene DC scores. Used to determine the number of genes that are differentially connected within each pathway. Defaults to 0.1 or the minimum possible threshold for the number of permutations performed, whichever is greater. |
monotonized |
If TRUE, monotonized p-values are used. |
... |
Additional arguments are ignored. |
Summarizes the differential network analysis results.
summarize_pathways
, summarize_genes
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summary(results) # Summary across all pathways in the analysis.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) summary(results) # Summary across all pathways in the analysis.
Uses biomaRt
(Durinck et al. 2009)
to map entrezgene IDs to gene symbols for a given species. The output of
this function can be used in rename_genes
.
symbol_to_entrez( x, species, symbol_name = NULL, dir_save = tempdir(), verbose = TRUE )
symbol_to_entrez( x, species, symbol_name = NULL, dir_save = tempdir(), verbose = TRUE )
x |
A vector of gene symbols. |
species |
The species used to obtain the entrezgene IDs. For example: "Homo sapiens", "m musculus", "C. elegans", or "S cerevisiae". "Human" and "mouse" can also be used and will be converted to the correct species name. |
symbol_name |
The type of gene symbol to use. If NULL, then "hgnc_symbol"
is used for HGNC symbols, unless |
dir_save |
The directory to store annotation reference. Future
calls to this function will use the stored annotations. This speeds up the
operation and allows for reproducibility in the event that the |
verbose |
Set to FALSE to avoid messages. |
If entrezgene IDs are used in a dnapath_list
or dnapath
object, or a pathway list, then get_genes
can be used to
extract them and used for the x
argument here.
A data frame with two columns: the first contains the original gene symbols, and the second contains a corresponding entrezgene ID. If a gene symbol is not mapped to an entrezgene ID, the entrezgene ID is set to -1.
Internet connection is required to connect to biomaRt. If unavailable, the default biomart and default species contained in the package is used, but this may not match the desired species.
It is assumed that x
contains MGI symbols when the biomart species is
"Mus musculus" and HGNC symbols otherwise.
Durinck S, Spellman PT, Birney E, Huber W (2009). “Mapping Identifiers for the Integration of Genomic Datasets with the R/Bioconductor Package biomaRt.” Nature Protocols, 4, 1184–1191.
# Convert a set of gene symbols to entrezgene IDs. # Note that not all may have mapping (such as "MSX" in this example). gene_mat <- symbol_to_entrez(c("SOX2", "SEMA3E", "COL11A1", "UBB", "MSX"), species = "human")
# Convert a set of gene symbols to entrezgene IDs. # Note that not all may have mapping (such as "MSX" in this example). gene_mat <- symbol_to_entrez(c("SOX2", "SEMA3E", "COL11A1", "UBB", "MSX"), species = "human")
Return the last part of the dnapath results.
## S3 method for class 'dnapath_list' tail(x, ...)
## S3 method for class 'dnapath_list' tail(x, ...)
x |
A 'dnapath_list' object. |
... |
Additional paramters are passed into
|
Returns the last five rows of the summary table of the 'dnapath_list' object.
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) tail(results)
data(meso) data(p53_pathways) set.seed(0) results <- dnapath(x = meso$gene_expression, pathway_list = p53_pathways, group_labels = meso$groups, n_perm = 10) tail(results)