Return all the GO IDs in a 2-D sections list.
351548
def get_goids_sections(sections):
        """"""
        goids_all = set()
        for _, goids_sec in sections:
            goids_all |= set(goids_sec)
        return goids_all
357446
def _get_tables(self, ods):
        """"""

        childnodes = ods.spreadsheet.childNodes
        qname_childnodes = [(s.qname[1], s) for s in childnodes]
        return [node for name, node in qname_childnodes if name == u"table"]
553103
def _get_selected_ids(self):
        """"""
        selection = self.get_selection()
        if selection.get_mode() != gtk.SELECTION_MULTIPLE:
            raise AttributeError('selected_ids only valid for select_multiple')
        model, selected_paths = selection.get_selected_rows()
        if selected_paths:
            return zip(*selected_paths)[0]
        else:
            return ()
453102
def get_go2txt(grprobj_cur, grp_go2color, grp_go2bordercolor):
        """"""
        goids_main = set(o.id for o in grprobj_cur.gosubdag.go2obj.values())
        hdrobj = grprobj_cur.hdrobj
        grprobj_all = Grouper("all",
                              grprobj_cur.usrgos.union(goids_main), hdrobj, grprobj_cur.gosubdag)
        # Adds section text to all GO terms in plot (misses middle GO terms)
        _secdflt = hdrobj.secdflt
        _hilight = set(grp_go2color.keys()).union(grp_go2bordercolor)
        ret_go2txt = {}
        # Keep sections text only if GO header, GO user, or not Misc.
        if hdrobj.sections:
            for goid, txt in grprobj_all.get_go2sectiontxt().items():
                if txt == 'broad':
                    continue
                if txt != _secdflt or goid in _hilight:
                    ret_go2txt[goid] = txt
        return ret_go2txt
178132
def get_sections_2d_nts(self, sortby=None):
        """"""
        sections_2d_nts = []
        for section_name, hdrgos_actual in self.get_sections_2d():
            hdrgo_nts = self.gosubdag.get_nts(hdrgos_actual, sortby=sortby)
            sections_2d_nts.append((section_name, hdrgo_nts))
        return sections_2d_nts
533421
def get_sections(self):
        
        try:
            obj_list = self.__dict__['sections']
            return [Section(i) for i in obj_list]
        except KeyError:
            self._lazy_load()
            obj_list = self.__dict__['sections']
            return [Section(i) for i in obj_list]
952088
def get_all_incomings(chebi_ids):
    ''''''
    all_incomings = [get_incomings(chebi_id) for chebi_id in chebi_ids]
    return [x for sublist in all_incomings for x in sublist]
865124
def get_depth2goobjs(go2obj, max_depth=2):
        """"""
        depth2goobjs = {d:list() for d in range(max_depth+1)}
        goid_seen = set()
        for _, goobj in sorted(go2obj.items(), key=lambda t: t[1].depth):
            # Save depth-00, depth-01, depth-02
            if goobj.depth > max_depth:
                break
            goid = goobj.id
            if not goobj.is_obsolete and goid not in goid_seen:
                depth2goobjs[goobj.depth].append(goobj)
                goid_seen.add(goid)
        return depth2goobjs
1093731
def _get_go2pydotnode(self):
        """"""
        go2node = {}
        for goid, goobj in self.godag.go2obj.items():
            txt = self._get_node_text(goid, goobj)
            fillcolor = self.goid2color.get(goid, "white")
            node = self.pydot.Node(
                txt,
                shape="box",
                style="rounded, filled",
                fillcolor=fillcolor,
                color="mediumseagreen")
            go2node[goid] = node
        return go2node
164336
def get_section_marks(self):
        """"""
        return [abc if s in self.sec2chr else "." for s, abc in self.datobj.sec2chr.items()]
