PurpleQCFile { @NotNull static PurpleQC fromLines(@NotNull final List<String> lines) { final ImmutablePurpleQC.Builder builder = ImmutablePurpleQC.builder(); if (lines.get(1).startsWith("SegmentPass")) { builder.unsupportedCopyNumberSegments(Integer.parseInt(getValue(lines.get(5)))) .amberGender(Gender.valueOf(getValue(lines.get(7)))) .cobaltGender(Gender.valueOf(getValue(lines.get(8)))) .deletedGenes(Integer.parseInt(getValue(lines.get(9)))) .copyNumberSegments(0) .purity(1) .method(FittedPurityMethod.NORMAL) .contamination(0); } else { builder.method(FittedPurityMethod.valueOf(getValue(lines.get(1)))) .copyNumberSegments(Integer.parseInt(getValue(lines.get(2)))) .unsupportedCopyNumberSegments(Integer.parseInt(getValue(lines.get(3)))) .purity(Double.parseDouble(getValue(lines.get(4)))) .amberGender(Gender.valueOf(getValue(lines.get(5)))) .cobaltGender(Gender.valueOf(getValue(lines.get(6)))) .deletedGenes(Integer.parseInt(getValue(lines.get(7)))) .contamination(Double.parseDouble(getValue(lines.get(8)))) .germlineAberrations(GermlineAberration.fromString(getValue(lines.get(9)))); } return builder.build(); } private  PurpleQCFile(); @NotNull static String generateFilename(@NotNull final String basePath, @NotNull final String sample); @NotNull static PurpleQC read(@NotNull final String filename); static void write(@NotNull final String fileName, @NotNull final PurpleQC check);  }
@Test public void testCompatibilityWith2_47() throws IOException { PurpleQCFile.fromLines(Resources.readLines(Resources.getResource("purple/v2-47.purple.qc"), Charset.defaultCharset())); }