Convert graphs between different formats.
In the current state, the only supported input format are tab-delimited, adjacency matrix and gml formats. Various output format are already supported (dot, gml, tab, adjacency table).
Input and output formats
The tab-delimited format is the more intuitive way to encode a graph. It consists in
the list of edges between the nodes. The names of the nodes are
separated using the tabulation. Some attributes of the edges can be
placed in the following columns (weight, label, color). Orphan nodes can
be specified using this format simply by not specifying the target node.
An adjacency matrix is a n x n table (with n the number of nodes).
In cell A[i,j], you find the weight (or 1 if the graph is unweighted) on the
edge between nodes i and j. An undirected adjacency matrix is
symmetrical : indeed, if an edge exists from node A to node B, it also
exists from node B to node A. A directed matrix is asymmetrical. By
default, convert-graph considers the graphs as undirected but if the
graph you use is undirected, you can use the undirected option.
- all columns must be separated by a tab
- first row of the matrix must contain the names of the nodes and start by a tab character
- all the other rows must start by the names of the node for this column
# some comments
; some other comments
a b c d
a 1 0 0 0
b 1 0 1 0
c 1 0 0 1
d 1 1 0 0
The GML format allows to specify the location, the color, the label and the
width of the nodes and of the edges. A GML file is made up of pairs of a
key and a value. Example for keys are graphs, node and edges. You can
then add any specific information for each key. GML format can be used
by most graph editors (like Cytoscape and yED). For more information on
the GML format, see http://www.infosun.fim.uni-passau.de/Graphlet/GML/. GML graphs can be visualised using for example yED or Cytoscape.
The Dot format is a plain text graph description language. The DOT files are
generally used by the programs composing the GraphViz suite (dot, neato,
dotty, ...). It is a simple way of describing graphs that both humans
and computer programs can use. DOT graphs are typically files that end
with the .dot extension. Like GML, with DOT you can specify a lot of
feature for the nodes (color, width, label). For more information on
the DOT format, see http://www.graphviz.org/doc/info/lang.html
The Path format consists in a list of nodes separated by arrows '->' on the
same line. Typically, these are the output of the NeAT PathFinder
algorithm. More than one pathway can be encoded in the pathway files.
Column specifications (only for tab-delimited format)
Source and target column. Columns containing the source and target nodes.
Weight or label column Column containing the weight or the label on the edge.
Edge color column. Column containing the color of the edges in the RGB color code.
Source and target node color colum. Column containing the color of the node (RGB).
A node can only have one color. If in the file, the color of the
node changes, only the first defined color will be taken into
account. The first character of the RGB color code value must be '#'.
Path column. Column containing the list of pathways.
Undirected graph (only for adjacency table format)
Specifies whether the edges must be considered as undirected, i.e.,
an edge from node A to node B corresponds to an edge from B to A (by
default, edges are directed). Useful for the output as an adjacency
Layout calculation (only for GML format)
Calculates the layout according to the Fruchterman and Reingold algorithm. This
option is only useful for the gml output as the other formats do not
specify the node position.
Distinct paths (only for path input format)
With this option, each pathway of the pathway file will be
considered separately and nodes belonging to more than one pathway
will be duplicated.
Edge width computation
Calculate the edge width for the GML output. The width is proportional to the weight of the edge. This value can only be
computed for the GML output. All weights in the column specified as containing the weights must thus be real values.
Edge color intensity computation
Compute an edge color. The color intensity is proportional to the weight
of the edge. All weights in the column indicated by the -wcol argument must thus be real values.
Supported : green, blue, red, fire, grey.