Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed Sep 27, 2023
1 parent 8826dfe commit 47f2611
Showing 1 changed file with 7 additions and 37 deletions.
44 changes: 7 additions & 37 deletions goatools/obo_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

"""Read and store Gene Ontology's obo file."""
# -*- coding: UTF-8 -*-
from __future__ import print_function

from sys import stdout
from sys import stderr
import os

from sys import stderr, stdout
from typing import Optional

from goatools.godag.obo_optional_attributes import OboOptionalAttrs
from goatools.godag.typedef import TypeDef
from goatools.godag.typedef import add_to_typedef
Expand Down Expand Up @@ -312,9 +312,9 @@ class GODag(dict):
# pylint: disable=line-too-long
def __init__(
self,
obo_file="go-basic.obo",
optional_attrs=None,
load_obsolete: str = False,
obo_file: str = "go-basic.obo",
optional_attrs: Optional[set] = None,
load_obsolete: bool = False,
prt=stdout,
):
super(GODag, self).__init__()
Expand Down Expand Up @@ -416,39 +416,9 @@ def _init_depth(rec):
rec.depth = 0
return rec.depth

#### MOVED TO goatools/godag/reldepth.py:
#### def _init_reldepth(rec):
#### if not hasattr(rec, 'reldepth'):
#### up_terms = rec.get_goterms_upper()
#### if up_terms:
#### rec.reldepth = max(_init_reldepth(rec) for rec in up_terms) + 1
#### else:
#### rec.reldepth = 0
#### return rec.reldepth

for rec in self.values():
#### MOVED TO goatools/godag/reldepth.py:
#### # Add invert relationships
#### if has_relationship:
#### if rec.depth is None:
#### _init_reldepth(rec)

#### # print("BBBBBBBBBBB1", rec.item_id, rec.relationship)
#### #for (typedef, terms) in rec.relationship.items():
#### # invert_typedef = self.typedefs[typedef].inverse_of
#### # # print("BBBBBBBBBBB2 {} ({}) ({}) ({})".format(
#### # # rec.item_id, rec.relationship, typedef, invert_typedef))
#### # if invert_typedef:
#### # # Add inverted relationship
#### # for term in terms:
#### # if not hasattr(term, 'relationship'):
#### # term.relationship = defaultdict(set)
#### # term.relationship[invert_typedef].add(rec)
#### # print("BBBBBBBBBBB3", rec.item_id, rec.relationship)

if rec.level is None:
_init_level(rec)

if rec.depth is None:
_init_depth(rec)

Expand Down

0 comments on commit 47f2611

Please sign in to comment.