View source: R/orca_interface.R
read_simple_graphs | R Documentation |
Reads graph data from all files in a directory matching the specified filename pattern. From each file, an a igraph graph object is constructed and the requested subset of the following simplifications is made in the following order: 1. Makes the graph undirected 2. Removes loops (where both endpoints of an edge are the same vertex) 3. Removes multiple edges (i.e. ensuring only one edge exists for each pair of endpoints) 4. Removes isolated vertices (i.e. vertices with no edges after the previous alterations)
read_simple_graphs( source_dir, format = "ncol", pattern = "*", as_undirected = TRUE, remove_loops = TRUE, remove_multiple = TRUE, remove_isolates = TRUE )
source_dir |
Path to directory containing files with graph data |
format |
Format of graph data. Any format supported by
|
pattern |
Pattern to use to filter filenames. Any pattern supported by
|
as_undirected |
If TRUE make graph edges undirected |
remove_loops |
If TRUE, remove edgeds that connect a vertex to itself |
remove_multiple |
If TRUE remove multiple edges connencting the same pair of vertices |
remove_isolates |
If TRUE, remove vertices with no edges after the previous alterations have been made |
A named list of simplified igraph graph object, with the name of each graph set to the name of the file it was read from.
# Set source directory for Virus protein-protein interaction edge files stored in the netdist package. source_dir <- system.file(file.path("extdata", "VRPINS"), package = "netdist") print(source_dir) # Load query graphs as igraph objects graph_1 <- read_simple_graph(file.path(source_dir, "EBV.txt"), format = "ncol") graph_1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.