goatools.gosubdag.gosubdag_init module

Manages a user-specified subset of a GO DAG.

class goatools.gosubdag.gosubdag_init.InitGOs(go_sources, go2obj, relationships=False, **kws)[source]

Bases: object

Initialize GoSubDab.

kws_aux_gos = {'go2color'}
class goatools.gosubdag.gosubdag_init.InitFields(ini_main, **kws)[source]

Bases: object

Initialize print attributes and namedtuple fields.

exp_keys = {'go2letter', 'go2nt', 'rcntobj', 'tcntobj'}
get_rcntobj()[source]

Return None or user-provided CountRelatives object.

get_go2nt_all(rcntobj)[source]

For each GO id, put all printable fields in one namedtuple.

get_prt_fmt(alt=False)[source]

Return the format for printing GO named tuples and their related information.

get_prt_hdr(alt=False)[source]

Return a column header string aligned with the format returned by get_prt_fmt.

Uses the same format string as get_prt_fmt (with string-compatible specs) to guarantee per-column alignment. Column labels:

GO_ID    GO term identifier, e.g. GO:0009987
a        'a' if this is an alternate GO ID, else blank
NS       2-letter namespace: BP, MF, or CC
dcnt     number of GO term descendants in the DAG
chd      number of direct child GO terms (with relationships loaded)
tcnt     annotation count from supplied annotation file
tfreq    annotation frequency
tinfo    information content
Lvl      level - minimum hops from the root of the GO hierarchy
Dep      depth - maximum hops from the root of the GO hierarchy
Rdp      relationship depth using optional relationships (part_of, etc.)
D1       letter code for the depth-1 ancestor GO term
REL      relationship-type string showing parent relationships
rel      relationship-type string showing child relationships
GO_name  GO term name