Skip to content

Commit 845f31f

Browse files
committed
Another check for duplicate picard metrics data
1 parent 565e95a commit 845f31f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/pipeline/PicardMetricsUtil.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.labkey.sequenceanalysis.pipeline;
22

3+
import htsjdk.samtools.SamPairUtil;
34
import htsjdk.samtools.metrics.MetricBase;
45
import htsjdk.samtools.metrics.MetricsFile;
56
import org.apache.commons.beanutils.ConversionException;
@@ -164,6 +165,11 @@ private static List<Map<String, Object>> processDuplicationMetrics(MetricsFile m
164165
List<Map<String, Object>> ret = new ArrayList<>();
165166

166167
List<DuplicationMetrics> metrics = metricsFile.getMetrics();
168+
if (metrics.size() > 1)
169+
{
170+
log.info("More than one set of DuplicationMetrics: " + metrics.size());
171+
}
172+
167173
for (DuplicationMetrics m : metrics)
168174
{
169175
Map<String, Object> metricNames = new HashMap<>();
@@ -221,6 +227,14 @@ private static List<Map<String, Object>> processInsertSizeMetrics(MetricsFile me
221227
List<InsertSizeMetrics> metrics = metricsFile.getMetrics();
222228
for (InsertSizeMetrics m : metrics)
223229
{
230+
log.info("insert size metrics pair orientation: " + m.PAIR_ORIENTATION.name());
231+
232+
if (m.PAIR_ORIENTATION != SamPairUtil.PairOrientation.FR)
233+
{
234+
log.info("skipping pair orientation: " + m.PAIR_ORIENTATION.name());
235+
continue;
236+
}
237+
224238
Map<String, Object> metricNames = new HashMap<>();
225239
metricNames.put("Mean Insert Size", m.MEAN_INSERT_SIZE);
226240
metricNames.put("Median Insert Size", m.MEDIAN_INSERT_SIZE);

0 commit comments

Comments
 (0)