AmberChecker implements HealthChecker { @NotNull @Override public List<QCValue> run() throws IOException { AmberQC qcCheck = AmberQCFile.read(AmberQCFile.generateFilename(amberDirectory, tumorSample)); QCValue bafCheck = ImmutableQCValue.of(QCValueType.AMBER_MEAN_BAF, String.valueOf(qcCheck.meanBAF())); QCValue contaminationCheck = ImmutableQCValue.of(QCValueType.AMBER_CONTAMINATION, String.valueOf(qcCheck.contamination())); return Lists.newArrayList(bafCheck, contaminationCheck); } AmberChecker(@NotNull final String tumorSample, @NotNull final String amberDirectory); @NotNull @Override List<QCValue> run();  }
@Test public void extractDataFromAmberWorksForSomatic() throws IOException { AmberChecker checker = new AmberChecker("tumor", AMBER_DIRECTORY); List<QCValue> values = checker.run(); for (QCValue value : values) { if (value.type() == QCValueType.AMBER_MEAN_BAF) { assertEquals("0.4951", value.value()); } else if (value.type() == QCValueType.AMBER_CONTAMINATION) { assertEquals("0.001", value.value()); } } }
@Test(expected = IOException.class) public void malformedYieldsIOException() throws IOException { AmberChecker checker = new AmberChecker("malformed", AMBER_DIRECTORY); checker.run(); }
@Test(expected = IOException.class) public void missingYieldsIOException() throws IOException { AmberChecker checker = new AmberChecker("missing", AMBER_DIRECTORY); checker.run(); }