Search in sources :

Example 11 with GenomeRegion

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);
}
Also used : GenomeRegion(com.hartwig.hmftools.common.region.GenomeRegion) ImmutableGCProfile(com.hartwig.hmftools.common.gc.ImmutableGCProfile) GCProfile(com.hartwig.hmftools.common.gc.GCProfile) Test(org.junit.Test)

Example 12 with GenomeRegion

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);
}
Also used : GenomeRegion(com.hartwig.hmftools.common.region.GenomeRegion) ImmutableGCProfile(com.hartwig.hmftools.common.gc.ImmutableGCProfile) GCProfile(com.hartwig.hmftools.common.gc.GCProfile) Test(org.junit.Test)

Example 13 with GenomeRegion

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()]));
}
Also used : Slicer(com.hartwig.hmftools.common.slicing.Slicer) GenomeRegion(com.hartwig.hmftools.common.region.GenomeRegion) QueryInterval(htsjdk.samtools.QueryInterval) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GenomeRegion (com.hartwig.hmftools.common.region.GenomeRegion)13 Test (org.junit.Test)6 GCProfile (com.hartwig.hmftools.common.gc.GCProfile)5 ImmutableGCProfile (com.hartwig.hmftools.common.gc.ImmutableGCProfile)5 Slicer (com.hartwig.hmftools.common.slicing.Slicer)2 SomaticVariant (com.hartwig.hmftools.common.variant.SomaticVariant)2 BufferedReader (java.io.BufferedReader)2 FileReader (java.io.FileReader)2 IOException (java.io.IOException)2 NotNull (org.jetbrains.annotations.NotNull)2 CobaltRatio (com.hartwig.hmftools.common.cobalt.CobaltRatio)1 ImmutablePCFPosition (com.hartwig.hmftools.common.pcf.ImmutablePCFPosition)1 PCFPosition (com.hartwig.hmftools.common.pcf.PCFPosition)1 PurityAdjuster (com.hartwig.hmftools.common.purple.PurityAdjuster)1 PurpleCopyNumber (com.hartwig.hmftools.common.purple.copynumber.PurpleCopyNumber)1 PurityContext (com.hartwig.hmftools.common.purple.purity.PurityContext)1 FittedRegion (com.hartwig.hmftools.common.purple.region.FittedRegion)1 HmfGenomeRegion (com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion)1 ImmutableHmfGenomeRegion (com.hartwig.hmftools.common.region.hmfslicer.ImmutableHmfGenomeRegion)1 ClonalityFactory (com.hartwig.hmftools.common.variant.ClonalityFactory)1