use of picard.analysis.InsertSizeMetrics in project gridss by PapenfussLab.
the class InsertSizeDistribution method create.
public static InsertSizeDistribution create(File insertSizeMetricsFile) {
InsertSizeDistribution result = null;
if (insertSizeMetricsFile != null && insertSizeMetricsFile.exists()) {
FileReader reader = null;
try {
reader = new FileReader(insertSizeMetricsFile);
MetricsFile<InsertSizeMetrics, Integer> file = new MetricsFile<InsertSizeMetrics, Integer>();
file.read(reader);
result = InsertSizeDistribution.create(file.getHistogram());
} catch (FileNotFoundException e) {
log.error("Missing insert size distribution for ", insertSizeMetricsFile);
} finally {
CloserUtil.close(reader);
}
if (result == null) {
log.debug("Unable to extract insert size distribution from ", insertSizeMetricsFile);
}
}
return result;
}
use of picard.analysis.InsertSizeMetrics in project gridss by PapenfussLab.
the class IdsvSamFileMetricsTest method wrapper_inner_metrics.
@Test
public void wrapper_inner_metrics() {
IdsvMetrics im = new IdsvMetrics();
InsertSizeMetrics ism = new InsertSizeMetrics();
MapqMetrics mqm = new MapqMetrics();
List<CigarDetailMetrics> sc = new ArrayList<CigarDetailMetrics>();
InsertSizeDistribution isd = new InsertSizeDistribution(new int[] { 1 }, new double[] { 1 });
IdsvSamFileMetrics metrics = new IdsvSamFileMetrics(ism, im, mqm, isd, sc);
assertEquals(im, metrics.getIdsvMetrics());
assertEquals(isd, metrics.getInsertSizeDistribution());
assertEquals(ism, metrics.getInsertSizeMetrics());
assertEquals(sc, metrics.getCigarDetailMetrics());
assertEquals(mqm, metrics.getMapqMetrics());
}
Aggregations