use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class GCAccumulatorTest method testExcludeUnmappable.
@Test
public void testExcludeUnmappable() {
final GenomeRegion region = GenomeRegionFactory.create(CHROMOSOME, 1001, 3000);
final GCAccumulator victim = new GCAccumulator(region);
final GenomeRegionSelector<GCProfile> selector = selector(profile(1001, 0.90), unmappableProfile(2001, 0.91));
selector.select(region, victim);
assertEquals(0.90, victim.averageGCContent(), EPSILON);
}
use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class GCAccumulatorTest method testExcludeOverlapAtStart.
@Test
public void testExcludeOverlapAtStart() {
final GenomeRegion region = GenomeRegionFactory.create(CHROMOSOME, 1100, 3000);
final GCAccumulator victim = new GCAccumulator(region);
final GenomeRegionSelector<GCProfile> selector = selector(profile(1001, 0.90), profile(2001, 0.91));
selector.select(region, victim);
assertEquals(0.91, victim.averageGCContent(), EPSILON);
}
use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class BamSlicerApplication method getIntervalsFromBED.
@NotNull
private static QueryInterval[] getIntervalsFromBED(@NotNull final String bedPath, @NotNull final SAMFileHeader header) throws IOException {
final Slicer bedSlicer = SlicerFactory.fromBedFile(bedPath);
final List<QueryInterval> queryIntervals = Lists.newArrayList();
for (final GenomeRegion region : bedSlicer.regions()) {
queryIntervals.add(new QueryInterval(header.getSequenceIndex(region.chromosome()), (int) region.start(), (int) region.end()));
}
return QueryInterval.optimizeIntervals(queryIntervals.toArray(new QueryInterval[queryIntervals.size()]));
}
Aggregations