DisruptedExons { @NotNull public static List<GenomeRegion> disruptedGeneRegions(@NotNull final List<Fusion> fusions, @NotNull final List<Exon> exons) { List<GenomeRegion> result = exons.stream().filter(x -> x.type().equals(ExonType.DISRUPTED)).collect(Collectors.toList()); for (Fusion fusion : fusions) { result.addAll(disruptedGeneRegions(fusion, exons)); } return result; }  @NotNull static List<GenomeRegion> disruptedGeneRegions(@NotNull final List<Fusion> fusions, @NotNull final List<Exon> exons); @NotNull static List<GenomeRegion> disruptedGeneRegions(@NotNull final Fusion fusion, @NotNull final List<Exon> exons);  }
@Test public void testNormalOrientation() { final List<Exon> exons = Lists.newArrayList(); exons.addAll(normalUp); exons.addAll(normalDown); final Fusion fusion = create(1, 150, 1, 1, 150, 2); final List<GenomeRegion> victim = DisruptedExons.disruptedGeneRegions(fusion, exons); assertEquals(2, victim.size()); assertRegion(UP, 100, 300, victim.get(0)); assertRegion(DOWN, 1, 201, victim.get(1)); }
@Test public void testNormalOrientationPartialExon() { final List<Exon> exons = Lists.newArrayList(); exons.addAll(normalUp); exons.addAll(normalDown); final Fusion fusion = create(1, 50, 1, 1, 250, 2); final List<GenomeRegion> victim = DisruptedExons.disruptedGeneRegions(fusion, exons); assertEquals(2, victim.size()); assertRegion(UP, 50, 300, victim.get(0)); assertRegion(DOWN, 1, 250, victim.get(1)); }
@Test public void testReverseOrientation() { final List<Exon> exons = Lists.newArrayList(); exons.addAll(reverseUp); exons.addAll(reverseDown); final Fusion fusion = create(-1, 150, 1, -1, 150, 2); final List<GenomeRegion> victim = DisruptedExons.disruptedGeneRegions(fusion, exons); assertEquals(2, victim.size()); assertRegion(UP, 1, 201, victim.get(0)); assertRegion(DOWN, 100, 300, victim.get(1)); }
@Test public void testReverseOrientationPartialExon() { final List<Exon> exons = Lists.newArrayList(); exons.addAll(reverseUp); exons.addAll(reverseDown); final Fusion fusion = create(-1, 250, 1, -1, 50, 2); final List<GenomeRegion> victim = DisruptedExons.disruptedGeneRegions(fusion, exons); assertEquals(2, victim.size()); assertRegion(UP, 1, 250, victim.get(0)); assertRegion(DOWN, 50, 300, victim.get(1)); }