Search in sources :

Example 1 with CosmicFusionData

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;
}
Also used : Transcript(com.hartwig.hmftools.svannotation.annotations.Transcript) GeneFusion(com.hartwig.hmftools.svannotation.annotations.GeneFusion) ImmutableGeneFusion(com.hartwig.hmftools.svannotation.annotations.ImmutableGeneFusion) CosmicFusionData(com.hartwig.hmftools.common.cosmic.fusions.CosmicFusionData) Pair(org.apache.commons.lang3.tuple.Pair) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

CosmicFusionData (com.hartwig.hmftools.common.cosmic.fusions.CosmicFusionData)1 GeneFusion (com.hartwig.hmftools.svannotation.annotations.GeneFusion)1 ImmutableGeneFusion (com.hartwig.hmftools.svannotation.annotations.ImmutableGeneFusion)1 Transcript (com.hartwig.hmftools.svannotation.annotations.Transcript)1 Pair (org.apache.commons.lang3.tuple.Pair)1 NotNull (org.jetbrains.annotations.NotNull)1