Command-line interface for go_draw script.

def cli(self, prt=sys.stdout):
        """Command-line interface for go_draw script."""
        kws = self.objdoc.get_docargs(prt=None)
        godag = get_godag(kws['obo'], prt=None, loading_bar=False, optional_attrs=['relationship'])
        usrgos = GetGOs(godag, max_gos=200).get_usrgos(kws.get('GO_FILE'), prt)
        tcntobj = self._get_tcntobj(usrgos, godag, **kws)  # Gets TermCounts or None
        self.gosubdag = GoSubDag(usrgos, godag, relationships=True, tcntobj=tcntobj, prt=None)
        grprdflt = GrouperDflts(self.gosubdag, kws['slims'])
        ver_list = [godag.version, grprdflt.ver_goslims]
        prt.write("{VER}\n".format(VER="\n".join(ver_list)))
        sections = self._read_sections(kws['ifile'])
        # print("SECSECSEC", sections)
        hdrobj = HdrgosSections(self.gosubdag, grprdflt.hdrgos_dflt, sections)
        grprobj = Grouper("init", usrgos, hdrobj, self.gosubdag)
        # Write sections
        objsecwr = WrSectionsTxt(grprobj, ver_list)
        if not os.path.exists(kws['ifile']):
            objsecwr.wr_txt_section_hdrgos(kws['ifile'])
        objsecwr.wr_txt_section_hdrgos(kws['ofile'])
        objsecpy = WrSectionsPy(grprobj, ver_list)
        if 'py' in kws:
            objsecpy.wr_py_sections(kws['py'], sections, doc=godag.version)
        # Write user GO IDs in sections
        sortobj = Sorter(grprobj)
        objgowr = WrXlsxSortedGos("init", sortobj, ver_list)
        objgowr.wr_txt_gos(kws['txt'], sortby=objsecpy.fncsortnt)
        #objwr.wr_txt_section_hdrgos(kws['ofile'], sortby=objwr.fncsortnt)
        self._prt_cnt_usrgos(usrgos, sys.stdout)