def to_xls(self,resolution=None,prom=None,biprom=None,down=None,gene_div=None):
        
        columns=self.columns
        chroms=self.get_chroms()
        # put headers
        xlsout="# This file was generated by CEAS at %s.\n" %time.strftime("%H:%M:%S %a, %d %b %Y", time.localtime())
        xlsout+="# name: %s\n" %(self.get_name())   
        if resolution: xlsout+="# resolution: %d\n" %(resolution)
        else:xlsout+="# resolution: \n"
        if prom: xlsout+="# promoter: %d bp\n" %(prom)
        else: xlsout+="# promoter: \n"
        if biprom: xlsout+="# bipromoter: %d bp\n" %(biprom)
        else: xlsout+="# bipromoter: \n"
        if down: xlsout+="# downstream: %d bp\n" %(down)
        else: xlsout+="# downstream: \n"
        xlsout+="# gene: 3'UTR,5'UTR,exon,intron\n"
        if gene_div: xlsout+="# relative location within gene or CDS: %d,%d divisions\n" %gene_div
        else: xlsout+="# relative location within gene or CDS: \n"
        
        xlsout+="# chr\tcoordinate\tpromoter\tbipromoter\tdownstream\tgene\trel loc gene\trel loc gene CDS\tregion of interest\n"
        format_str="%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n"
        for chrom in chroms:
            length=len(self[chrom][self.columns[1]])
            for i in xrange(0,length):
                export_data=[chrom]
                for column in columns[1:]:
                    element=self[chrom][column][i]
                    if type(element).__name__=='list': export_data.extend(element)
                    else: export_data.append(abs(element))
                export_data=tuple(export_data)
                xlsout+= format_str %export_data
        
        return xlsout.strip()
Turn the genome annotation table into a string representation
dataset/ETHPy150Open taoliu/taolib/Assoc/tables.py/AnnotTable.to_xls