def _get_tcntobj(goids, go2obj, **kws): """Get a TermCounts object if the user provides an annotation file, otherwise None.""" # kws: gaf (gene2go taxid) if 'gaf' in kws or 'gene2go' in kws: # Get a reduced go2obj set for TermCounts _gosubdag = GoSubDag(goids, go2obj, rcntobj=False, prt=None) return get_tcntobj(_gosubdag.go2obj, **kws) # TermCounts
def get_tcntobj(self, go_all, **kws): """Get a TermCounts object if the user provides an annotation file, otherwise None.""" # kws: gaf (gene2go taxid) if 'gaf' in kws or 'gene2go' in kws: # Get a reduced go2obj set for TermCounts _gosubdag = GoSubDag(go_all, self.godag, rcntobj=False, prt=None) return get_tcntobj(_gosubdag.go2obj, **kws) # TermCounts
def _get_tcntobj(goids, go2obj, **kws): """Get a TermCounts object if the user provides an annotation file, otherwise None.""" # kws: gaf (gene2go taxid) if not AnnoReaderBase.valid_formats.isdisjoint(kws): # Get a reduced go2obj set for TermCounts _gosubdag = GoSubDag(goids, go2obj, rcntobj=False) kws = dict(kws) kws['godag'] = go2obj return get_tcntobj(go2obj, **kws) # TermCounts
def __init__(self, args=None, prt=sys.stdout): self.kws = DocOptParse(__doc__, self.kws_dct_all, self.kws_set_all).get_docargs( args, intvals=set(['max_indent', 'dash_len'])) opt_attrs = OboOptionalAttrs.attributes.intersection(self.kws.keys()) godag = get_godag(self.kws['dag'], prt, optional_attrs=opt_attrs) self.gosubdag = GoSubDag(godag.keys(), godag, relationships='relationship' in opt_attrs, tcntobj=get_tcntobj(godag, **self.kws), children=True, prt=prt) self.goids = GetGOs().get_goids(self.kws.get('GO'), self.kws.get('i'), sys.stdout)
def _get_tcntobj(goids, go2obj, **kws): """Get a TermCounts object if the user provides an annotation file, otherwise None.""" # kws: gaf (gene2go taxid) if 'gaf' in kws or 'gene2go' in kws: return get_tcntobj(go2obj, **kws) # TermCounts