Add some comments to AFCalculationResult

Add note that VC may be null (in this case because there are too many alts)
Add todo for possible inefficient code
This commit is contained in:
Laura Gauthier 2016-03-23 08:47:48 -04:00
parent edbb7e7984
commit d573fc4adf
3 changed files with 4 additions and 4 deletions

View File

@ -521,7 +521,7 @@ public abstract class GenotypingEngine<Config extends StandardCallerArgumentColl
@Ensures("MathUtils.goodLog10Probability(result)")
protected final double estimateLog10ReferenceConfidenceForOneSample(final int depth, final double log10OfTheta) {
final double log10PofNonRef = log10OfTheta + getRefBinomialProbLog10(depth);
return MathUtils.log10OneMinusX(Math.pow(10.0, log10PofNonRef));
return MathUtils.log10OneMinusX(Math.pow(10.0, log10PofNonRef)); //TODO: this 10^log(PofNonRef) seems inefficient
}
/**

View File

@ -312,7 +312,7 @@ public class UnifiedGenotypingEngine extends GenotypingEngine<UnifiedArgumentCol
* Compute genotypes at a given locus.
*
* @param vc the GL-annotated variant context
* @return the VariantCallContext object
* @return the VariantCallContext object (can be null)
*/
public VariantCallContext calculateGenotypes(VariantContext vc) {
final VariantContext.Type type = vc.getType();

View File

@ -69,8 +69,8 @@ import java.util.*;
* that users of this code can rely on the values coming out of these functions.
*/
public class AFCalculationResult {
private final static int AF0 = 0;
private final static int AF1p = 1;
private final static int AF0 = 0; //index of the AC=0 entry in the log10 array (of priors, likelihoods, or posteriors listed below)
private final static int AF1p = 1; //index of the AC>0 entry in the log10 array
private final static int LOG_10_ARRAY_SIZES = 2;
private final double[] log10LikelihoodsOfAC;