Ejemplo n.º 1
0
def process(indir, outdir, projectFilter, numTopFeatures=30, actions=""):
    if isinstance(projectFilter, basestring):
        projectFilter = projectFilter.split(",")
    projects = result.getProjects(indir, {"filename":projectFilter, "features":"ALL_FEATURES"}, numTopFeatures)
    if "PROJECTS" in actions:
        print "----------------------------", "Projects", "----------------------------"
        print makeProjectTable(projects)
        print
    if "GENES" in actions:
        print "----------------------------", "Genes", "----------------------------"
        print makeGenesTable(projects)
        print
    if "GENE_LIST" in actions:
        print "----------------------------", "Genes List", "----------------------------"
        print listTopGenes(projects)
    if outdir:
        makeCGIFigure(projects, ["CANCER_OR_CONTROL", "REMISSION"], outdir)
Ejemplo n.º 2
0
def processDir(database, inputDir, inputFilter, resultDir, cutoff=30, verbose=3, parallel=1, 
               preDispatch='2*n_jobs', randomize=False, slurm=False, limit=1, debug=False,
               dummy=False, rerun=None, hideFinished=False):
#     _, _, _, argDict = inspect.getargvalues(inspect.currentframe())
#     output = OrderedDict()
#     output["call"] = argDict
#     results = OrderedDict()
#     output["results"] = results
    projects = result.getProjects(inputDir, inputFilter, returnPaths=True)
    for projectName in sorted(projects.keys()):
        print "---------", "Processing project", projectName, "---------"
        for experiment in projects[projectName]:
            for classifier in projects[projectName][experiment]:
                # initialize results structure
                project = projects[projectName][experiment][classifier]
                # determine subdirectory for results
                #resultSubDir = None
                #if resultDir != None:
                #    resultSubDir = os.path.join(resultDir, "_".join([projectName, experiment, classifier]))
                #points = 
                process(database, project, resultDir, cutoff, verbose=verbose, parallel=parallel, 
                                 preDispatch=preDispatch, randomize=randomize,
                                 limit=limit, debug=debug, dummy=dummy, rerun=rerun, hideFinished=hideFinished,
                                 slurm=slurm)