use of gridss.analysis.InsertSizeDistribution in project gridss by PapenfussLab.
the class EmpiricalReferenceLikelihoodModelTest method should_score_read_pairs_correctly.
@Test
public void should_score_read_pairs_correctly() {
IdsvSamFileMetrics metrics = new IdsvSamFileMetrics(new InsertSizeMetrics() {
{
MEAN_INSERT_SIZE = 2;
MEDIAN_INSERT_SIZE = 2;
MIN_INSERT_SIZE = 1;
MAX_INSERT_SIZE = 3;
MEDIAN_ABSOLUTE_DEVIATION = 1;
}
}, new IdsvMetrics() {
{
MAX_READ_LENGTH = 100;
MAX_PROPER_PAIR_FRAGMENT_LENGTH = 2;
MIN_PROPER_PAIR_FRAGMENT_LENGTH = 2;
READ_PAIRS = 13;
READ_PAIRS_ONE_MAPPED = 2;
READ_PAIRS_ZERO_MAPPED = 1;
READ_PAIRS_BOTH_MAPPED = READ_PAIRS - READ_PAIRS_ONE_MAPPED - READ_PAIRS_ZERO_MAPPED;
READS = 2 * READ_PAIRS;
MAPPED_READS = READS - READ_PAIRS_ONE_MAPPED - 2 * READ_PAIRS_ZERO_MAPPED;
}
}, new MapqMetrics() {
{
}
}, new InsertSizeDistribution(new int[] { 1, 2, 3 }, new double[] { 1, 8, 1 }), new ArrayList<CigarDetailMetrics>());
assertEquals(10, model.scoreReadPair(metrics, 3, 1000, 1000), 0.001);
}
use of gridss.analysis.InsertSizeDistribution in project gridss by PapenfussLab.
the class GcSinglePassSamProgram method getReadPairConcordanceCalculator.
public ReadPairConcordanceCalculator getReadPairConcordanceCalculator() {
if (!rpccInitialised) {
// Read metrics file
InsertSizeDistribution isd = null;
if (INSERT_SIZE_METRICS != null) {
if (!INSERT_SIZE_METRICS.exists()) {
log.warn("Missing " + INSERT_SIZE_METRICS);
} else {
isd = InsertSizeDistribution.create(INSERT_SIZE_METRICS);
}
}
rpcc = ReadPairConcordanceCalculator.create(READ_PAIR_CONCORDANCE_METHOD, FIXED_READ_PAIR_CONCORDANCE_MIN_FRAGMENT_SIZE, FIXED_READ_PAIR_CONCORDANCE_MAX_FRAGMENT_SIZE, READ_PAIR_CONCORDANT_PERCENT, isd, null);
rpccInitialised = true;
}
return rpcc;
}
use of gridss.analysis.InsertSizeDistribution in project gridss by PapenfussLab.
the class ProcessStructuralVariantReadsCommandLineProgram method getReadPairConcordanceCalculator.
public ReadPairConcordanceCalculator getReadPairConcordanceCalculator() {
if (!rpccInitialised) {
// Read metrics file
InsertSizeDistribution isd = null;
if (INSERT_SIZE_METRICS != null) {
if (!INSERT_SIZE_METRICS.exists()) {
log.warn("Missing " + INSERT_SIZE_METRICS);
} else {
isd = InsertSizeDistribution.create(INSERT_SIZE_METRICS);
}
}
rpcc = ReadPairConcordanceCalculator.create(READ_PAIR_CONCORDANCE_METHOD, FIXED_READ_PAIR_CONCORDANCE_MIN_FRAGMENT_SIZE, FIXED_READ_PAIR_CONCORDANCE_MAX_FRAGMENT_SIZE, READ_PAIR_CONCORDANT_PERCENT, isd, null);
rpccInitialised = true;
}
return rpcc;
}
use of gridss.analysis.InsertSizeDistribution 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