Creates dataframe that describe the network compatible with visNetwork, from an igraph object. The degree and community of each node are computed. Communities are defined by the louvain algorithm, that maximizes local modularity. A type is assigned to each gene, either a regulator or a target gene.
network_data(graph, regulators, gene_info = NULL)
igraph object, as returned by DIANE::network_thresholding()
,
or DIANE::network_from_tests()
.
list of regulators, so they can be marked as special nodes in the network
dataframe with gene IDs as rownames, containing
additional info on genes, in columns named label and description.
For known organisms, it can be obtained from DIANE::get_gene_information()
Named list of dataframes containing nodes and edges information.
if (FALSE) {
data("abiotic_stresses")
data("regulators_per_organism")
genes <- get_locus(abiotic_stresses$heat_DEGs)
# mat was inferred using the function network_inference
mat <- abiotic_stresses$heat_DEGs_regulatory_links
network <- DIANE::network_thresholding(mat, n_edges = length(genes))
data <- network_data(network, regulators_per_organism[["Arabidopsis thaliana"]])
}