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);
}
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;
}
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());
}
Aggregations