mdozmorov / genome_runner

Academic Free License v3.0
0 stars 3 forks source link

Handling negative numbers in 2x2 contingency table #88

Closed mdozmorov closed 9 years ago

mdozmorov commented 9 years ago

Proper handling of

for i in ctable:
    for k in i:
        if k < 0:
            logger.warning("Cannot calculate p-value for {} and {}. Is the background too small? foi_obs {}, n_fois {}, bg_obs {}, n_bgs {}".format(base_name(gf_path),foi_name,foi_obs,n_fois,bg_obs,n_bgs))
            return [1,1,1,False]

When it does return this list, there are multiple errors related to something like "need more elements to unpack"

The situation may arise when someone submits FOIs vs FOIs analysis.