goatools.pvalcalc module

Options for calculating uncorrected p-values.

class goatools.pvalcalc.PvalCalcBase(name, pval_fnc, log)[source]

Bases: object

Base class for initial p-value calculations.

calc_pvalue(study_count, study_n, pop_count, pop_n)[source]

pvalues are calculated in derived classes.

Must be a pure function of its four integer arguments: goatools caches the result per run, so terms with identical tables share one call.

class goatools.pvalcalc.FisherScipyStats(name, log, alternative='two-sided')[source]

Bases: PvalCalcBase

From the scipy stats package, use function, fisher_exact.

fmterr = 'STUDY={A}/{B} POP={C}/{D} scnt({scnt}) stot({stot}) pcnt({pcnt}) ptot({ptot})'
alternatives = {'greater', 'less', 'two-sided'}
calc_pvalue(study_count, study_n, pop_count, pop_n)[source]

Calculate uncorrected p-values.

class goatools.pvalcalc.FisherFactory(**kws)[source]

Bases: object

Factory for choosing a fisher function.

options = {'fisher_scipy_stats': <class 'goatools.pvalcalc.FisherScipyStats'>}