use of com.hartwig.hmftools.common.cosmic.fusions.CosmicFusionData in project hmftools by hartwigmedical.
the class StructuralVariantAnalyzer method toReportableGeneFusions.
@NotNull
private List<GeneFusion> toReportableGeneFusions(@NotNull List<List<Pair<Transcript, Transcript>>> fusionsPerVariant) {
final List<GeneFusion> result = Lists.newArrayList();
for (final List<Pair<Transcript, Transcript>> fusions : fusionsPerVariant) {
Optional<Pair<Transcript, Transcript>> reportableFusion = determineReportableFusion(fusions);
for (final Pair<Transcript, Transcript> fusion : fusions) {
final Transcript upstream = fusion.getLeft();
final Transcript downstream = fusion.getRight();
final CosmicFusionData cosmic = transcriptsMatchKnownFusion(upstream, downstream);
final boolean promiscuousEnd = oneEndPromiscuous(upstream, downstream);
final boolean reportable = reportableFusion.isPresent() && reportableFusion.get() == fusion && (cosmic != null || promiscuousEnd);
final GeneFusion geneFusion = ImmutableGeneFusion.builder().reportable(reportable).upstreamLinkedAnnotation(upstream).downstreamLinkedAnnotation(downstream).cosmicURL(cosmic != null ? cosmic.cosmicURL() : "").build();
result.add(geneFusion);
}
}
return result;
}
Aggregations