use of com.hartwig.hmftools.common.variant.structural.EnrichedStructuralVariant in project hmftools by hartwigmedical.
the class PatientReporter method analyseGenomeData.
@NotNull
private GenomeAnalysis analyseGenomeData(@NotNull final String sample, @NotNull final String runDirectory) throws IOException {
LOGGER.info(" Loading somatic snv and indels...");
final List<SomaticVariant> variants = PatientReporterHelper.loadPassedSomaticVariants(sample, runDirectory);
LOGGER.info(" " + variants.size() + " somatic passed snps, mnps and indels loaded for sample " + sample);
LOGGER.info(" Analyzing somatic snp/mnp and indels....");
final VariantAnalysis variantAnalysis = variantAnalyzer().run(variants);
LOGGER.info(" Loading purity numbers...");
final PurityContext context = PatientReporterHelper.loadPurity(runDirectory, sample);
if (context.status().equals(FittedPurityStatus.NO_TUMOR)) {
LOGGER.warn("PURPLE DID NOT DETECT A TUMOR. Proceed with utmost caution!");
}
final FittedPurity purity = context.bestFit();
final FittedPurityScore purityScore = context.score();
final List<PurpleCopyNumber> purpleCopyNumbers = PatientReporterHelper.loadPurpleCopyNumbers(runDirectory, sample);
final List<GeneCopyNumber> panelGeneCopyNumbers = PatientReporterHelper.loadPurpleGeneCopyNumbers(runDirectory, sample).stream().filter(x -> reporterData().panelGeneModel().panel().contains(x.gene())).collect(Collectors.toList());
LOGGER.info(" " + purpleCopyNumbers.size() + " purple copy number regions loaded for sample " + sample);
LOGGER.info(" Analyzing purple somatic copy numbers...");
final PurpleAnalysis purpleAnalysis = ImmutablePurpleAnalysis.builder().gender(context.gender()).status(context.status()).fittedPurity(purity).fittedScorePurity(purityScore).copyNumbers(purpleCopyNumbers).panelGeneCopyNumbers(panelGeneCopyNumbers).build();
final Path structuralVariantVCF = PatientReporterHelper.findStructuralVariantVCF(runDirectory);
LOGGER.info(" Loading structural variants...");
final List<StructuralVariant> structuralVariants = StructuralVariantFileLoader.fromFile(structuralVariantVCF.toString(), true);
LOGGER.info(" Enriching structural variants with purple data.");
final List<EnrichedStructuralVariant> enrichedStructuralVariants = purpleAnalysis.enrichStructuralVariants(structuralVariants);
LOGGER.info(" Analysing structural variants...");
final StructuralVariantAnalysis structuralVariantAnalysis = structuralVariantAnalyzer().run(enrichedStructuralVariants, false);
return ImmutableGenomeAnalysis.of(sample, variantAnalysis, purpleAnalysis, structuralVariantAnalysis);
}
Aggregations