Search in sources :

Example 1 with BaseReporterData

use of com.hartwig.hmftools.patientreporter.BaseReporterData in project hmftools by hartwigmedical.

the class PatientReporterTest method canRunOnRunDirectory.

@Test
public void canRunOnRunDirectory() throws IOException {
    final GeneModel geneModel = new GeneModel(HmfGenePanelSupplier.hmfPanelGeneMap());
    final BaseReporterData baseReporterData = testBaseReporterData();
    final HmfReporterData reporterData = testHmfReporterData();
    final VariantAnalyzer variantAnalyzer = VariantAnalyzer.of(geneModel, reporterData.microsatelliteAnalyzer());
    final StructuralVariantAnalyzer svAnalyzer = new StructuralVariantAnalyzer(new TestAnnotator(), geneModel.regions(), CosmicFusions.readFromCSV(FUSIONS_CSV));
    final PatientReporter algo = ImmutablePatientReporter.of(baseReporterData, reporterData, variantAnalyzer, svAnalyzer, mockedCivicAnalyzer());
    assertNotNull(algo.run(RUN_DIRECTORY, null));
}
Also used : StructuralVariantAnalyzer(com.hartwig.hmftools.svannotation.analysis.StructuralVariantAnalyzer) VariantAnalyzer(com.hartwig.hmftools.patientreporter.variants.VariantAnalyzer) BaseReporterData(com.hartwig.hmftools.patientreporter.BaseReporterData) PatientReporterTestUtil.testBaseReporterData(com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testBaseReporterData) StructuralVariantAnalyzer(com.hartwig.hmftools.svannotation.analysis.StructuralVariantAnalyzer) GeneModel(com.hartwig.hmftools.common.gene.GeneModel) HmfReporterData(com.hartwig.hmftools.patientreporter.HmfReporterData) PatientReporterTestUtil.testHmfReporterData(com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testHmfReporterData) Test(org.junit.Test)

Example 2 with BaseReporterData

use of com.hartwig.hmftools.patientreporter.BaseReporterData in project hmftools by hartwigmedical.

the class PDFWriterTest method canGenerateSequenceReport.

