View source: R/utility_functions.R
wgcna2graphDF | R Documentation |
Convert TOM matrix (from WGCNA analysis) to igraph data.frame and filter top connections. Uses igraph::graph_from_adjacency_matrix to convert matrix to data.frame.
wgcna2graphDF(
w.mat,
top.n = NULL,
top.percentile = NULL,
graph.type = "undirected"
)
w.mat |
TOM or adjacency matrix. |
top.n |
Numeric specifying N top connections to return (N < number of connections). If top.n and top.percentile are NULL, all connections retained. |
top.percentile |
Numeric [0,1] specifying Nth percetile of top connections to return. If top.n and top.percentile are NULL, all connections retained. |
graph.type |
Type of graph. Default is "undirected" |
igraph data.frame
Nicholas Mikolajewicz
# get connectivity for specified module
module.name <- names(module.list.all)[names(module.list.all) %in% which.modules]
module.gene.cur <- module.list.all[[module.name]]
w.cur <- w.mat[rownames(w.mat) %in% module.gene.cur, colnames(w.mat) %in% module.gene.cur]
# get igraph data.frame for subset of connections
w.df.top <- wgcna2graphDF(w.cur, top.n = top.n.interactions)
w.df.top$module.membership <- module.name
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.