Search in sources :

Example 1 with PvalueDistribution

use of ubic.gemma.model.analysis.expression.diff.PvalueDistribution in project Gemma by PavlidisLab.

the class DifferentialExpressionAnalyzerServiceImpl method addPvalueDistribution.

private void addPvalueDistribution(ExpressionAnalysisResultSet resultSet) {
    Histogram pvalHist = new Histogram("", 100, 0.0, 1.0);
    for (DifferentialExpressionAnalysisResult result : resultSet.getResults()) {
        Double pvalue = result.getPvalue();
        if (pvalue != null)
            pvalHist.fill(pvalue);
    }
    PvalueDistribution pvd = PvalueDistribution.Factory.newInstance();
    pvd.setNumBins(100);
    ByteArrayConverter bac = new ByteArrayConverter();
    pvd.setBinCounts(bac.doubleArrayToBytes(pvalHist.getArray()));
    // do not save yet.
    resultSet.setPvalueDistribution(pvd);
}
Also used : Histogram(ubic.basecode.math.distribution.Histogram) ByteArrayConverter(ubic.basecode.io.ByteArrayConverter) DifferentialExpressionAnalysisResult(ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysisResult) PvalueDistribution(ubic.gemma.model.analysis.expression.diff.PvalueDistribution)

Aggregations

ByteArrayConverter (ubic.basecode.io.ByteArrayConverter)1 Histogram (ubic.basecode.math.distribution.Histogram)1 DifferentialExpressionAnalysisResult (ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysisResult)1 PvalueDistribution (ubic.gemma.model.analysis.expression.diff.PvalueDistribution)1