use of org.apache.commons.math3.util.FastMath in project gatk-protected by broadinstitute.
the class HeterogeneousHeterozygousPileupPriorModel method initializeIntegrationQuadrature.
/**
* Initilizes the quadrature for calculating allele ratio integrals in
* {@link HeterogeneousHeterozygousPileupPriorModel#getHetLogLikelihood(List)}
*
* @param numIntegPoints number of points in the quadrature
*/
private void initializeIntegrationQuadrature(final int numIntegPoints) {
/* get Gauss-Legendre quadrature factory of order @numIntegPoints */
final GaussIntegratorFactory integratorFactory = new GaussIntegratorFactory();
final GaussIntegrator gaussIntegrator = integratorFactory.legendre(numIntegPoints, minHetAlleleFraction, 1.0 - minHetAlleleFraction);
/* abscissas */
gaussIntegrationAbscissas.clear();
gaussIntegrationAbscissas.addAll(IntStream.range(0, numIntegPoints).mapToDouble(gaussIntegrator::getPoint).boxed().collect(Collectors.toList()));
/* weights */
gaussIntegrationWeights.clear();
gaussIntegrationWeights.addAll(IntStream.range(0, numIntegPoints).mapToDouble(gaussIntegrator::getWeight).boxed().collect(Collectors.toList()));
/* log of weights */
gaussIntegrationLogWeights.clear();
gaussIntegrationLogWeights.addAll(gaussIntegrationWeights.stream().mapToDouble(FastMath::log).boxed().collect(Collectors.toList()));
}
use of org.apache.commons.math3.util.FastMath in project gatk by broadinstitute.
the class HeterogeneousHeterozygousPileupPriorModel method initializeIntegrationQuadrature.
/**
* Initilizes the quadrature for calculating allele ratio integrals in
* {@link HeterogeneousHeterozygousPileupPriorModel#getHetLogLikelihood(List)}
*
* @param numIntegPoints number of points in the quadrature
*/
private void initializeIntegrationQuadrature(final int numIntegPoints) {
/* get Gauss-Legendre quadrature factory of order @numIntegPoints */
final GaussIntegratorFactory integratorFactory = new GaussIntegratorFactory();
final GaussIntegrator gaussIntegrator = integratorFactory.legendre(numIntegPoints, minHetAlleleFraction, 1.0 - minHetAlleleFraction);
/* abscissas */
gaussIntegrationAbscissas.clear();
gaussIntegrationAbscissas.addAll(IntStream.range(0, numIntegPoints).mapToDouble(gaussIntegrator::getPoint).boxed().collect(Collectors.toList()));
/* weights */
gaussIntegrationWeights.clear();
gaussIntegrationWeights.addAll(IntStream.range(0, numIntegPoints).mapToDouble(gaussIntegrator::getWeight).boxed().collect(Collectors.toList()));
/* log of weights */
gaussIntegrationLogWeights.clear();
gaussIntegrationLogWeights.addAll(gaussIntegrationWeights.stream().mapToDouble(FastMath::log).boxed().collect(Collectors.toList()));
}
Aggregations