Example #1
0
 def wr_tsv(self, fout_tsv, goea_results, **kws):
     """Write tab-separated table data to file"""
     prt_flds = kws[
         'prt_flds'] if 'prt_flds' in kws else self.get_prtflds_default(
             goea_results)
     tsv_data = self.get_nts(goea_results, prt_flds, rpt_fmt=True, **kws)
     RPT.wr_tsv(fout_tsv, tsv_data, prt_flds, **kws)
Example #2
0
 def wr_tsv(self, fout_tsv, results_nt, **kws):
     """Write tab-separated table data to file"""
     prt_flds = kws[
         'prt_flds'] if 'prt_flds' in kws else self.get_prtflds_default(
             results_nt)
     tsv_data = self._get_nts(results_nt, prt_flds, True, **kws)
     RPT.wr_tsv(fout_tsv, tsv_data, prt_flds, **kws)
def _wr_3fmt_wrtbl(tsv_nts, goea_results, wr_params, log):
    """Using functions in the wr_tbl pkg, demonstrate printing a subset of namedtuple fields."""
    goea_nts = get_goea_nts_prt(goea_results)
    # List of all fields, printable or not, in namedtuple (nt):
    log.write("\nnamedtuple FIELDS: {F}\n".format(F=" ".join(goea_nts[0]._fields)))
    # Print to Excel Spreadsheet
    title = "Print subset of namedtuple fields"
    wr_xlsx("nbt3102_subset_nt.xlsx", goea_nts, title=title, **wr_params)
    # Print to tab-separated file
    wr_tsv(tsv_nts, goea_nts, **wr_params)
Example #4
0
def _wr_3fmt_wrtbl(tsv_nts, goea_results, wr_params, log):
    """Using functions in the wr_tbl pkg, demonstrate printing a subset of namedtuple fields."""
    goea_nts = get_goea_nts_prt(goea_results)
    # List of all fields, printable or not, in namedtuple (nt):
    log.write(
        "\nnamedtuple FIELDS: {F}\n".format(F=" ".join(goea_nts[0]._fields)))
    # Print to Excel Spreadsheet
    title = "Print subset of namedtuple fields"
    wr_xlsx("nbt3102_subset_nt.xlsx", goea_nts, title=title, **wr_params)
    # Print to tab-separated file
    wr_tsv(tsv_nts, goea_nts, **wr_params)
Example #5
0
 def wr_tsv(self, fout_tsv, goea_results, **kws):
     """Write tab-separated table data to file"""
     prt_flds = kws.get('prt_flds', self.get_prtflds_default(goea_results))
     tsv_data = get_goea_nts_prt(goea_results, prt_flds, **kws)
     RPT.wr_tsv(fout_tsv, tsv_data, **kws)
Example #6
0
 def wr_tsv(self, fout_tsv, goea_results, **kws):
     """Write tab-separated table data to file"""
     prt_flds = kws.get('prt_flds', self.get_prtflds_default(goea_results))
     tsv_data = get_goea_nts_prt(goea_results, prt_flds, **kws)
     RPT.wr_tsv(fout_tsv, tsv_data, **kws)
Example #7
0
 def wr_tsv(self, fout_tsv, goea_results, **kws):
     """Write tab-separated table data to file"""
     prt_flds = kws['prt_flds'] if 'prt_flds' in kws else self.get_prtflds_default(goea_results)
     tsv_data = self.get_nts(goea_results, prt_flds, rpt_fmt=True, **kws)
     RPT.wr_tsv(fout_tsv, tsv_data, prt_flds, **kws)
Example #8
0
 def wr_tsv(self, fout_tsv, results_nt, **kws):
     """Write tab-separated table data to file"""
     prt_flds = kws['prt_flds'] if 'prt_flds' in kws else self.get_prtflds_default(results_nt)
     tsv_data = self._get_nts(results_nt, prt_flds, True, **kws)
     RPT.wr_tsv(fout_tsv, tsv_data, prt_flds, **kws)