def _get_gosubdagplotnts(self, hdrgo, usrgos, pltargs, go2parentids):
        """Get list of GoSubDagPlotNt for plotting an exploratory GODAG for 1 Group of user GOs."""
        dotgraphs = []
        go2color = pltargs.get_go2color_inst(hdrgo)
        # namedtuple fields: hdrgo gosubdag tot_usrgos parentcnt desc
        ntpltgo0 = self._get_pltdag_ancesters(hdrgo, usrgos, desc="")
        ntpltgo1 = self._get_pltdag_path_hdr(hdrgo, usrgos, desc="pruned")
        num_go0 = len(ntpltgo0.gosubdag.go2obj)
        num_go1 = len(ntpltgo1.gosubdag.go2obj)
        title = "{GO} {NAME}; {N} GO sources".format(
            GO=hdrgo,
            NAME=self.gosubdag.go2obj[hdrgo].name,
            N=len(ntpltgo0.gosubdag.go_sources))
        # print("PltGroupedGos::_get_gosubdagplotnts TITLE", title)
        if num_go0 < pltargs.max_gos:
            # print("PltGroupedGos::_get_gosubdagplotnts ntpltgo0 ALWAYS IF NOT TOO BIG")
            dotgraphs.append(self._get_gosubdagplotnt(ntpltgo0, title, go2color, pltargs))
        # PLOT A: Plot the entire GO ID group under GO header, hdrgo, if not too big
        if num_go0 < pltargs.max_gos and \
            ntpltgo0.tot_usrgos == ntpltgo1.tot_usrgos:
            # print("PltGroupedGos::_get_gosubdagplotnts ntpltgo0 AAAAAAAAAAAAAAAAA")
            dotgraphs.append(self._get_gosubdagplotnt(ntpltgo0, title, go2color, pltargs))
        # PLOT B: Plot only the GO ID group passing thru the GO header, hdrgo, if not too big
        elif num_go1 < pltargs.max_gos and ntpltgo0.tot_usrgos != ntpltgo1.tot_usrgos:
            # print("PltGroupedGos::_get_gosubdagplotnts ntpltgo1(pruned) BBBBBBBBBBBBBBBBB")
            dotgraphs.append(self._get_gosubdagplotnt(ntpltgo1, title, go2color, pltargs))
        # PLOT C: If DAG is large, just print upper portion
        # PLOT D: If DAG is large, just print upper portion passing through the GO header
        elif num_go1 >= pltargs.upper_trigger:
            # print("PltGroupedGos::_get_gosubdagplotnts upper_pruned CCCCCCCCCCCCCCCCC")
            gos_upper = self._get_gos_upper(ntpltgo1, pltargs.max_upper, go2parentids)
            #ntpltgo2 = self._get_pltdag_ancesters(hdrgo, gos_upper, "{BASE}_upper.png")
            ntpltgo3 = self._get_pltdag_path_hdr(hdrgo, gos_upper, "upper_pruned")
            # Middle GO terms chosen to be start points will be green unless reset back
            for goid in gos_upper:
                if goid not in go2color:
                    go2color[goid] = 'white'
            dotgraphs.append(self._get_gosubdagplotnt(ntpltgo3, title, go2color, pltargs))
        else:
            # print("PltGroupedGos::_get_gosubdagplotnts EEEEEEEEEEEEEEEEE")
            self._no_ntplt(ntpltgo0)
        return dotgraphs
def _get_gosubdagplotnts ( self , hdrgo , usrgos , pltargs , go2parentids ) : dotgraphs = [ ] go2color = pltargs . get_go2color_inst ( hdrgo ) ntpltgo0 = self . _get_pltdag_ancesters ( hdrgo , usrgos , desc = "" ) ntpltgo1 = self . _get_pltdag_path_hdr ( hdrgo , usrgos , desc = "pruned" ) num_go0 = len ( ntpltgo0 . gosubdag . go2obj ) num_go1 = len ( ntpltgo1 . gosubdag . go2obj ) title = "{GO} {NAME}; {N} GO sources" . format ( GO = hdrgo , NAME = self . gosubdag . go2obj [ hdrgo ] . name , N = len ( ntpltgo0 . gosubdag . go_sources ) ) if num_go0 < pltargs . max_gos : dotgraphs . append ( self . _get_gosubdagplotnt ( ntpltgo0 , title , go2color , pltargs ) ) if num_go0 < pltargs . max_gos and ntpltgo0 . tot_usrgos == ntpltgo1 . tot_usrgos : dotgraphs . append ( self . _get_gosubdagplotnt ( ntpltgo0 , title , go2color , pltargs ) ) elif num_go1 < pltargs . max_gos and ntpltgo0 . tot_usrgos != ntpltgo1 . tot_usrgos : dotgraphs . append ( self . _get_gosubdagplotnt ( ntpltgo1 , title , go2color , pltargs ) ) elif num_go1 >= pltargs . upper_trigger : gos_upper = self . _get_gos_upper ( ntpltgo1 , pltargs . max_upper , go2parentids ) ntpltgo3 = self . _get_pltdag_path_hdr ( hdrgo , gos_upper , "upper_pruned" ) for goid in gos_upper : if goid not in go2color : go2color [ goid ] = 'white' dotgraphs . append ( self . _get_gosubdagplotnt ( ntpltgo3 , title , go2color , pltargs ) ) else : self . _no_ntplt ( ntpltgo0 ) return dotgraphs
Get list of GoSubDagPlotNt for plotting an exploratory GODAG for 1 Group of user GOs.