GeneCopyNumberFile { @VisibleForTesting @NotNull static GeneCopyNumber fromString(@NotNull final String line) { String[] values = line.split(DELIMITER); final ImmutableGeneCopyNumber.Builder builder = ImmutableGeneCopyNumber.builder() .chromosome(values[0]) .start(Long.parseLong(values[1])) .end(Long.parseLong(values[2])) .gene(values[3]) .minCopyNumber(Double.parseDouble(values[4])) .maxCopyNumber(Double.parseDouble(values[5])) .somaticRegions(Integer.parseInt(values[7])) .germlineHomRegions(Integer.parseInt(values[8])) .germlineHet2HomRegions(Integer.parseInt(values[9])) .transcriptID(values[10]) .transcriptVersion(Integer.parseInt(values[11])) .chromosomeBand(values[12]); builder.minRegions(0) .minRegionStart(Long.parseLong(values[1])) .minRegionEnd(Long.parseLong(values[2])) .minRegionMethod(CopyNumberMethod.UNKNOWN) .minRegionStartSupport(SegmentSupport.NONE) .minRegionEndSupport(SegmentSupport.NONE) .minMinorAlleleCopyNumber(0); if (values.length >= 19) { builder.minRegions(Integer.parseInt(values[13])) .minRegionStart(Long.parseLong(values[14])) .minRegionEnd(Long.parseLong(values[15])) .minRegionStartSupport(SegmentSupport.valueOf(values[16])) .minRegionEndSupport(SegmentSupport.valueOf(values[17])) .minRegionMethod(CopyNumberMethod.valueOf(values[18])); } builder.minMinorAlleleCopyNumber(Double.parseDouble(values[values.length - 1])); return builder.build(); } private  GeneCopyNumberFile(); @NotNull static String generateFilenameForWriting(@NotNull final String basePath, @NotNull final String sample); @NotNull static String generateFilenameForReading(@NotNull final String basePath, @NotNull final String sample); @NotNull static List<GeneCopyNumber> read(@NotNull final String fileName); static void write(@NotNull final String fileName, @NotNull List<GeneCopyNumber> geneCopyNumbers);  }
@Test public void testSupportOlderFileFormat() { final String oldVersion = "1\t11869\t14409\tDDX11L1\t2.5717\t2.5717\t0\t1\t0\t0\tENST00000456328\t2\tp36.33\t1\t1\t87337011\tTELOMERE\tBND\tBAF_WEIGHTED\t0\t0\t0.0000\t0\t0\t0.0000\t0\t0\t0.0000\t0.5491"; GeneCopyNumber copyNumber = GeneCopyNumberFile.fromString(oldVersion); assertEquals(11869, copyNumber.start()); assertEquals(0.5491, copyNumber.minMinorAlleleCopyNumber(), 0.00001); }