use of com.hartwig.hmftools.common.gc.GCProfile in project hmftools by hartwigmedical.
the class ObservedRegionFactory method combine.
@NotNull
public List<ObservedRegion> combine(@NotNull final List<PurpleSegment> regions, @NotNull final Multimap<String, AmberBAF> bafs, @NotNull final Multimap<String, CobaltRatio> ratios, @NotNull final Multimap<String, GCProfile> gcProfiles) {
final List<ObservedRegion> result = Lists.newArrayList();
final GenomePositionSelector<CobaltRatio> cobaltSelector = GenomePositionSelectorFactory.create(ratios);
final GenomePositionSelector<AmberBAF> bafSelector = GenomePositionSelectorFactory.create(bafs);
final GenomeRegionSelector<GCProfile> gcSelector = GenomeRegionSelectorFactory.create(gcProfiles);
for (final PurpleSegment region : regions) {
final BAFAccumulator baf = new BAFAccumulator();
final CobaltAccumulator cobalt = new CobaltAccumulator(windowSize, region);
final GCAccumulator gc = new GCAccumulator(region);
bafSelector.select(region, baf);
cobaltSelector.select(region, cobalt);
gcSelector.select(region, gc);
double tumorRatio = cobalt.tumorMeanRatio();
double normalRatio = cobalt.referenceMeanRatio();
final EnrichedRegion copyNumber = ImmutableEnrichedRegion.builder().from(region).bafCount(baf.count()).observedBAF(baf.medianBaf()).observedTumorRatio(tumorRatio).observedNormalRatio(normalRatio).ratioSupport(region.ratioSupport()).support(region.support()).observedTumorRatioCount(cobalt.tumorCount()).gcContent(gc.averageGCContent()).status(statusFactory.status(region, normalRatio, tumorRatio)).svCluster(region.svCluster()).build();
result.add(copyNumber);
}
return result;
}
use of com.hartwig.hmftools.common.gc.GCProfile in project hmftools by hartwigmedical.
the class GCAccumulatorTest method testExcludeFromBothEnds.
@Test
public void testExcludeFromBothEnds() {
final GenomeRegion region = GenomeRegionFactory.create(CHROMOSOME, 1100, 2999);
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, victim.averageGCContent(), EPSILON);
}
use of com.hartwig.hmftools.common.gc.GCProfile in project hmftools by hartwigmedical.
the class GCAccumulatorTest method testStandard.
@Test
public void testStandard() {
final GenomeRegion region = GenomeRegionFactory.create(CHROMOSOME, 1001, 10000);
final GCAccumulator victim = new GCAccumulator(region);
final GenomeRegionSelector<GCProfile> selector = selector(profile(1001, 0.30), profile(4001, 0.31), profile(9001, 0.35));
selector.select(region, victim);
assertEquals(0.32, victim.averageGCContent(), EPSILON);
}
use of com.hartwig.hmftools.common.gc.GCProfile in project hmftools by hartwigmedical.
the class GCAccumulatorTest method testExcludeOverlapFromEnd.
@Test
public void testExcludeOverlapFromEnd() {
final GenomeRegion region = GenomeRegionFactory.create(CHROMOSOME, 1001, 2999);
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.90, victim.averageGCContent(), EPSILON);
}
use of com.hartwig.hmftools.common.gc.GCProfile 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);
}
Aggregations