Skip to content

Commit

Permalink
Moved comment closer to specific code it describes, making read loop …
Browse files Browse the repository at this point in the history
…cleaner and smaller.
  • Loading branch information
dvklopfenstein committed Jul 20, 2015
1 parent 630ae60 commit 3b4b78e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions goatools/obo_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ def __iter__(self):
elif line[0:9] == "[Typedef]":
pass # Original OBOReader did not store these
#rec_curr = self._init_GOTerm_ref(rec_curr, "Typedef", lnum) # TBD remove
# Examples of record lines containing ':' include:
# id: GO:0000002
# name: mitochondrial genome maintenance
# namespace: biological_process
# def: "The maintenance of ...
# is_a: GO:0007005 ! mitochondrion organization
elif rec_curr is not None:
line = line.rstrip() # chomp
if ":" in line:
Expand All @@ -160,6 +154,12 @@ def _init_GOTerm_ref(self, rec_curr, name, lnum):

def _add_to_ref(self, rec_curr, line, lnum):
"""Add new fields to the current reference."""
# Examples of record lines containing ':' include:
# id: GO:0000002
# name: mitochondrial genome maintenance
# namespace: biological_process
# def: "The maintenance of ...
# is_a: GO:0007005 ! mitochondrion organization
mtch = re.match(r'^(\S+):\s*(\S.*)$', line)
if mtch:
field_name = mtch.group(1)
Expand Down

0 comments on commit 3b4b78e

Please sign in to comment.