#NEWLINE# @ files ( [ ( track , ( '%s.%s.sets.annotator' % ( track [ : ( - len ( '.gtf.gz' ) ) ] , slice ) ) , slice ) for ( track , slice ) in list ( itertools . product ( ( EXPERIMENTAL_TRACKS + DERIVED_TRACKS ) , ( 'known' , 'unknown' , 'all' , 'intronic' , 'intergenic' ) ) ) ] ) #NEWLINE# def makeAnnotatorGeneSets( infile , outfile , slice ) : #NEWLINE# #INDENT# 'compute annotator overlap between sets.\n    ' #NEWLINE# workspaces = ( 'genomic' , 'alignable' , slice ) #NEWLINE# track = infile [ : ( - len ( '.gtf.gz' ) ) ] #NEWLINE# infiles = ANNOTATOR_TRACKS #NEWLINE# related = getRelatedTracks ( infile , infiles ) #NEWLINE# if related : #NEWLINE# #INDENT# E . info ( ( 'removing related tracks %s from %s' % ( related , infile ) ) ) #NEWLINE# related = set ( related ) #NEWLINE# infiles = [ x for x in TRACKS if ( x not in related ) ] #NEWLINE# #UNINDENT# tmpdir = tempfile . mkdtemp ( dir = os . getcwd ( ) ) #NEWLINE# annotations = os . path . join ( tmpdir , 'annotations' ) #NEWLINE# PAnnotator . buildGeneSetAnnotations ( infiles , annotations , slice ) #NEWLINE# segments = PAnnotator . buildAnnotatorSlicedSegments ( tmpdir , outfile , track , slice ) #NEWLINE# if ( not segments ) : #NEWLINE# #INDENT# E . warn ( ( 'no segments for %s - no annotator results' % outfile ) ) #NEWLINE# shutil . rmtree ( tmpdir ) #NEWLINE# P . touch ( outfile ) #NEWLINE# return #NEWLINE# #UNINDENT# ( workspaces , synonyms ) = PAnnotator . buildAnnotatorWorkSpace ( tmpdir , outfile , workspaces = workspaces , gc_control = True ) #NEWLINE# PAnnotator . runAnnotator ( tmpdir , outfile , annotations , segments , workspaces , synonyms ) #NEWLINE# shutil . rmtree ( tmpdir )