View source: R/utility_functions.R
getNodesEdges | R Documentation |
Convert igraph data.frame to dataframe of nodes and edges (used as input to visNetwork). Only applicable for undirected networks.
getNodesEdges(df.data)
df.data |
igraph data.frame (output from scMiko::wgcna2graphDF) |
named list of nodes and edges, where each entry is a data.frame.
# 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
# get nodes and edges
node.edge.output <- getNodesEdges(w.df.top)
vis.nodes <- node.edge.output$nodes
vis.links <- node.edge.output$edges
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.