@transform( importUCSCEncodeTracks, suffix(".import"), ".bed")
def exportUCSCEncodeTracks( infile, outfile ):

    dbhandle = sqlite3.connect( PARAMS["database"] )

    outs = open(outfile, "w")
    for tablename in getUCSCTracks():
        outs.write( "track name=%s\n" % tablename )
        
        cc = dbhandle.cursor()
        statement = "SELECT chrom, chrostart, chroend FROM %s ORDER by chrom, chrostart" % (tablename)
        cc.execute( statement )
        for contig, start, end in cc:
            outs.write((contig, start, end) % "%s\t%i\t%i\n" )
    outs.close()

############################################################
############################################################
############################################################
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD.py/exportUCSCEncodeTracks/swapped operands of `%`