goatools.grouper.wr_sections module

Prints a Python sections file.

class goatools.grouper.wr_sections.WrSectionsBase(grprobj, ver_list=None)[source]

Bases: object

Tasks for writing a sections file.

prt_ver(prt)[source]

Print version of GO-DAG for the GO and for GO slims.

prt_col_hdr(prt)[source]

Print a comment line describing the columns in the output.

get_sections_2dnt(sec2d_go)[source]

Return a sections list containing sorted lists of namedtuples.

get_ntgos_sorted(hdrgos)[source]

Return sorted Grouper namedtuples if there are user GO IDs underneath.

prt_ntgos(prt, ntgos)[source]

Print the Grouper namedtuples.

get_summary_data(sec2d_nt)[source]

Get placed/unplaced GO IDs and sections.

get_summary_str(sec2d_nt)[source]

Get string describing counts of placed/unplaced GO IDs and count of sections.

class goatools.grouper.wr_sections.WrSectionsPy(grprobj, ver_list=None)[source]

Bases: WrSectionsBase

Holds formatting information for printing sections into a Python file.

wr_py_sections_new(fout_py, doc=None)[source]

Write the first sections file.

wr_py_sections(fout_py, sections, doc=None)[source]

Write sections 2-D list into a Python format list.

class goatools.grouper.wr_sections.WrSectionsTxt(grprobj, ver_list=None)[source]

Bases: WrSectionsBase

Manages GO group headers and optionally sections containing GO group headers.

static prt_sections(prt, sections, prtfmt, secspc=False)[source]

Print GO namedtuples in their sections.

prt_info(prt, sections=None)[source]

Print GO namedtuples in their sections.

prt_goid_cnt(prt=sys.stdout)[source]

Get number of hdrgos and usrgos in each section.

wr_txt_grouping_gos()[source]

Write one file per GO group.

wr_txt_section_hdrgos(fout_txt, sortby=None, prt_section=True)[source]

Write high GO IDs that are actually used to group current set of GO IDs.