network_compare.Rd
This function uses the compare
function to compare two adjacency matrices.
network_compare( adj_mat_x, adj_mat_y, comparison_method = "vi", weighted = TRUE, mode = "undirected", diag = TRUE, add_colnames = NULL, add_rownames = NA, ... )
adj_mat_x | a square adjacency matrix. Also supports a sparse matrix from the |
---|---|
adj_mat_y | a square adjacency matrix. Also supports a sparse matrix from the |
comparison_method | the network graph comparison method that shall be employed. Options are:
|
weighted | This argument specifies whether to create a weighted graph from an adjacency matrix. If it is NULL then an unweighted graph is created and the elements of the adjacency matrix gives the number of edges between the vertices. If it is a character constant then for every non-zero matrix entry an edge is created and the value of the entry is added as an edge attribute named by the weighted argument. If it is TRUE then a weighted graph is created and the name of the edge attribute will be weight. See also details below. |
mode | a character value specifying how
|
diag | a logical value specifying whether to include the diagonal of the matrix in the calculation. If |
add_colnames | a character value specifying whether column names shall be added as vertex attributes. Options are:
|
add_rownames | a character value specifying whether to add the row names as vertex attributes. Possible values the same as the previous argument. By default row names are not added. If ‘add.rownames’ and ‘add.colnames’ specify the same vertex attribute, then the former is ignored. |
... | additional arguments passed on to |
A real number returned from the respective comparison_method
method.
Sergio Vasquez and Hajk-Georg Drost
##### Compare networks inferred by PPCOR and PIDC ## Import and rescale GENIE3 network # path to GENIE3 output file genie_output <- system.file('beeline_examples/GENIE3/outFile.csv', package = 'edgynode') # import GENIE3 specific output genie_parsed <- genie(genie_output)#> Warning: The matrix provided as input for genie() was not symmetric.#> Warning: The matrix provided as input for network_rescale() was coerced into symmetric.## Import and rescale PIDC network # path to PIDC output file pidc_output <- system.file('beeline_examples/PIDC/outFile.txt', package = 'edgynode') # import PIDC specific output pidc_parsed <- pidc(pidc_output)#>#>#> #> #> #> #> #>#Set diagonal values diag(pidc_parsed) <- 1 # rescaling PIDC output pidc_rescaled <- network_rescale(pidc_parsed) ### compare both networks # network_compare(genie_rescaled, pidc_rescaled)