165671
def get_sections_2d(self):
        """"""
        sections_hdrgos_act = []
        hdrgos_act_all = self.get_hdrgos()  # Header GOs actually used to group
        hdrgos_act_secs = set()
        if self.hdrobj.sections:
            for section_name, hdrgos_all_lst in self.hdrobj.sections:
                # print("GGGGGGGGGGGGGGGGG {N:3} {NAME}".format(N=len(hdrgos_all_lst), NAME=section_name))
                hdrgos_all_set = set(hdrgos_all_lst)
                hdrgos_act_set = hdrgos_all_set.intersection(hdrgos_act_all)
                if hdrgos_act_set:
                    hdrgos_act_secs |= hdrgos_act_set
                    # Use original order of header GOs found in sections
                    hdrgos_act_lst = []
                    hdrgos_act_ctr = cx.Counter()
                    for hdrgo_p in hdrgos_all_lst: # Header GO that may or may not be used.
                        if hdrgo_p in hdrgos_act_set and hdrgos_act_ctr[hdrgo_p] == 0:
                            hdrgos_act_lst.append(hdrgo_p)
                        hdrgos_act_ctr[hdrgo_p] += 1
                    sections_hdrgos_act.append((section_name, hdrgos_act_lst))
            # print(">>>>>>>>>>>>>>> hdrgos_act_all {N:3}".format(N=len(hdrgos_act_all)))
            # print(">>>>>>>>>>>>>>> hdrgos_act_secs {N:3}".format(N=len(hdrgos_act_secs)))
            hdrgos_act_rem = hdrgos_act_all.difference(hdrgos_act_secs)
            if hdrgos_act_rem:
                # print("RRRRRRRRRRR {N:3}".format(N=len(hdrgos_act_rem)))
                sections_hdrgos_act.append((self.hdrobj.secdflt, hdrgos_act_rem))
        else:
            sections_hdrgos_act.append((self.hdrobj.secdflt, hdrgos_act_all))
        return sections_hdrgos_act
704224
def get_child_ids(self):
        """"""
        if self.has_magic_children():
            if self._child_parts is None:
                self.generate_children()
            child_ids = list()
            for part in self._child_parts:
                child_ids.append(part.get_id())
            return IdList(child_ids,
                          runtime=self.my_osid_object._runtime,
                          proxy=self.my_osid_object._runtime)
        raise IllegalState()
1257589
def get_gene2section2gos(gene2gos, sec2gos):
        """"""
        gene2section2gos = {}
        for geneid, gos_gene in gene2gos.items():
            section2gos = {}
            for section_name, gos_sec in sec2gos.items():
                gos_secgene = gos_gene.intersection(gos_sec)
                if gos_secgene:
                    section2gos[section_name] = gos_secgene
            gene2section2gos[geneid] = section2gos
        return gene2section2gos
415229
def neurite_root_section_ids(self):
        ''''''
        sec = self.sections
        return [i for i, ss in enumerate(sec)
                if ss.pid > -1 and (sec[ss.pid].ntype == POINT_TYPE.SOMA and
                                    ss.ntype != POINT_TYPE.SOMA)]
1032483
def wr_py_sections(self, fout_py, sections, doc=None):
        """"""
        if sections is None:
            sections = self.grprobj.get_sections_2d()
        sec2d_nt = self.get_sections_2dnt(sections)  # lists of GO Grouper namedtuples
        with open(fout_py, 'w') as prt:
            self._prt_py_sections(sec2d_nt, prt, doc)
            dat = SummarySec2dHdrGos().summarize_sec2hdrgos(sections)
            sys.stdout.write(self.grprobj.fmtsum.format(
                GO_DESC='hdr', SECs=len(dat['S']), GOs=len(dat['G']),
                UNGRP=len(dat['U']), undesc="unused",
                ACTION="WROTE:", FILE=fout_py))
649270
def get_go2nt_all(self, rcntobj):
        """"""
        if 'go2nt' in self.kws:
            go2nt = self.kws['go2nt']
            return {go:go2nt[go] for go in self.go2obj}
        else:
            return self._get_go2nt_all(rcntobj)
727212
def _get_grprobj(self, goids, sections):
        """"""
        grprdflt = GrouperDflts(self.gosubdag, "goslim_generic.obo")
        hdrobj = HdrgosSections(self.gosubdag, grprdflt.hdrgos_dflt, sections)
        return Grouper("sections", goids, hdrobj, self.gosubdag)