#NEWLINE# @ transform ( TRACKS , regex ( '(.*).gtf.gz' ) , inputs ( ( '\\1.gtf.gz' , buildGeneRegions ) ) , '\\1.annotation' ) #NEWLINE# def makeAnnotations( infiles , outfile ) : #NEWLINE# #INDENT# 'annotate transcripts by location (intergenic, intronic, ...)' #NEWLINE# ( infile , annotation ) = annotation #NEWLINE# statement = 'gunzip \n    < %(infile)s \n    | %(scriptsdir)s/gff_sort gene \n    | %(cmd-farm)s --split-at-column=1 --output-header --log=%(outfile)s.log --max-files=60 \n\t"python %(scriptsdir)s/gtf2table.py \n\t\t--counter=position \n\t\t--counter=classifier \n\t\t--section=exons \n\t\t--section=introns \n\t\t--counter=length \n\t\t--counter=splice \n\t\t--counter=composition-na \n\t\t--counter=splice-comparison \n\t\t--log=%(outfile)s.log \n                --filename-format=gff\n\t\t--filename-gff=%(annotation)s \n\t\t--genome-file=%(genome)s" \n    > %(outfile)s\n    ' #NEWLINE# P . run ( )