From 8e86e44114c6a2e120914561d3b4c72865cfb0e1 Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Wed, 27 Sep 2023 06:43:00 -0700 Subject: [PATCH] minor formatting --- goatools/anno/annoreader_base.py | 4 ++-- goatools/cli/find_enrichment.py | 4 ++-- goatools/obo_parser.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/goatools/anno/annoreader_base.py b/goatools/anno/annoreader_base.py index 9443c44..0ea19bd 100755 --- a/goatools/anno/annoreader_base.py +++ b/goatools/anno/annoreader_base.py @@ -352,8 +352,8 @@ def chk_qualifiers(self): assert isinstance( qual, set ), f"{self.name}: QUALIFIER MUST BE A LIST: {ntd}" - assert qual != set([""]), ntd - assert qual != set(["-"]), ntd + assert qual != {""}, ntd + assert qual != {"-"}, ntd assert "always" not in qual, "SPEC SAID IT WOULD BE THERE" def chk_godag(self): diff --git a/goatools/cli/find_enrichment.py b/goatools/cli/find_enrichment.py index a6ee5de..f56c2d9 100644 --- a/goatools/cli/find_enrichment.py +++ b/goatools/cli/find_enrichment.py @@ -586,8 +586,8 @@ def _read_geneset(self, study_fn, pop_fn): pop |= study pop -= common study -= common - sys.stderr.write("removed %d overlapping items\n" % (len(common))) - sys.stderr.write("Set 1: {0}, Set 2: {1}\n".format(len(study), len(pop))) + sys.stderr.write(f"removed {len(common)} overlapping items\n") + sys.stderr.write(f"Set 1: {len(study)}, Set 2: {len(pop)}\n") return study, pop def _get_optional_attrs(self): diff --git a/goatools/obo_parser.py b/goatools/obo_parser.py index 49e0d8c..8a7eb68 100755 --- a/goatools/obo_parser.py +++ b/goatools/obo_parser.py @@ -415,6 +415,7 @@ def _init_depth(rec): for rec in self.values(): if rec.level is None: _init_level(rec) + if rec.depth is None: _init_depth(rec)