DriverCatalogFile { @NotNull public static List<DriverCatalog> read(@NotNull final String fileName) throws IOException { return fromLines(Files.readAllLines(new File(fileName).toPath())); }  static String generateFilename(@NotNull final String basePath, @NotNull final String sample); @NotNull static List<DriverCatalog> read(@NotNull final String fileName); static void write(@NotNull final String filename, @NotNull final List<DriverCatalog> catalog);  }
@Test public void canReadDriverCatalogFile() throws IOException { List<DriverCatalog> driverCatalogs = DriverCatalogFile.read(DRIVER_CATALOG_TSV); assertEquals(3, driverCatalogs.size()); DriverCatalog catalog1 = driverCatalogs.get(0); assertEquals("8", catalog1.chromosome()); assertEquals("p22", catalog1.chromosomeBand()); assertEquals("SGCZ", catalog1.gene()); assertEquals(DriverCategory.TSG, catalog1.category()); assertEquals(DriverType.HOM_DISRUPTION, catalog1.driver()); assertEquals(LikelihoodMethod.DNDS, catalog1.likelihoodMethod()); assertEquals(1.0000, catalog1.driverLikelihood(), EPSILON); assertEquals(0.0000, catalog1.dndsLikelihood(), EPSILON); assertEquals(0, catalog1.missense(), EPSILON); assertEquals(0, catalog1.nonsense(), EPSILON); assertEquals(0, catalog1.splice(), EPSILON); assertEquals(0, catalog1.inframe(), EPSILON); assertEquals(0, catalog1.frameshift(), EPSILON); assertFalse(catalog1.biallelic()); assertEquals(3.7, catalog1.minCopyNumber(), EPSILON); assertEquals(1.3, catalog1.maxCopyNumber(), EPSILON); DriverCatalog catalog2 = driverCatalogs.get(1); assertEquals("X", catalog2.chromosome()); assertEquals("q21.33", catalog2.chromosomeBand()); assertEquals("DIAPH2", catalog2.gene()); assertEquals(DriverCategory.ONCO, catalog2.category()); assertEquals(DriverType.MUTATION, catalog2.driver()); assertEquals(LikelihoodMethod.BIALLELIC, catalog2.likelihoodMethod()); assertEquals(1.0000, catalog2.driverLikelihood(), EPSILON); assertEquals(0.0000, catalog2.dndsLikelihood(), EPSILON); assertEquals(0, catalog2.missense(), EPSILON); assertEquals(0, catalog2.nonsense(), EPSILON); assertEquals(0, catalog2.splice(), EPSILON); assertEquals(0, catalog2.inframe(), EPSILON); assertEquals(0, catalog2.frameshift(), EPSILON); assertTrue(catalog2.biallelic()); assertEquals(2.4, catalog2.minCopyNumber(), EPSILON); assertEquals(5.3, catalog2.maxCopyNumber(), EPSILON); DriverCatalog catalog3 = driverCatalogs.get(2); assertEquals("9", catalog3.chromosome()); assertEquals("p23-p24.1", catalog3.chromosomeBand()); assertEquals("PTPRD", catalog3.gene()); assertEquals(DriverCategory.TSG, catalog3.category()); assertEquals(DriverType.HOM_DISRUPTION, catalog3.driver()); assertEquals(LikelihoodMethod.DEL, catalog3.likelihoodMethod()); assertEquals(1.0000, catalog3.driverLikelihood(), EPSILON); assertEquals(0.0000, catalog3.dndsLikelihood(), EPSILON); assertEquals(0, catalog3.missense(), EPSILON); assertEquals(0, catalog3.nonsense(), EPSILON); assertEquals(0, catalog3.splice(), EPSILON); assertEquals(0, catalog3.inframe(), EPSILON); assertEquals(0, catalog3.frameshift(), EPSILON); assertFalse(catalog3.biallelic()); assertEquals(0.8, catalog3.minCopyNumber(), EPSILON); assertEquals(2.4, catalog3.maxCopyNumber(), EPSILON); }