Convert Kegg Kgml To Graph
3
0
Entering edit mode
11.1 years ago
Charly ▴ 70

Hello,

I ran Kegg/Kaas module and the pathways in xml format through KGML. is there a tool out there which can convert this to a graph?

I tried Visant but it always gives me some errors.

Thank you

kegg xml graph • 7.5k views
ADD COMMENT
3
Entering edit mode
10.9 years ago
aheinzel ▴ 130

have a look at the bioconductor package KEGGgraph. In a recent How To Get The Topology Of A Kegg Pathway? I listed some of the KEGGgraph functions relevant to get a graph from KGML.

ADD COMMENT
1
Entering edit mode
11.0 years ago

I'm not an expert of KGML . I only played with http://code.google.com/p/kgmlreader/source/browse/trunk/KGMLReader/testData/kgml/non-metabolic/organisms/hsa/hsa04060.xml and I created a XSLT stylesheet ( https://github.com/lindenb/xslt-sandbox/blob/master/stylesheets/bio/kgml/kgml2gexf.xsl ) to convert this kgml to gexf (you can open it with http://www.gephi.org ).

$ xsltproc --novalid kgml2gexf.xsl \
  "http://kgmlreader.googlecode.com/svn/trunk/KGMLReader/testData/kgml/non-metabolic/organisms/hsa/hsa04060.xml" > result.gexf


<gexf xmlns="&lt;a href=" http:="" www.gexf.net="" 1.2draft"="" rel="nofollow">http://www.gexf.net/1.2draft" xmlns:g="http://www.gexf.net/1.2draft" xmlns:viz="http://www.
gexf.net/1.1draft/viz" version="1.2">
  <meta>
    <creator>Pierre Lindenbaum</creator>
    <description>KGML</description>
  </meta>
  <attributes class="node">
    <attribute id="0" title="gene" type="string"/>
    <attribute id="1" title="url" type="string"/>
  </attributes>
  <attributes class="edge">
    <attribute id="10" title="type" type="string"/>
  </attributes>
  <graph mode="static" defaultedgetype="directed">
    <nodes>
      <node id="1" label="hsa:53833">
        <attvalues>
          <attvalue for="0" value="gene"/>
          <attvalue for="1" value="&lt;a href=" http:="" www.kegg.jp="" dbget-bin="" www_bget?hsa:53833"="" rel="nofollow">http://www.kegg.jp/dbget-bin/www_bget?hsa:53833"/>
        </attvalues>
      </node>
      <node id="2" label="hsa:53833">
        <attvalues>
          <attvalue for="0" value="gene"/>
          <attvalue for="1" value="&lt;a href=" http:="" www.kegg.jp="" dbget-bin="" www_bget?hsa:53833"="" rel="nofollow">http://www.kegg.jp/dbget-bin/www_bget?hsa:53833"/>
        </attvalues>
      </node>
      <node id="3" label="hsa:3565">
        <attvalues>
          <attvalue for="0" value="gene"/>
          <attvalue for="1" value="&lt;a href=" http:="" www.kegg.jp="" dbget-bin="" www_bget?hsa:3565"="" rel="nofollow">http://www.kegg.jp/dbget-bin/www_bget?hsa:3565"/>
        </attvalues>
      </node>
     (...)
ADD COMMENT
1
Entering edit mode
10.9 years ago
Haluk ▴ 190

I wrote a python script to convert KGML to directed graphs. Also, it converts them to DAGs. If you don't need it, you may customize the kegg.py file. Nodes represent genes, and if there is a relation between gene A to gene B, I insert an edge from A to B.

https://github.com/haluk/kegg.git

ADD COMMENT

Login before adding your answer.

Traffic: 1900 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6