Search in sources :

Example 6 with CigarDetailMetrics

use of gridss.analysis.CigarDetailMetrics 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)

Example 7 with CigarDetailMetrics

use of gridss.analysis.CigarDetailMetrics in project gridss by PapenfussLab.

the class ScoringComparisonTest method printSoftClipComparison.

private void printSoftClipComparison(VariantScoringModel model1, VariantScoringModel model2) {
    List<CigarDetailMetrics> sc = CigarSizeDistributionTest.data_778();
    IdsvSamFileMetrics metrics = new IdsvSamFileMetrics(null, null, null, null, sc);
    System.out.println("Split Read:");
    System.out.println("mapq1,mapq2,sclength,score1,score2");
    for (int i = 0; i < mapq.length; i++) {
        int mapq1 = mapq[i];
        for (int j = i; j < mapq.length; j++) {
            int mapq2 = mapq[j];
            for (int scLength = 0; scLength < sc.size(); scLength += 5) {
                System.out.println(String.format("%d,%d,%d,%f,%f", mapq1, mapq2, scLength, model1.scoreSplitRead(metrics, scLength, mapq1, mapq2), model2.scoreSplitRead(metrics, scLength, mapq1, mapq2)));
            }
        }
    }
    System.out.println("SoftClip:");
    System.out.println("mapq1,sclength,score1,score2");
    for (int i = 0; i < mapq.length; i++) {
        int mapq1 = mapq[i];
        for (int scLength = 0; scLength < sc.size(); scLength += 5) {
            System.out.println(String.format("%d,%d,%f,%f", mapq1, scLength, model1.scoreSoftClip(metrics, scLength, mapq1), model2.scoreSoftClip(metrics, scLength, mapq1)));
        }
    }
}
Also used : IdsvSamFileMetrics(au.edu.wehi.idsv.metrics.IdsvSamFileMetrics) CigarDetailMetrics(gridss.analysis.CigarDetailMetrics)

Aggregations

CigarDetailMetrics (gridss.analysis.CigarDetailMetrics)7 IdsvMetrics (gridss.analysis.IdsvMetrics)5 MapqMetrics (gridss.analysis.MapqMetrics)5 InsertSizeMetrics (picard.analysis.InsertSizeMetrics)5 InsertSizeDistribution (gridss.analysis.InsertSizeDistribution)3 MetricsFile (htsjdk.samtools.metrics.MetricsFile)3 Test (org.junit.Test)3 IdsvSamFileMetrics (au.edu.wehi.idsv.metrics.IdsvSamFileMetrics)2 SAMRecord (htsjdk.samtools.SAMRecord)2 ArrayList (java.util.ArrayList)2 GenomicProcessingContext (au.edu.wehi.idsv.GenomicProcessingContext)1 IdsvSamFileMetricsCollector (au.edu.wehi.idsv.metrics.IdsvSamFileMetricsCollector)1 MathUtil (au.edu.wehi.idsv.util.MathUtil)1 Iterables (com.google.common.collect.Iterables)1 Iterators (com.google.common.collect.Iterators)1 Ordering (com.google.common.collect.Ordering)1 Longs (com.google.common.primitives.Longs)1 CigarSizeDistribution (gridss.analysis.CigarSizeDistribution)1 CigarOperator (htsjdk.samtools.CigarOperator)1 Log (htsjdk.samtools.util.Log)1