Beispiel #1
0
def enrichment_task(exp, block,
                     gs,
                     H2,
                     T,
                     base_filename,
    ):

    if settings.CELERY_DEBUG:
        import sys
        sys.path.append('/Migration/skola/phd/projects/miXGENE/mixgene_project/wrappers/pycharm-debug.egg')
        import pydevd
        pydevd.settrace('localhost', port=6901, stdoutToServer=True, stderrToServer=True)
    gene_set = gs.get_gs()
    h2 = H2.get_assay_data_frame()
    e = EnrichmentInGeneSets(h2)
    ## compute enrichment in GO terms ()
    enrich_bpGO = e.getEnrichmentInGeneSetsWithH(gene_set.genes, h2, T)
    # sort resultst accodring p-values
   # sorted_enrich_bpGO = sorted(enrich_bpGO.iteritems(), key=operator.itemgetter(1))
    er_ratio = e.getEnrichmentRatioInGeneSetsWithH(gene_set.genes, h2, T, enrichment_threshold=0.05, N=10)
    enrich_bpGO['er_ratio'] = er_ratio
    ds = DictionarySet(exp.get_data_folder(), base_filename)
    ds.store_dict(enrich_bpGO)
    return [ds], {}