generate_network {CoNI}R Documentation

Create network

Description

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

Usage

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

Value

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

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)

[Package CoNI version 0.1.0 Index]