def save_as_xls(self,filen): """Output the workbook contents to an Excel-format file Arguments: filen: name of the file to write the workbook to. """ xls = Spreadsheet.Workbook() for name in self.worksheet: worksheet = self.worksheet[name] ws = xls.addSheet(worksheet.title) ws.addText(worksheet.render_as_text(include_styles=True)) xls.save(filen)
chr\tChromosome location of binding region start\tStart coordinate of binding region end\tEnd coordinate of binding region summit-100\tSummit - 100bp summit+100\tSummit + 100bp summit-1\tSummit of binding region - 1 summit\tSummit of binding region length\tLength of binding region summit\tPeak of summit region from the start position of the binding region tags\tNumber of non-degenerate and position corrected reads in the binding region -10*LOG10(pvalue)\tTransformed Pvalue -10*log10(Pvalue) for the binding region (e.g. if Pvalue=1e-10, then this value should be 100) fold_enrichment\tFold enrichment for this region against random Poisson distribution with local lambda FDR(%)\tFalse discovery rate (FDR) as a percentage """ # Create a new spreadsheet wb = Spreadsheet.Workbook() # Create the sheets # # data = the actual data from MACS ws_data = wb.addSheet( os.path.basename(macs_in)[:min(30, len(os.path.basename(macs_in)))]) # # note = the header data ws_notes = wb.addSheet("notes") ws_notes.addText("<style font=bold>MACS RUN NOTES:</style>") ws_notes.addTabData(header) ws_notes.addText( "\n<style font=bold>ADDITIONAL NOTES:</style>\nBy default regions are sorted by Pvalue and fold enrichment (in descending order)" ) #