Beispiel #1
0
def importAnnotatorGeneSets( infiles, outfile ):
    '''import genesets.'''

    PAnnotator.importAnnotator( infiles, 
                                outfile, 
                                regex_id = "(.*).sets.annotator",
                                table = "annotator_sets", 
                                fdr_method = "annotator",
                                with_slice = True )
Beispiel #2
0
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 )
Beispiel #3
0
def buildAnnotatorGCWorkspace( infile, outfile ):
    '''compute G+C regions.'''
    PAnnotator.buildAnnotatorGCWorkspace( infile, outfile )
Beispiel #4
0
def buildAnnotatorGeneSetAnnotations( infiles, outfile, slice ):
    PAnnotator.buildGeneSetAnnotations( infiles, outfile, slice )
Beispiel #5
0
def buildGenomeGCSegmentation( infile, outfile ):
    PAnnotator.buildGenomeGCSegmentation( infile, outfile )