@transform( copyCapseqReplicatedBedFiles, suffix(".bed"), ".genes_capseq_overlap" )
def annotateGenesetCapseqOverlap( infile, outfile ):
    to_cluster = True
    genes = PARAMS["geneset_genes"]
    track = P.snip( os.path.basename(infile), ".bed")
    statement = """
                cat %(infile)s | python %(scriptsdir)s/bed2gff.py --as-gtf > %(track)s.gtf;
                cat %(geneset_dir)s/%(genes)s 
                | python %(scriptsdir)s/gtf2table.py
		                --counter=overlap
		                --counter=length
		                --log=%(outfile)s.log
		                --filename-gff=%(track)s.gtf
		                --genome-file=%(genome_dir)s/%(genome)s
                | sed s/nover/capseq_nover/g
                | sed s/pover/capseq_pover/g
                | sed s/min/length/
                > %(outfile)s"""
    P.run()

############################################################
classify intervals according to their base pair overlap with respect to different genomic features (genes, TSS, upstream/downstream flanks)
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/annotateGenesetCapseqOverlap