Search in sources :

Example 6 with IdsvMetrics

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

the class EmpiricalLlrModel method scoreUnmappedMate.

@Override
public double scoreUnmappedMate(IdsvSamFileMetrics metrics, int mapq) {
    IdsvMetrics im = metrics.getIdsvMetrics();
    // completely unmapped read pairs are excluded for consistency with sc and dp calculation
    double readPairs = im.READ_PAIRS - im.READ_PAIRS_ZERO_MAPPED;
    double prEgivenMR = im.READ_PAIRS_ONE_MAPPED / readPairs;
    // we assume that in our variant case, the read correctly maps across the breakpoint
    // TODO: actually calculate the inferred variant fragment size
    double prEgivenMV = 0.5 * im.READ_PAIRS_BOTH_MAPPED / readPairs;
    return llr(prEgivenMR, prEgivenMV, mapq);
}
Also used : IdsvMetrics(gridss.analysis.IdsvMetrics)

Example 7 with IdsvMetrics

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

the class EmpiricalReferenceLikelihoodModel method scoreUnmappedMate.

@Override
public double scoreUnmappedMate(IdsvSamFileMetrics metrics, int mapq) {
    IdsvMetrics im = metrics.getIdsvMetrics();
    // completely unmapped read pairs are excluded for consistency with sc and dp calculation
    double prEgivenRM = (double) im.READ_PAIRS_ONE_MAPPED / (double) (im.READ_PAIRS - im.READ_PAIRS_ZERO_MAPPED);
    double score = MathUtil.phredOr(MathUtil.prToPhred(prEgivenRM), mapq);
    return score;
}
Also used : IdsvMetrics(gridss.analysis.IdsvMetrics)

Example 8 with IdsvMetrics

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

IdsvMetrics (gridss.analysis.IdsvMetrics)8 CigarDetailMetrics (gridss.analysis.CigarDetailMetrics)4 MapqMetrics (gridss.analysis.MapqMetrics)4 InsertSizeMetrics (picard.analysis.InsertSizeMetrics)4 Test (org.junit.Test)3 InsertSizeDistribution (gridss.analysis.InsertSizeDistribution)2 SAMRecord (htsjdk.samtools.SAMRecord)2 MetricsFile (htsjdk.samtools.metrics.MetricsFile)2 IdsvSamFileMetrics (au.edu.wehi.idsv.metrics.IdsvSamFileMetrics)1 IdsvSamFileMetricsCollector (au.edu.wehi.idsv.metrics.IdsvSamFileMetricsCollector)1 ArrayList (java.util.ArrayList)1