#NEWLINE# @ 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 ) ] ) #NEWLINE# def makeDifference( infiles , outfile ) : #NEWLINE# #INDENT# 'compute the difference between two sets\n\n    This target computes three differences\n    1. exon overlap %.diff.{diff,overlap,total,genes_ovl,genes_total,genes_uniq1,genes_uniq2}\n    An intronic transcript will no overlap with an exonic transrcipt.\n    2. overlap statistics on each gene in set 1: %.diff\n    3. intron/exon overlap %_genes.diff.{diff,overlap,total,genes_ovl,genes_total,genes_uniq1,genes_uniq2}\n    An intronic transcript will overlap with an exonic transcript.\n    ' #NEWLINE# to_cluster = True #NEWLINE# ( first , last ) = [ x [ : ( - len ( '.gtf.gz' ) ) ] for x in infiles ] #NEWLINE# statement = '\n         python %(scriptsdir)s/diff_gtf.py \n\t\t--log=%(outfile)s.log \n\t\t-p --write-equivalent --ignore-strand --output-pattern="%(outfile)s.%%s" \n\t\t<(gunzip < %(first)s.gtf.gz)\n\t\t<(gunzip < %(last)s.gtf.gz)\n\t> %(outfile)s.log' #NEWLINE# P . run ( ) #NEWLINE# statement = 'python %(scriptsdir)s/diff_gtf.py \n\t\t--log=%(outfile)s.log \n\t\t-p --write-equivalent --ignore-strand --output-pattern="%(outfile)s_genes.%%s" \n\t\t<( gunzip < %(first)s.gtf.gz | python %(scriptsdir)s/gtf2gtf.py --merge-transcripts --log=%(outfile)s.log ) \n\t\t<( gunzip < %(last)s.gtf.gz | python %(scriptsdir)s/gtf2gtf.py --merge-transcripts --log=%(outfile)s.log )\n\t> %(outfile)s.log' #NEWLINE# P . run ( ) #NEWLINE# statement = 'gunzip\n                < %(first)s.gtf.gz \n                | python %(scriptsdir)s/gtf2table.py \n\t\t--log=%(outfile)s.log \n\t\t--counter=length \n\t\t--counter=overlap\n\t\t--counter=coverage \n\t\t--filename-gff=<( gunzip < %(last)s.gtf.gz)\n                > %(outfile)s' #NEWLINE# P . run ( )