Skip to content

Commit

Permalink
Merge pull request #30 from dvklopfenstein/master
Browse files Browse the repository at this point in the history
New GOTerm, id_num.  Help with install for those with pygraphviz dll issues.
  • Loading branch information
tanghaibao committed Mar 25, 2015
2 parents 75ed821 + 6e59c90 commit e1a574d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
19 changes: 13 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,21 @@ Dependencies

easy_install fisher

If you need to plot the ontology lineage, you need the following tools to be
installed.
- To plot the ontology lineage, install one of these two options:

- `Graphviz <http://www.graphviz.org/>`_, for graph visualization.
- `pygraphviz <http://networkx.lanl.gov/pygraphviz/>`_, Python binding for
communicating with Graphviz::
1. Graphviz

easy_install pygraphviz
- `Graphviz <http://www.graphviz.org/>`_, for graph visualization.
- `pygraphviz <http://networkx.lanl.gov/pygraphviz/>`_, Python binding for
communicating with Graphviz::
easy_install pygraphviz

2. `pydot <https://code.google.com/p/pydot/>`_, a Python interface to Graphviz's Dot language.
- `pyparsing <http://pyparsing.wikispaces.com/>`_ is a requirement for pydot
- Images can be viewed using either:
- `ImageMagick <http://www.imagemagick.org/>`_'s *display*
- `Graphviz <http://www.graphviz.org/>`_


Cookbook
Expand Down
4 changes: 4 additions & 0 deletions goatools/obo_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def __next__(self):
for line in lines:
if line.startswith("id:"):
rec.id = after_colon(line)
num = rec.id.replace("GO:", "", 1)
if num.isdigit():
rec.id_num = int(num)
if line.startswith("alt_id:"):
rec.alt_ids.append(after_colon(line))
elif line.startswith("name:"):
Expand All @@ -102,6 +105,7 @@ class GOTerm:

def __init__(self):
self.id = "" # GO:xxxxxx
self.id_num = None # GO term integer
self.name = "" # description
self.namespace = "" # BP, CC, MF
self._parents = [] # is_a basestring of parents
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
url='http://github.com/tanghaibao/goatools',
description="Python scripts to find enrichment of GO terms",
long_description=open("README.rst").read(),
install_requires=['fisher', 'pygraphviz']
install_requires=['fisher']
)

0 comments on commit e1a574d

Please sign in to comment.