use of net.sf.dynamicreports.jasper.builder.JasperReportBuilder in project hmftools by hartwigmedical.
the class PDFWriterTest method canGenerateLowTumorPercentageReport.
@Test
public void canGenerateLowTumorPercentageReport() throws DRException, IOException {
final JasperReportBuilder report = generateNotSequenceableCPCTReport(0.1, NotSequenceableReason.LOW_TUMOR_PERCENTAGE);
assertNotNull(report);
if (SHOW_AND_PRINT) {
report.show().print();
}
if (WRITE_TO_PDF) {
report.toPdf(new FileOutputStream(REPORT_BASE_DIR + File.separator + "hmf_low_tumor_percentage_report.pdf"));
}
}
use of net.sf.dynamicreports.jasper.builder.JasperReportBuilder 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"));
}
}
use of net.sf.dynamicreports.jasper.builder.JasperReportBuilder in project hmftools by hartwigmedical.
the class PDFWriter method writeNonSequenceableReport.
public void writeNonSequenceableReport(@NotNull final NotSequencedPatientReport report) throws IOException, DRException {
final JasperReportBuilder reportBuilder = generateNotSequenceableReport(report);
writeReport(fileName(report.sampleReport().sampleId(), "_hmf_report.pdf"), reportBuilder);
}
use of net.sf.dynamicreports.jasper.builder.JasperReportBuilder in project hmftools by hartwigmedical.
the class PDFWriter method writeSequenceReport.
public void writeSequenceReport(@NotNull final SequencedPatientReport report, @NotNull final HmfReporterData reporterData) throws IOException, DRException {
final JasperReportBuilder reportBuilder = generatePatientReport(report, reporterData);
writeReport(fileName(report.sampleReport().sampleId(), "_hmf_report.pdf"), reportBuilder);
final JasperReportBuilder evidenceReportBuilder = EvidenceReport.generate(report);
writeReport(fileName(report.sampleReport().sampleId(), "_evidence_items.pdf"), evidenceReportBuilder);
}
use of net.sf.dynamicreports.jasper.builder.JasperReportBuilder in project hmftools by hartwigmedical.
the class PDFWriterTest method canGenerateLowDNAYieldReport.
@Test
public void canGenerateLowDNAYieldReport() throws DRException, IOException {
final JasperReportBuilder report = generateNotSequenceableCPCTReport(0.6, NotSequenceableReason.LOW_DNA_YIELD);
assertNotNull(report);
if (SHOW_AND_PRINT) {
report.show().print();
}
if (WRITE_TO_PDF) {
report.toPdf(new FileOutputStream(REPORT_BASE_DIR + File.separator + "hmf_low_dna_yield_report.pdf"));
}
}
Aggregations