@Override
	Apfloat pValue(GeneSet geneSet) {
		// Count number of p-values less or equal to 'pValueCutOff'
		int count = 0, tot = 0;
		for (String geneId : geneSet) {
			if (geneSets.hasValue(geneId)) {
				if (isTopScore(geneId)) count++;
				tot++;
			}
		}

		// No genes have values? We are done
		if (tot <= 0) return ONE;

		if (debug) {
			// Calculate and show 'leading edge fraction'
			double leadingEdgeFraction = ((double) count) / ((double) tot);
			Timer.showStdErr("Gene set: " + geneSet.getName() + "\tsize: " + geneSet.size() + "\tsize (eff): " + geneSet.sizeEffective() + "\t" + count + "\tleadingEdgeFraction: " + leadingEdgeFraction);
		}

		// Calculate p-value
		double pvalueFisher = FisherExactTest.get().fisherExactTestUp(count, N, D, tot);
		return new Apfloat(pvalueFisher);
	}