use of org.broadinstitute.hellbender.engine.ReadsContext in project gatk-protected by broadinstitute.
the class AnnotateVcfWithExpectedAlleleFraction method apply.
@Override
public void apply(final VariantContext vc, final ReadsContext readsContext, final ReferenceContext refContext, final FeatureContext fc) {
final double[] weights = vc.getGenotypes().stream().mapToDouble(g -> weight(g)).toArray();
final double expectedAlleleFraction = MathUtils.sum(MathArrays.ebeMultiply(weights, mixingFractionsInSampleOrder));
vcfWriter.add(new VariantContextBuilder(vc).attribute(EXPECTED_ALLELE_FRACTION_NAME, expectedAlleleFraction).make());
}
use of org.broadinstitute.hellbender.engine.ReadsContext in project gatk by broadinstitute.
the class AnnotateVcfWithExpectedAlleleFraction method apply.
@Override
public void apply(final VariantContext vc, final ReadsContext readsContext, final ReferenceContext refContext, final FeatureContext fc) {
final double[] weights = vc.getGenotypes().stream().mapToDouble(g -> weight(g)).toArray();
final double expectedAlleleFraction = MathUtils.sum(MathArrays.ebeMultiply(weights, mixingFractionsInSampleOrder));
vcfWriter.add(new VariantContextBuilder(vc).attribute(EXPECTED_ALLELE_FRACTION_NAME, expectedAlleleFraction).make());
}
Aggregations