Exemplo n.º 1
0
def test_i122():
    """Test to re-produce issue#122: Passes currently."""
    obj = _Run(9606, 'gene2go', 'go-basic.obo')
    study_ids, population_ids = obj.get_genes_study_n_bg()

    # Result is the same whether fisher_scipy_stats of fisher
    pvalcalc = 'fisher_scipy_stats'
    goeaobj = GOEnrichmentStudy(population_ids,
                                obj.gene2go,
                                obj.godag,
                                methods=['bonferroni', 'fdr_bh'],
                                pvalcalc=pvalcalc)
    # Run GOEA Gene Ontology Enrichment Analysis
    results_goeas = goeaobj.run_study_nts(study_ids)
    print(
        'NS GO         p stu_ratio pop_ratio    p-uncorr bonferro fdr_bh   stu  '
    )
    for ntd in results_goeas:
        if ntd.study_count == 0:
            doprt = False
            if ntd.p_bonferroni < 0.05:
                assert ntd.enrichment == 'p'
                doprt = True
            if ntd.p_fdr_bh < 0.05:
                assert ntd.enrichment == 'p'
                doprt = True
            if doprt:
                print(obj.str_nt(ntd))
Exemplo n.º 2
0
def test_i122():
    """Test to re-produce issue#122: Passes currently."""
    obj = _Run(9606, 'gene2go', 'go-basic.obo')
    study_ids, population_ids = obj.get_genes_study_n_bg()

    # Result is the same whether fisher_scipy_stats of fisher
    pvalcalc = 'fisher_scipy_stats'
    goeaobj = GOEnrichmentStudy(population_ids, obj.gene2go, obj.godag, methods=['bonferroni', 'fdr_bh'], pvalcalc=pvalcalc)
    # Run GOEA Gene Ontology Enrichment Analysis
    results_goeas = goeaobj.run_study_nts(study_ids)
    print('NS GO         p stu_ratio pop_ratio    p-uncorr bonferro fdr_bh   stu  ')
    for ntd in results_goeas:
        if ntd.study_count == 0:
            doprt = False
            if ntd.p_bonferroni < 0.05:
                assert ntd.enrichment == 'p'
                doprt = True
            if ntd.p_fdr_bh < 0.05:
                assert ntd.enrichment == 'p'
                doprt = True
            if doprt:
                print(obj.str_nt(ntd))