use of com.hartwig.hmftools.common.pcf.PCFPosition in project hmftools by hartwigmedical.
the class PurpleSegmentFactory method create.
@NotNull
@VisibleForTesting
static List<PurpleSegment> create(@NotNull final ChromosomeLength chromosome, @NotNull final Collection<Cluster> clusters) {
final List<PurpleSegment> result = Lists.newArrayList();
ModifiablePurpleSegment segment = create(chromosome.chromosome(), 1).setSupport(SegmentSupport.TELOMERE);
for (final Cluster cluster : clusters) {
boolean ratioSupport = !cluster.ratios().isEmpty();
final List<ClusterVariantLeg> variants = cluster.variants();
if (!variants.isEmpty()) {
for (final ClusterVariantLeg variant : variants) {
if (variant.position() != segment.start()) {
result.add(updatedStatusForCentromere(segment.setEnd(variant.position() - 1)));
segment = createFromCluster(cluster, variant, ratioSupport);
} else {
segment.setSupport(SegmentSupport.MULTIPLE);
}
}
segment.setSvCluster(false);
} else {
final List<PCFPosition> pcfPositions = cluster.pcfPositions();
// JOBA: DO FIRST
final GenomePosition firstRatioBreak = pcfPositions.get(0);
result.add(updatedStatusForCentromere(segment.setEnd(firstRatioBreak.position() - 1)));
segment = create(firstRatioBreak.chromosome(), firstRatioBreak.position());
}
}
result.add(segment.setEnd(chromosome.length()));
return result;
}
use of com.hartwig.hmftools.common.pcf.PCFPosition in project hmftools by hartwigmedical.
the class PCFPositionsSupplier method centromeres.
@NotNull
private static Multimap<String, PCFPosition> centromeres(int windowSize) {
final Window window = new Window(windowSize);
final Multimap<String, PCFPosition> result = ArrayListMultimap.create();
for (final Map.Entry<String, GenomeRegion> entry : Centromeres.grch37().entrySet()) {
final GenomeRegion centromere = entry.getValue();
result.put(entry.getKey(), create(centromere.chromosome(), window.start(centromere.start())));
result.put(entry.getKey(), create(centromere.chromosome(), window.start(centromere.end()) + windowSize));
}
return result;
}
Aggregations