Search in sources :

Example 6 with InsertSizeMetrics

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;
}
Also used : MetricsFile(htsjdk.samtools.metrics.MetricsFile) InsertSizeMetrics(picard.analysis.InsertSizeMetrics) FileNotFoundException(java.io.FileNotFoundException) FileReader(java.io.FileReader)

Example 7 with InsertSizeMetrics

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());
}
Also used : IdsvMetrics(gridss.analysis.IdsvMetrics) InsertSizeMetrics(picard.analysis.InsertSizeMetrics) ArrayList(java.util.ArrayList) InsertSizeDistribution(gridss.analysis.InsertSizeDistribution) MapqMetrics(gridss.analysis.MapqMetrics) CigarDetailMetrics(gridss.analysis.CigarDetailMetrics) Test(org.junit.Test)

Aggregations

InsertSizeMetrics (picard.analysis.InsertSizeMetrics)7 CigarDetailMetrics (gridss.analysis.CigarDetailMetrics)4 IdsvMetrics (gridss.analysis.IdsvMetrics)4 MapqMetrics (gridss.analysis.MapqMetrics)4 Test (org.junit.Test)4 MetricsFile (htsjdk.samtools.metrics.MetricsFile)3 InsertSizeDistribution (gridss.analysis.InsertSizeDistribution)2 SAMRecord (htsjdk.samtools.SAMRecord)2 SAMEvidenceSource (au.edu.wehi.idsv.SAMEvidenceSource)1 IdsvSamFileMetrics (au.edu.wehi.idsv.metrics.IdsvSamFileMetrics)1 IdsvSamFileMetricsCollector (au.edu.wehi.idsv.metrics.IdsvSamFileMetricsCollector)1 Function (com.google.common.base.Function)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileReader (java.io.FileReader)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Callable (java.util.concurrent.Callable)1 ExecutionException (java.util.concurrent.ExecutionException)1