Tools to generate readable XML (GPML) for WikiPathways (https://www.wikipathways.org/) from nodes and interactions data described in text format.
- Python version must be 3.9 or higher
networkx,matplotlibshould be installed usingpip
graphvizrequired forpygraphviz.
- comma-separated data of pathway, nodes, edges, and anchors for each block.
- If each block is preceded by a comment describing the type, for example, a line beginning with "# nodes", it is treated as a block describing a node up to the following empty line.
- The first line of each block describes the header. The headers are converted to dictionary keys after the file is read.
- IDs must be added for nodes, interactions and anchors. Each ID is a 5- or 8-digit string with the letters a-f as its initials.
# pathway
name,organism
# nodes
Label,BiologicalType,GraphId
# interactions
start_point,end_point,BiologicalType
# anchors
interaction,position,GraphId
- name
- organism
- layout (optional)
In txt2gpml, Breadth-first search (BFS) layout is applied by default, so there is no need to specify the algorithm. If you want to use networkx layouts, you can specify circo, dot, etc. as the value of layout attribute.
- Label
- BiologicalType
- GraphId
- Color (optional)
- Xref_db (optional)
- Xref_id (optional)
Nodes are drawn black by default, but you can also specify the Color attribute as a hexadecimal color code, such as 0000ff
- start_point
- end_point
- BiologicalType
- GraphId
- LineStyle (optional)
Interactions describe the start node and target node, each with a node ID. Interactions also describe the relationship between anchors and nodes. Currently, when an interaction combines an anchor and a node, be sure to specify the anchor at the "end_point".
The line style of the interaction is solid by default, but the LindStyle attribute can be set separately, for example, "Broken".
- interaction
- position
- GraphId
Anchors describe the interaction in which the anchor is placed, its relative position in the interaction, and the ID of the anchor.
$ python txt2gpml.py -i input_file -o output_file_name.gpml
- Layout optimization
- Group objects
- DB binding