use of com.hartwig.hmftools.common.purple.qc.PurpleQC in project hmftools by hartwigmedical.
the class LoadPurpleData method main.
public static void main(@NotNull final String[] args) throws ParseException, IOException, SQLException {
final Options options = createBasicOptions();
final CommandLine cmd = createCommandLine(args, options);
final DatabaseAccess dbAccess = databaseAccess(cmd);
final String tumorSample = cmd.getOptionValue(SAMPLE);
final String purplePath = cmd.getOptionValue(PURPLE_DIR);
LOGGER.info("Persisting purity data");
final PurpleQC purpleQC = PurpleQCFile.read(PurpleQCFile.generateFilename(purplePath, tumorSample));
final PurityContext purityContext = FittedPurityFile.read(purplePath, tumorSample);
final List<FittedPurity> bestFitPerPurity = FittedPurityRangeFile.read(purplePath, tumorSample);
dbAccess.writePurity(tumorSample, purityContext, purpleQC);
dbAccess.writeBestFitPerPurity(tumorSample, bestFitPerPurity);
LOGGER.info("Persisting copy numbers");
final List<PurpleCopyNumber> copyNumbers = PurpleCopyNumberFile.read(purplePath, tumorSample);
dbAccess.writeCopynumbers(tumorSample, copyNumbers);
LOGGER.info("Persisting gene copy numbers");
final List<GeneCopyNumber> geneCopyNumbers = GeneCopyNumberFile.read(GeneCopyNumberFile.generateFilename(purplePath, tumorSample));
dbAccess.writeGeneCopynumberRegions(tumorSample, geneCopyNumbers);
LOGGER.info("Complete");
}
use of com.hartwig.hmftools.common.purple.qc.PurpleQC in project hmftools by hartwigmedical.
the class PurpleChecker method run.
@NotNull
public BaseResult run(@NotNull final RunContext runContext) throws IOException {
if (!runContext.isSomaticRun()) {
return new NoResult(CheckType.PURPLE);
}
final String purpleDirectory = runContext.runDirectory() + File.separator + "purple";
final PurpleQC qcCheck = PurpleQCFile.read(PurpleQCFile.generateFilename(purpleDirectory, runContext.tumorSample()));
final List<HealthCheck> checks = Lists.newArrayList();
final String segmentScore = String.valueOf(qcCheck.segmentScore());
checks.add(new HealthCheck(runContext.tumorSample(), PurpleCheck.PURPLE_SEGMENT_SCORE.toString(), segmentScore));
checks.add(new HealthCheck(runContext.tumorSample(), PurpleCheck.AMBER_GENDER.toString(), qcCheck.amberGender().toString()));
checks.add(new HealthCheck(runContext.tumorSample(), PurpleCheck.COBALT_GENDER.toString(), qcCheck.cobaltGender().toString()));
return toMultiValueResult(checks);
}
Aggregations