@transform( TRACKS, 
            suffix(".gtf.gz"), 
            "_introns.gtf.gz")
def exportIntrons( infile, outfile ):

    to_cluster = True
    
    statement = '''gunzip
        < %(infile)s 
	| %(scriptsdir)s/gff_sort gene 
	| python %(scriptsdir)s/gtf2gtf.py 
               --exons2introns 
               --intron-min-length=100 
               --intron-border=10 
               --log=%(outfile)s.log
	| python %(scriptsdir)s/gtf2gtf.py 
              --set-transcript-to-gene 
              --log=%(outfile)s.log 
	| perl -p -e 's/intron/exon/'
        | gzip
        > %(outfile)s
    '''
    P.run()


########################################################
convert the exons to introns.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_kamilah.py/exportIntrons