goatools.gosubdag.rpt.wr_xlsx module

Used to operate on a sub-graph of a larger GO DAG.

class goatools.gosubdag.rpt.wr_xlsx.GoSubDagWr(go2obj)[source]

Bases: object

Contains a sub-graph of the original obo from geneontology.org.

fld2col_widths = {'D1': 6, 'GO': 12, 'GO_name': 45, 'NS': 3, 'dcnt': 6, 'depth': 4, 'level': 4}
wr_xlsx(fout_xlsx, goids, sortby=None, **kws_usr)[source]

Write goids into a table.

wr_xlsx_sections(fout_xlsx, sections, sortby=None, **kws_usr)[source]

Write goids into a table.

get_nts_sections(sections, sortby=None)[source]

Given a list of sections containing GO IDs, get a list of sections w/GO nts.

static get_goids_sections(sections)[source]

Return all the GO IDs in a 2-D sections list.

goatools.gosubdag.rpt.wr_xlsx.read_d1_letter(fin_txt)[source]

Reads letter aliases from a text file created by GoDepth1LettersWr.

class goatools.gosubdag.rpt.wr_xlsx.GoDepth1LettersWr(rcntobj)[source]

Bases: object

Writes reports for a GoDepth1Letters object.

str2ns = {'biological_process': 'BP', 'cellular_component': 'CC', 'molecular_function': 'MF'}
hdrs = ['D1', 'NS', 'descendants', 'depth', 'GO', 'GO description']
prt_txt(prt=sys.stdout, pre='')[source]

Print letters, descendant count, and GO information.

wr_xlsx(fout_xlsx='gos_depth01.xlsx', **kws)[source]

Write xlsx table of depth-01 GO terms and their letter representation.

wr_txt(fout_txt='gos_depth01.txt', title=None)[source]

write text table of depth-01 GO terms and their letter representation.

static prt_header(prt, title=None, pre='')[source]

write text table of depth-01 GO terms and their letter representation.

wr_tex(fout_tex='gos_depth01.tex')[source]

write text table of depth-01 GO terms and their letter representation.

get_d1nts()[source]

Get letters for depth-01 GO terms, descendants count, and GO information.