use of com.google.cloud.dataflow.sdk.repackaged.com.google.common.annotations.VisibleForTesting in project gatk-protected by broadinstitute.
the class PreAdapterOrientationScorer method countOrientationBiasMetricsOverContext.
/**
* Gets PreAdapterQ collapsed over contexts.
*
* rows {PRO, CON} x cols {ref, alt}
* @param metrics metrics usually read from a picard preadapter detail file.
* @return mapping to score all orientation bias artifact modes to a PreAdapterQ score. This score can be used as a bam-file level score for level of artifacts.
*/
@VisibleForTesting
static Map<Transition, RealMatrix> countOrientationBiasMetricsOverContext(final List<SequencingArtifactMetrics.PreAdapterDetailMetrics> metrics) {
Utils.nonNull(metrics, "Input metrics cannot be null");
// Artifact mode to a matrix
final Map<Transition, RealMatrix> result = new HashMap<>();
// Collapse over context
for (SequencingArtifactMetrics.PreAdapterDetailMetrics metric : metrics) {
final Transition key = Transition.transitionOf(metric.REF_BASE, metric.ALT_BASE);
result.putIfAbsent(key, new Array2DRowRealMatrix(2, 2));
final RealMatrix preAdapterCountMatrix = result.get(key);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.PRO, PreAdapterOrientationScorer.ALT, metric.PRO_ALT_BASES);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.CON, PreAdapterOrientationScorer.ALT, metric.CON_ALT_BASES);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.PRO, PreAdapterOrientationScorer.REF, metric.PRO_REF_BASES);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.CON, PreAdapterOrientationScorer.REF, metric.CON_REF_BASES);
}
return result;
}
use of com.google.cloud.dataflow.sdk.repackaged.com.google.common.annotations.VisibleForTesting in project gatk by broadinstitute.
the class PreAdapterOrientationScorer method countOrientationBiasMetricsOverContext.
/**
* Gets PreAdapterQ collapsed over contexts.
*
* rows {PRO, CON} x cols {ref, alt}
* @param metrics metrics usually read from a picard preadapter detail file.
* @return mapping to score all orientation bias artifact modes to a PreAdapterQ score. This score can be used as a bam-file level score for level of artifacts.
*/
@VisibleForTesting
static Map<Transition, RealMatrix> countOrientationBiasMetricsOverContext(final List<SequencingArtifactMetrics.PreAdapterDetailMetrics> metrics) {
Utils.nonNull(metrics, "Input metrics cannot be null");
// Artifact mode to a matrix
final Map<Transition, RealMatrix> result = new HashMap<>();
// Collapse over context
for (SequencingArtifactMetrics.PreAdapterDetailMetrics metric : metrics) {
final Transition key = Transition.transitionOf(metric.REF_BASE, metric.ALT_BASE);
result.putIfAbsent(key, new Array2DRowRealMatrix(2, 2));
final RealMatrix preAdapterCountMatrix = result.get(key);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.PRO, PreAdapterOrientationScorer.ALT, metric.PRO_ALT_BASES);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.CON, PreAdapterOrientationScorer.ALT, metric.CON_ALT_BASES);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.PRO, PreAdapterOrientationScorer.REF, metric.PRO_REF_BASES);
preAdapterCountMatrix.addToEntry(PreAdapterOrientationScorer.CON, PreAdapterOrientationScorer.REF, metric.CON_REF_BASES);
}
return result;
}
Aggregations