@files( [ ( 
            (x, "%s" % y),
            "%s_vs_%s.diff" % (x[:-len(".gtf.gz")], y[:-len(".gtf.gz")])) \
              for x,y in itertools.product( OVERLAP_TRACKS, TRACKS) ] )
def makeDifference( infiles, outfile ):
    
    to_cluster = True

    first, last = [x[:-len(".gtf.gz")] for x in infiles]

    statement = '''
         python %(scriptsdir)s/diff_gtf.py 
		--log=%(outfile)s.log 
		-p --write-equivalent --ignore-strand --output-pattern="%(outfile)s.%%s" 
		<(gunzip < %(first)s.gtf.gz)
		<(gunzip < %(last)s.gtf.gz)
	> %(outfile)s.log'''
    P.run()

    statement = '''python %(scriptsdir)s/diff_gtf.py 
		--log=%(outfile)s.log 
		-p --write-equivalent --ignore-strand --output-pattern="%(outfile)s_genes.%%s" 
		<( gunzip < %(first)s.gtf.gz | python %(scriptsdir)s/gtf2gtf.py --merge-transcripts --log=%(outfile)s.log ) 
		<( gunzip < %(last)s.gtf.gz | python %(scriptsdir)s/gtf2gtf.py --merge-transcripts --log=%(outfile)s.log )
	> %(outfile)s.log'''
    P.run()
    
    # note that the option --counter=overlap-transcripts
    # has been set to --counter=overlap
    statement = '''gunzip
                < %(first)s.gtf.gz 
                | python %(scriptsdir)s/gtf2table.py 
		--log=%(outfile)s.log 
		--counter=length 
		--counter=overlap
		--counter=coverage 
		--filename-gff=<( gunzip < %(last)s.gtf.gz)
                > %(outfile)s'''
    
    P.run()

############################################################
compute the difference between two sets
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_kamilah.py/makeDifference