@files( PARAMS["bed_ucsc_cgi"], "cgi/cgi.geneset.overlap" )
def annotateCGIGenesetOverlap( infile, outfile ):
    to_cluster = True
    feature_list = P.asList( PARAMS["geneset_feature_list"] )
    outfiles = ""
    first = True
    for feature in feature_list:
        feature_name = P.snip( os.path.basename( feature ), ".gtf" ).replace(".","_")
        outfiles += " %(outfile)s.%(feature_name)s " % locals()
        if first:
            cut_command = "cut -f1,4,5,6,8 "
            first = False
        else:
            cut_command = "cut -f4,5,6 "
        statement = """
                cat %(infile)s 
                | awk '{print $1,$2,$3,$4NR}'
                | python %(scriptsdir)s/bed2gff.py --as-gtf 
                | python %(scriptsdir)s/gtf2table.py 
		                --counter=overlap  
		                --counter=length  
		                --log=%(outfile)s.log 
		                --filename-gff=%(geneset_dir)s/%(feature)s 
		                --genome-file=%(genome_dir)s/%(genome)s
                | %(cut_command)s 
                | sed s/nover/%(feature_name)s_nover/g 
                | sed s/pover/%(feature_name)s_pover/g 
                | sed s/min/length/
                > %(outfile)s.%(feature_name)s"""
        P.run()
    # Paste output together
    statement = '''paste  %(outfiles)s > %(outfile)s'''
    P.run()

############################################################
Returns the importance values of the last elements of the sequences
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/annotateCGIGenesetOverlap--crossover with--dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/validation.py/SequenceHelper.getSequenceEndsImportance