From cfc9beacfa80534280c92bf8c3b9dd83762a3932 Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Thu, 28 Sep 2023 01:31:22 -0700 Subject: [PATCH] update annoreader_base --- goatools/anno/annoreader_base.py | 18 +++++++++--------- goatools/anno/init/reader_idtogos.py | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/goatools/anno/annoreader_base.py b/goatools/anno/annoreader_base.py index 0ea19bd..2f87fdb 100755 --- a/goatools/anno/annoreader_base.py +++ b/goatools/anno/annoreader_base.py @@ -6,10 +6,11 @@ import collections as cx import logging -from goatools.evidence_codes import EvidenceCodes -from goatools.anno.opts import AnnoOptions -from goatools.godag.consts import NAMESPACE2NS -from goatools.gosubdag.go_tasks import get_go2parents_go2obj +from ..base import logger +from ..anno.opts import AnnoOptions +from ..evidence_codes import EvidenceCodes +from ..godag.consts import NAMESPACE2NS +from ..gosubdag.go_tasks import get_go2parents_go2obj __copyright__ = ( "Copyright (C) 2016-present, DV Klopfenstein, H Tang. All rights reserved." @@ -148,13 +149,12 @@ def _get_1ns_assn(self, namespace_usr): if len(self.namespaces) == 1: nspc = next(iter(self.namespaces)) if namespace_usr is not None and nspc != namespace_usr: - print(f"**WARNING: IGNORING {namespace_usr}; ONLY {nspc} WAS LOADED") + logger.warning("IGNORING %s; ONLY %s WAS LOADED", namespace_usr, nspc) return nspc, self.associations if namespace_usr is None: - print( - "**ERROR get_id2gos: GODAG NOT LOADED. USING: {NSs}".format( - NSs=" ".join(sorted(self.namespaces)) - ) + logger.error( + "get_id2gos: GODAG NOT LOADED. USING: %s", + " ".join(sorted(self.namespaces)), ) return namespace_usr, self.associations diff --git a/goatools/anno/init/reader_idtogos.py b/goatools/anno/init/reader_idtogos.py index cb077af..13cd0ba 100755 --- a/goatools/anno/init/reader_idtogos.py +++ b/goatools/anno/init/reader_idtogos.py @@ -1,6 +1,5 @@ """Reads a Annotation File in text format with data in id2gos line""" -from sys import stdout import timeit import datetime import collections as cx