Skip to content

Commit

Permalink
Read sections_in.txt, if it exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvklopfenstein committed Jul 10, 2018
1 parent c2876d9 commit b4e6ee5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion goatools/cli/wr_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def cli(self, prt=sys.stdout):
grprdflt = GrouperDflts(self.gosubdag, kws['slims'])
ver_list = [godag.version, grprdflt.ver_goslims]
prt.write("{VER}\n".format(VER="\n".join(ver_list)))
sections = read_sections(kws['ifile'], exclude_ungrouped=True, prt=None)
sections = self._read_sections(kws['ifile'])
# print("SECSECSEC", sections)
hdrobj = HdrgosSections(self.gosubdag, grprdflt.hdrgos_dflt, sections)
grprobj = Grouper("init", usrgos, hdrobj, self.gosubdag)
Expand All @@ -92,6 +92,12 @@ def cli(self, prt=sys.stdout):
#objwr.wr_txt_section_hdrgos(kws['ofile'], sortby=objwr.fncsortnt)
self._prt_cnt_usrgos(usrgos, sys.stdout)

@staticmethod
def _read_sections(ifile):
"""Read sections_in.txt file, if it exists."""
if os.path.exists(ifile):
return read_sections(ifile, exclude_ungrouped=True, prt=None)

def _prt_cnt_usrgos(self, usrgos_read, prt):
num_usrgos = len(self.gosubdag.go_sources)
prt.write("{GOs:6} user GO IDs".format(GOs=num_usrgos))
Expand Down

0 comments on commit b4e6ee5

Please sign in to comment.