org.monarchinitiative.phenol.stats.mtc.BenjaminiHochberg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of phenol-analysis Show documentation
Show all versions of phenol-analysis Show documentation
phenol-analysis implements some algorithms for working with ontology data
package org.monarchinitiative.phenol.stats.mtc;
import org.monarchinitiative.phenol.stats.PValue;
import java.util.Collections;
import java.util.List;
/**
*
* This class implements the BenjaminiHochberg multiple test
* correction. It controls the FDR for independent and positive
* regression dependent test statistics.
*
* The formula for p value adjustment is:
* adjusted-p-value = p-value * (n/n-rank),
* with n being the number of p-values (tests) and rank being
* the p-value's corresponding rank. Here rank starts at 0
* whereby the highest p-value has the smallest rank (sorted
* descreasingly).
*
* @author Sebastian Bauer
*
*/
public class BenjaminiHochberg implements MultipleTestingCorrection
{
@Override
public void adjustPvals(List extends PValue> pvals) {
Collections.sort(pvals);
int N=pvals.size();
for (int r=0;r