FusedExons { @NotNull static GenomeRegion convertRegion(int strand, @NotNull final GenomeRegion reference, @NotNull final GenomeRegion region) { final long start; final long end; if (strand < 0) { start = reference.end() - region.end(); end = reference.end() - region.start(); } else { start = region.start() - reference.start(); end = Math.min(reference.end(), region.end()) - reference.start(); } return GenomeRegions.create(region.chromosome(), Math.max(0, start), end); }  static void write(@NotNull final String fileName, @NotNull final List<FusedExon> fusedExons); @NotNull static List<FusedExon> fusedExons(@NotNull final Fusion fusion, @NotNull final List<Exon> exons);  }
@Test public void testPositiveStreamBounds() { final GenomeRegion gene = GenomeRegions.create("1" , 10000, 15000); final GenomeRegion exon = GenomeRegions.create("1" , 5000, 20000); final GenomeRegion expectedEnd = GenomeRegions.create("1" , 0, 5000); assertEquals(expectedEnd, FusedExons.convertRegion(1, gene, exon)); }
@Test public void testNegativeStreamBounds() { final GenomeRegion gene = GenomeRegions.create("1" , 10000, 15000); final GenomeRegion exonicBreak = GenomeRegions.create("1" , 5000, 20000); final GenomeRegion expectedEnd = GenomeRegions.create("1" , 0, 5000); assertEquals(expectedEnd, FusedExons.convertRegion(1, gene, exonicBreak)); }