generate_network function

Create network

Create network

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

generate_network( ResultsCoNI, colorVertexNetwork = TRUE, colorVertexTable, outputDir = "./", outputFileName = "ResultsCoNI", Class = NULL, saveFiles = TRUE )

Arguments

  • 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

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

Examples

#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)
  • Maintainer: José Manuel Monroy Kuhn
  • License: GPL-3
  • Last published: 2021-09-30

Useful links