<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,7 +8,8 @@ import networkx
 
 class KeggPathway(networkx.LabeledDiGraph):
     &quot;&quot;&quot;
-    Represent a Kegg Pathway. Derived from networkx.Digraph
+    Represent a Kegg Pathway. Derived from networkx.Digraph, it adds:
+    - reactions: a dictionary of all the reactions in the file
 
     &gt;&gt;&gt; p = KeggPathway()
     &gt;&gt;&gt; p.add_node('gene1', data={'type': 'gene', })
@@ -46,6 +47,7 @@ class KeggPathway(networkx.LabeledDiGraph):
     &quot;&quot;&quot;
     title = ''
     labels = {}
+    reactions = {}
     def add_node(self, n, data=None):   # TODO: in principle, I should redefine all the add_node functions to make sure they contain the right data.
         networkx.LabeledDiGraph.add_node(self, n, data)
 
@@ -76,6 +78,26 @@ class KeggPathway(networkx.LabeledDiGraph):
         subgraph.labels = labels
         return subgraph
 
+    def neighbours_labels(self, node):
+        &quot;&quot;&quot;
+        like networkx.graph.neighbours, but returns gene label
+
+        &gt;&gt;&gt; p = KeggPathway()
+
+        &gt;&gt;&gt; p.add_node(1, data={'label': 'gene1'})
+        &gt;&gt;&gt; p.add_node(2, data={'label': 'gene2'})
+        &gt;&gt;&gt; p.add_edge(1, 2)
+
+        &gt;&gt;&gt; p.neighbours(1)
+        [2]
+
+        &gt;&gt;&gt; p.neighbours_labels(1)
+        'gene2'
+        &quot;&quot;&quot;
+        neighbours = self.neighbours(node)
+        genes = [self.get_node(n)['label' for n in neighbours]
+
+
     def __repr__(self):
         return self.title + ' pathway' # TODO: __init__ method to make sure self.title exists
 </diff>
      <filename>KeggPathway.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4ef95bedc5a5bbe582346c8c63cc86a9765b8265</id>
    </parent>
  </parents>
  <author>
    <name>dalloliogm</name>
    <email>dalloliogm@gmail.com</email>
  </author>
  <url>http://github.com/dalloliogm/kegg-kgml-parser--python-/commit/a191c632fd4d38601c9d41c7fd8c52e6dccc20b5</url>
  <id>a191c632fd4d38601c9d41c7fd8c52e6dccc20b5</id>
  <committed-date>2009-10-20T04:04:42-07:00</committed-date>
  <authored-date>2009-10-20T04:04:42-07:00</authored-date>
  <message>implemented a neighbours_labels method, some refinements</message>
  <tree>1cd78ebbe76231f8b2b52d3730e2cc9a8107ad91</tree>
  <committer>
    <name>dalloliogm</name>
    <email>dalloliogm@gmail.com</email>
  </committer>
</commit>
