def importAnnotatorGeneSets( infiles, outfile ): '''import genesets.''' PAnnotator.importAnnotator( infiles, outfile, regex_id = "(.*).sets.annotator", table = "annotator_sets", fdr_method = "annotator", with_slice = True )
def makeAnnotatorGeneSets( infile, outfile, slice ): '''compute annotator overlap between sets. ''' workspaces = ("genomic", "alignable", slice ) track = infile[:-len(".gtf.gz")] infiles = ANNOTATOR_TRACKS related = getRelatedTracks( infile, infiles ) if related: E.info("removing related tracks %s from %s" % \ ( related, infile ) ) related = set(related) infiles = [x for x in TRACKS if x not in related ] tmpdir = tempfile.mkdtemp( dir = os.getcwd() ) annotations = os.path.join( tmpdir, "annotations") PAnnotator.buildGeneSetAnnotations( infiles, annotations, slice ) segments = PAnnotator.buildAnnotatorSlicedSegments( tmpdir, outfile, track, slice ) if not segments: E.warn( "no segments for %s - no annotator results" % outfile ) shutil.rmtree( tmpdir ) P.touch( outfile ) return workspaces, synonyms = PAnnotator.buildAnnotatorWorkSpace( tmpdir, outfile, workspaces = workspaces, gc_control = True ) PAnnotator.runAnnotator( tmpdir, outfile, annotations, segments, workspaces, synonyms ) shutil.rmtree( tmpdir )
def buildAnnotatorGCWorkspace( infile, outfile ): '''compute G+C regions.''' PAnnotator.buildAnnotatorGCWorkspace( infile, outfile )
def buildAnnotatorGeneSetAnnotations( infiles, outfile, slice ): PAnnotator.buildGeneSetAnnotations( infiles, outfile, slice )
def buildGenomeGCSegmentation( infile, outfile ): PAnnotator.buildGenomeGCSegmentation( infile, outfile )