Description Usage Arguments Value Examples

View source: R/CoNI_functions.R

This function creates a network using as input the output of CoNI and a table specifying the colors for the nodes.

1 2 3 4 5 6 7 8 9 | ```
generate_network(
ResultsCoNI,
colorVertexNetwork = TRUE,
colorVertexTable,
outputDir = "./",
outputFileName = "ResultsCoNI",
Class = NULL,
saveFiles = TRUE
)
``` |

`ResultsCoNI` |
The input of the function are the results of CoNI. |

`colorVertexNetwork` |
logical. If TRUE, the table colorVertexTable has to be provided to specify vertex colors |

`colorVertexTable` |
Table specifying the colors for the nodes (vertex features). The first column should contain the names matching the features of the vertex Data and the colors or other data can be specified in the rest of the columns |

`outputDir` |
Output directory where the network is saved as well as the file that was used to generate the network. |

`outputFileName` |
The name of the file used to create the network. |

`Class` |
Optional data frame with at least two columns, first column contains all vertex features and another column the vertex feature class (column named "Class"). Necessary for treatment comparisons based on class |

`saveFiles` |
logical. If FALSE TableForNetwork_'outputFileName'.csv and Network_'outputFileName'.graphml are not saved to disk |

Returns an igraph object (network) constructed from ResultsCoNI. The network includes the following network statistics

"degree"The number of the vertex adjacent edges

"hub_score"The principal eigenvector of A*t(A), where A is the adjacency matrix of the graph

"transitivity"Probability that the adjacent vertices of a vertex are connected

"closeness"Steps required to access every other vertex from a given vertex

"betweenness"(roughly) The number of geodesics (shortest paths) going through a vertex or an edge

"eigen_centrality"Takes a graph (graph) and returns the eigenvector centralities of positions v within it

"centralized_betweenness"The vertice-level centrality score according to the betweenness of vertices

"centralized_closeness"The vertice-level centrality score according to the closeness of vertices

"centralized_degree"The vertice-level centrality score according to the degrees of vertices

For more details see igraph package

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
#Generate Network
#Load color nodes table
data(MetColorTable)
#Assign colors according to "Class" column
MetColorTable<-assign_colorsAnnotation(MetColorTable)
#Load CoNI results
data(CoNIResultsHFDToy)
#Generate Network
HFDNetwork<-generate_network(ResultsCoNI = CoNIResultsHFDToy,
colorVertexNetwork = TRUE,
colorVertexTable = MetColorTable,
outputDir = "./",
outputFileName = "HFD",
saveFiles = FALSE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.