Search in sources :

Example 11 with RunContext

use of com.hartwig.hmftools.common.context.RunContext in project hmftools by hartwigmedical.

the class HealthChecksApplication method main.

public static void main(final String... args) throws ParseException, IOException {
    final Options options = createOptions();
    final CommandLine cmd = createCommandLine(options, args);
    String runDirectory = cmd.getOptionValue(RUN_DIRECTORY);
    final String reportFilePath = cmd.getOptionValue(REPORT_FILE_PATH);
    if (runDirectory == null || reportFilePath == null) {
        final HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("Health-Checks", options);
        System.exit(1);
    }
    runDirectory = FolderChecker.build().checkFolder(runDirectory);
    RunContext runContext = ProductionRunContextFactory.fromRunDirectory(runDirectory);
    new HealthChecksApplication(runContext, reportFilePath).run();
}
Also used : HelpFormatter(org.apache.commons.cli.HelpFormatter) Options(org.apache.commons.cli.Options) CommandLine(org.apache.commons.cli.CommandLine) RunContext(com.hartwig.hmftools.common.context.RunContext)

Example 12 with RunContext

use of com.hartwig.hmftools.common.context.RunContext in project hmftools by hartwigmedical.

the class AmberCheckerTest method testMissing.

@Test(expected = IOException.class)
public void testMissing() throws IOException {
    final RunContext runContext = TestRunContextFactory.forSomaticTest(BASE_DIRECTORY, REF_SAMPLE, "missing");
    checker.run(runContext);
}
Also used : RunContext(com.hartwig.hmftools.common.context.RunContext) Test(org.junit.Test)

Example 13 with RunContext

use of com.hartwig.hmftools.common.context.RunContext in project hmftools by hartwigmedical.

the class PurpleCheckerTest method testMissing.

@Test(expected = IOException.class)
public void testMissing() throws IOException {
    final RunContext runContext = TestRunContextFactory.forSomaticTest(BASE_DIRECTORY, REF_SAMPLE, "missing");
    checker.run(runContext);
}
Also used : RunContext(com.hartwig.hmftools.common.context.RunContext) Test(org.junit.Test)

Example 14 with RunContext

use of com.hartwig.hmftools.common.context.RunContext in project hmftools by hartwigmedical.

the class PurpleCheckerTest method extractDataFromPurpleWorksForSomatic.

@Test
public void extractDataFromPurpleWorksForSomatic() throws IOException {
    final RunContext runContext = TestRunContextFactory.forSomaticTest(BASE_DIRECTORY, REF_SAMPLE, TUMOR_SAMPLE);
    final BaseResult result = checker.run(runContext);
    Assert.assertEquals(CheckType.PURPLE, result.checkType());
    final List<HealthCheck> checks = ((MultiValueResult) result).checks();
    assertCheck(checks, PurpleCheck.AMBER_GENDER.toString(), "MALE");
    assertCheck(checks, PurpleCheck.COBALT_GENDER.toString(), "FEMALE");
    assertCheck(checks, PurpleCheck.PURPLE_SEGMENT_SCORE.toString(), "199");
}
Also used : BaseResult(com.hartwig.hmftools.healthchecker.result.BaseResult) MultiValueResult(com.hartwig.hmftools.healthchecker.result.MultiValueResult) RunContext(com.hartwig.hmftools.common.context.RunContext) Test(org.junit.Test)

Example 15 with RunContext

use of com.hartwig.hmftools.common.context.RunContext in project hmftools by hartwigmedical.

the class StrelkaCheckerTest method runsCorrectlyForSingleSample.

@Test
public void runsCorrectlyForSingleSample() throws IOException {
    final RunContext runContext = TestRunContextFactory.forSingleSampleTest(RUN_DIRECTORY, REF_SAMPLE);
    final BaseResult result = checker.run(runContext);
    assertTrue(result instanceof NoResult);
}
Also used : BaseResult(com.hartwig.hmftools.healthchecker.result.BaseResult) RunContext(com.hartwig.hmftools.common.context.RunContext) NoResult(com.hartwig.hmftools.healthchecker.result.NoResult) Test(org.junit.Test)

Aggregations

RunContext (com.hartwig.hmftools.common.context.RunContext)16 Test (org.junit.Test)9 File (java.io.File)5 CommandLine (org.apache.commons.cli.CommandLine)5 HelpFormatter (org.apache.commons.cli.HelpFormatter)5 Options (org.apache.commons.cli.Options)5 BaseResult (com.hartwig.hmftools.healthchecker.result.BaseResult)4 DatabaseAccess (com.hartwig.hmftools.patientdb.dao.DatabaseAccess)4 MultiValueResult (com.hartwig.hmftools.healthchecker.result.MultiValueResult)3 IOException (java.io.IOException)3 NotNull (org.jetbrains.annotations.NotNull)3 CpctEcrfModel (com.hartwig.hmftools.common.ecrf.CpctEcrfModel)2 Lims (com.hartwig.hmftools.common.lims.Lims)2 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 EcrfPatient (com.hartwig.hmftools.common.ecrf.datamodel.EcrfPatient)1 ValidationFinding (com.hartwig.hmftools.common.ecrf.datamodel.ValidationFinding)1 TumorLocationDoidMapping (com.hartwig.hmftools.common.ecrf.doid.TumorLocationDoidMapping)1 FormStatusModel (com.hartwig.hmftools.common.ecrf.formstatus.FormStatusModel)1 FormStatusReader (com.hartwig.hmftools.common.ecrf.formstatus.FormStatusReader)1