use of htsjdk.samtools.metrics.MetricsFile in project gridss by PapenfussLab.
the class TestHelper method IDSV.
public IdsvMetrics IDSV(Collection<SAMRecord> input) {
IdsvSamFileMetricsCollector c = new IdsvSamFileMetricsCollector(null);
for (SAMRecord r : input) {
c.acceptRecord(r, null);
}
MetricsFile<IdsvMetrics, Integer> idsv = new MetricsFile<IdsvMetrics, Integer>();
MetricsFile<InsertSizeMetrics, Integer> is = new MetricsFile<InsertSizeMetrics, Integer>();
MetricsFile<CigarDetailMetrics, Integer> sc = new MetricsFile<CigarDetailMetrics, Integer>();
MetricsFile<MapqMetrics, Integer> mqm = new MetricsFile<MapqMetrics, Integer>();
c.finish(is, idsv, mqm, sc);
IdsvMetrics metrics = idsv.getMetrics().get(0);
return metrics;
}
use of htsjdk.samtools.metrics.MetricsFile 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;
}
Aggregations