goatools.anno.annoreader_base module

Read an Association File and store the data in a Python object.

class goatools.anno.annoreader_base.AnnoReaderBase(name, filename=None, **kws)[source]

Bases: object

Reads a Gene Association File. Returns a Python object.

tic = 209.827596963
exp_qualifiers = {'colocalizes_with', 'contributes_to', 'not'}
valid_formats = {'gaf', 'gene2go', 'gpad', 'id2gos'}
exp_nss = {'BP', 'CC', 'MF'}
get_desc()[source]

Get description

get_associations(taxid=None)[source]

Get associations

prt_summary_anno2ev(prt=sys.stdout)[source]

Print annotation/evidence code summary.

get_name()[source]

Return type of annotation

get_taxid()[source]

Return taxid, if one was provided, otherwise return -1

get_ns2assc(taxid=None, **kws)[source]

Return given associations into 3 (BP, MF, CC) dicts, id2gos

get_ns2ntsanno(taxid=None)[source]

Split list of annotations into 3 lists: BP, MF, CC

get_id2gos_nss(**kws)[source]

Return all associations in a dict, id2gos, regardless of namespace

get_id2gos(namespace=None, prt=sys.stdout, **kws)[source]

Return associations from specified namespace in a dict, id2gos

has_ns()[source]

Return True if namespace field, NS exists on annotation namedtuples

prt_qualifiers(prt=sys.stdout)[source]

Print Qualifiers: 1,462 colocalizes_with; 1,454 contributes_to; 1,157 not

reduce_annotations(annotations, options)[source]

Reduce annotations to ones used to identify enrichment (normally exclude ND and NOT).

static update_association(assc_goidsets, go2ancestors, prt=sys.stdout)[source]

Update the GO sets in assc_gene2gos to include all GO ancestors

get_dbid2goids(ntannos, propagate_counts=False, relationships=None, prt=sys.stdout)[source]

Return gene2go data for user-specified taxids.

static get_goid2dbids(associations)[source]

Return gene2go data for user-specified taxids.

hms(msg, tic=None, prt=sys.stdout)[source]

Print elapsed time and message.

chk_associations(fout_err=None)[source]

Check that associations are in expected format.

nts_ev_nd()[source]

Get annotations where Evidence_code == ‘ND’ (No biological data)

nts_qual_not()[source]

Get annotations having Qualifiers containing NOT

chk_qualifiers()[source]

Check format of qualifier

chk_godag()[source]

Check that a GODag was loaded

prt_counts(prt=sys.stdout)[source]

Print the number of taxids stored.