plot_gene_coDE_newtork: Plot a network of co-DE genes

View source: R/subset_metaanalysis.R

plot_gene_coDE_newtorkR Documentation

Plot a network of co-DE genes

Description

Plot a network where each node is a gene and each edge represent an event of co-differential expression.

Usage

plot_gene_coDE_newtork(
  dataset = NULL,
  genes = NULL,
  top = NULL,
  code_matrix = NULL,
  gene_stats_matrix = NULL,
  node_color = c("mean", "median", "pseudotscore"),
  node.names = TRUE
)

Arguments

dataset

list of 3 lists, the first with gene IDs (called names), the second with the adjusted p-values for each genes (called adjpval) and the third with log2 fold changes (called log2FC). Each one of these three lists have a number of sublists corresponding to the gene IDs, adjusted p-values, and log2FCs, respectively from the differential expression analyses of each comparison.

genes

it is taken into consideration only when dataset is not NULL. Limit the search only to the desired genes. Cannot be set together with top.

top

it is taken into consideration only when dataset is not NULL. Integer that limits the results to the top number of genes with the highest frequence in the dataset. Cannot be set together with genes.

code_matrix

dataframe of co-DE events only used when dataset=NULL and together with gene_stats_matrix. Can be produced using the function find_coDE. The gene should match the one present in gene_stats_matrix.

gene_stats_matrix

dataframe of statistics only used when dataset=NULL and together with code_matrix. Can be produced using the function find_gene_statistics.

node_color

color nodes based on the genes' mean ("mean") or median ("median") log2 fold changes or based on their pseudo-t-scores ("pseudotscore").

node.names

whether to print (⁠=TRUE⁠) or not (⁠=FALSE⁠) node names.

Value

plot a network where each node is a gene (node size corresponds to the number of comparisons in which a given gene is found co-DE) and each edge represent an event of co-differential expression (edge thickeness corresponds to the number of comparison where the genes are found co-DE). Nodes are colored based on log2FC (median or mean across comparisons) or pseudo-t-score (for more information check documentation for find_gene_statistics). Also returns the co-DE graph object produced by the igraph package.

Examples

# create a list of lists were only the first 500 most significant genes with adjusted p-value < 0.05 and fold change >1.5 or < -1.5 are included
data(list_array) #load data
list_array.05_fc1.5_max500 <- subset_metanalysis(dataset=list_array, adjpval = 0.05, abslog2FC = log2(1.5), max_n_genes = 500)
#plot the co-DE network for the most frequent 10 genes and color the nodes based on their mean log2FC
plot_gene_coDE_newtork(dataset=list_array.05_fc1.5_max500, top = 10, node_color="mean")

Ilarius/metaDEA documentation built on May 6, 2023, 6:47 p.m.