kgml2sif
Convert from any graph formatto kgml2sif Convert from kgml2sifto any other format
kgml2sif is a small command-line converter, written in Python 3 by Arnaud Poret (2019-2020) and released under the GPL-3.0 license, that transforms KEGG pathways encoded in KGML into the simple SIF tab-separated interaction format. KGML (KEGG Markup Language) is the XML representation of pathways distributed through the KEGG database and its REST API; SIF is the plain three-column "source, interaction, target" edge list historically associated with Cytoscape. kgml2sif exists to bridge these two worlds, turning KEGG's richly annotated XML graphics model into a lightweight edge list that network-analysis tools can ingest directly.
The tool reads one or more KGML files and emits a SIF file per input. It recognizes three node categories from KGML: genes (KEGG hsa: identifiers), compounds (cpd:, gl:, dr: prefixes), and groups, which represent molecular complexes. Complexes are flattened into synthetic nodes named by concatenating their components with an ampersand (for example cp1&cp2&cp3), and kgml2sif automatically emits "membership" edges linking each component to its complex. KEGG's typed relations are carried into the interaction column: PPrel (protein-protein), GErel (gene-expression regulation), PCrel (protein-compound), and ECrel (enzyme-enzyme relations that share a common compound). Relation subtypes such as activation, inhibition, or binding become the SIF interaction label; edges KEGG leaves unspecified are labelled "unknown."
Usage is deliberately minimal: kgml2sif [-g tsvFile] file.kgml .... The optional -g flag supplies a TSV lookup table to translate KEGG gene IDs into human-readable symbols (for example HRAS activation RAF1). During conversion the tool merges parallel multi-edges where compatible and prints warnings when it encounters conflicting relation types on the same node pair or KEGG identifiers it cannot match.
Its strengths are simplicity, transparency, and a clean mapping to a format that downstream graph software understands with no schema negotiation. The limitations follow from that minimalism: it targets human (hsa) pathways, covers only the four relation classes plus membership, discards KGML's layout, graphics, and much annotation, and produces an unlabelled flat edge list rather than a typed graph. For heavier, multi-format KEGG conversion the Java-based KEGGtranslator (KGML to SBML, BioPAX, GraphML, GML) or the R package KEGGgraph are more comprehensive alternatives; kgml2sif is best suited when a quick, scriptable KEGG-to-SIF step is all that is needed, for instance feeding pathway topology into NetworkX or Cytoscape.
Input Formats
Output Formats
Frequently Asked Questions
What graph file formats does kgml2sif support?
See the list on this page — it shows every format kgml2sif can read, write and display.
How do I import a graph into kgml2sif?
Convert your file to a format kgml2sif can read, then open it in kgml2sif. Use GraphInOut to get a kgml2sif-compatible file in seconds.
How do I convert a file so kgml2sif can open it?
Use the convert links above — upload or paste your graph, pick a format kgml2sif accepts and download the result, right in your browser.