@Test
public void canGenerateSequenceReport() throws DRException, IOException {
    final double pathologyTumorPercentage = 0.6;
    final double impliedTumorPurity = 0.58;
    final int mutationalLoad = 361;
    final double microsatelliteIndicator = 2.1;
    final HmfReporterData reporterData = testHmfReporterData();
    final BaseReporterData baseReporterData = testBaseReporterData();
    final FittedPurity fittedPurity = createFittedPurity(impliedTumorPurity);
    final List<VariantReport> variants = createTestVariants(new PurityAdjuster(Gender.MALE, fittedPurity));
    final List<GeneCopyNumber> copyNumbers = createTestCopyNumbers();
    final List<GeneDisruptionData> disruptions = createTestDisruptions();
    final List<GeneFusionData> fusions = createTestFusions();
    final SampleReport sampleReport = testSampleReport(pathologyTumorPercentage);
    final List<Alteration> alterations = RUN_CIVIC_ANALYSIS ? PatientReporterTestUtil.runCivicAnalysis(variants, copyNumbers, disruptions, fusions, reporterData.panelGeneModel(), sampleReport.cancerType()) : mockedAlterations();
    final SequencedPatientReport patientReport = ImmutableSequencedPatientReport.of(sampleReport, variants, mutationalLoad, microsatelliteIndicator, copyNumbers, disruptions, fusions, PatientReportFormat.formatPercent(impliedTumorPurity), alterations, Resources.getResource("circos" + File.separator + "circos_example.png").getPath(), Optional.of("this is a test report and does not relate to any real CPCT patient"), baseReporterData.signaturePath());
    final JasperReportBuilder mainReport = PDFWriter.generatePatientReport(patientReport, reporterData);
    assertNotNull(mainReport);
    final JasperReportBuilder evidenceReport = EvidenceReport.generate(patientReport);
    assertNotNull(evidenceReport);
    if (SHOW_AND_PRINT) {
        mainReport.show().print();
    }
    if (WRITE_TO_PDF) {
        mainReport.toPdf(new FileOutputStream(REPORT_BASE_DIR + File.separator + "test_report.pdf"));
        evidenceReport.toPdf(new FileOutputStream(REPORT_BASE_DIR + File.separator + "test_evidence_report.pdf"));
    }
}
Also used : PurityAdjuster(com.hartwig.hmftools.common.purple.PurityAdjuster) ImmutableSequencedPatientReport(com.hartwig.hmftools.patientreporter.ImmutableSequencedPatientReport) SequencedPatientReport(com.hartwig.hmftools.patientreporter.SequencedPatientReport) NotSequencedPatientReport(com.hartwig.hmftools.patientreporter.NotSequencedPatientReport) ImmutableNotSequencedPatientReport(com.hartwig.hmftools.patientreporter.ImmutableNotSequencedPatientReport) PatientReporterTestUtil.testBaseReporterData(com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testBaseReporterData) BaseReporterData(com.hartwig.hmftools.patientreporter.BaseReporterData) ImmutableSampleReport(com.hartwig.hmftools.patientreporter.ImmutableSampleReport) SampleReport(com.hartwig.hmftools.patientreporter.SampleReport) GeneDisruptionData(com.hartwig.hmftools.patientreporter.report.data.GeneDisruptionData) ImmutableGeneDisruptionData(com.hartwig.hmftools.patientreporter.report.data.ImmutableGeneDisruptionData) VariantReport(com.hartwig.hmftools.patientreporter.variants.VariantReport) ImmutableVariantReport(com.hartwig.hmftools.patientreporter.variants.ImmutableVariantReport) Alteration(com.hartwig.hmftools.patientreporter.report.data.Alteration) JasperReportBuilder(net.sf.dynamicreports.jasper.builder.JasperReportBuilder) HmfReporterData(com.hartwig.hmftools.patientreporter.HmfReporterData) PatientReporterTestUtil.testHmfReporterData(com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testHmfReporterData) GeneFusionData(com.hartwig.hmftools.patientreporter.report.data.GeneFusionData) ImmutableGeneFusionData(com.hartwig.hmftools.patientreporter.report.data.ImmutableGeneFusionData) GeneCopyNumber(com.hartwig.hmftools.common.gene.GeneCopyNumber) ImmutableGeneCopyNumber(com.hartwig.hmftools.common.gene.ImmutableGeneCopyNumber) FileOutputStream(java.io.FileOutputStream) ImmutableFittedPurity(com.hartwig.hmftools.common.purple.purity.ImmutableFittedPurity) FittedPurity(com.hartwig.hmftools.common.purple.purity.FittedPurity) Test(org.junit.Test)

Aggregations

BaseReporterData (com.hartwig.hmftools.patientreporter.BaseReporterData)2 HmfReporterData (com.hartwig.hmftools.patientreporter.HmfReporterData)2 PatientReporterTestUtil.testBaseReporterData (com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testBaseReporterData)2 PatientReporterTestUtil.testHmfReporterData (com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testHmfReporterData)2 Test (org.junit.Test)2 GeneCopyNumber (com.hartwig.hmftools.common.gene.GeneCopyNumber)1 GeneModel (com.hartwig.hmftools.common.gene.GeneModel)1 ImmutableGeneCopyNumber (com.hartwig.hmftools.common.gene.ImmutableGeneCopyNumber)1 PurityAdjuster (com.hartwig.hmftools.common.purple.PurityAdjuster)1 FittedPurity (com.hartwig.hmftools.common.purple.purity.FittedPurity)1 ImmutableFittedPurity (com.hartwig.hmftools.common.purple.purity.ImmutableFittedPurity)1 ImmutableNotSequencedPatientReport (com.hartwig.hmftools.patientreporter.ImmutableNotSequencedPatientReport)1 ImmutableSampleReport (com.hartwig.hmftools.patientreporter.ImmutableSampleReport)1 ImmutableSequencedPatientReport (com.hartwig.hmftools.patientreporter.ImmutableSequencedPatientReport)1 NotSequencedPatientReport (com.hartwig.hmftools.patientreporter.NotSequencedPatientReport)1 SampleReport (com.hartwig.hmftools.patientreporter.SampleReport)1 SequencedPatientReport (com.hartwig.hmftools.patientreporter.SequencedPatientReport)1 Alteration (com.hartwig.hmftools.patientreporter.report.data.Alteration)1 GeneDisruptionData (com.hartwig.hmftools.patientreporter.report.data.GeneDisruptionData)1 GeneFusionData (com.hartwig.hmftools.patientreporter.report.data.GeneFusionData)1