use of net.sf.dynamicreports.report.datasource.DRDataSource in project hmftools by hartwigmedical.
the class GenePanelDataSource method fromHmfReporterData.
@NotNull
public static JRDataSource fromHmfReporterData(@NotNull final HmfReporterData reporterData) {
final DRDataSource genePanelDataSource = new DRDataSource(GENE_FIELD.getName(), TRANSCRIPT_FIELD.getName(), TYPE_FIELD.getName());
final List<HmfGenomeRegion> regions = Lists.newArrayList(reporterData.panelGeneModel().regions());
regions.sort(Comparator.comparing(HmfGenomeRegion::gene));
for (final HmfGenomeRegion region : regions) {
final String role = reporterData.cosmicGeneModel().getRoleForGene(region.gene());
genePanelDataSource.add(region.gene(), region.transcript(), role);
}
return genePanelDataSource;
}
use of net.sf.dynamicreports.report.datasource.DRDataSource in project hmftools by hartwigmedical.
the class GeneDisruptionDataSource method fromGeneDisruptions.
@NotNull
public static JRDataSource fromGeneDisruptions(@NotNull List<GeneDisruptionData> disruptions) {
final DRDataSource dataSource = new DRDataSource(CHROMOSOME_FIELD.getName(), CHROMOSOME_BAND_FIELD.getName(), GENE_FIELD.getName(), GENE_CONTEXT_FIELD.getName(), TYPE_FIELD.getName(), COPIES_FIELD.getName());
disruptions.forEach(disruption -> dataSource.add(disruption.chromosome(), disruption.chromosomeBand(), disruption.gene(), disruption.geneContext(), disruption.type(), disruption.copies()));
return dataSource;
}
use of net.sf.dynamicreports.report.datasource.DRDataSource in project hmftools by hartwigmedical.
the class GeneFusionDataSource method fromGeneFusions.
@NotNull
public static JRDataSource fromGeneFusions(@NotNull List<GeneFusionData> fusions) {
final DRDataSource dataSource = new DRDataSource(FUSION_FIELD.getName(), START_TRANSCRIPT_FIELD.getName(), END_TRANSCRIPT_FIELD.getName(), START_CONTEXT_FIELD.getName(), END_CONTEXT_FIELD.getName(), COPIES_FIELD.getName(), COSMIC_URL_TEXT.getName(), COSMIC_URL.getName());
fusions.forEach(fusion -> dataSource.add(name(fusion), fusion.geneStartTranscript(), fusion.geneEndTranscript(), fusion.geneContextStart(), fusion.geneContextEnd(), fusion.copies(), fusion.cosmicURL().isEmpty() ? Strings.EMPTY : name(fusion), fusion.cosmicURL()));
return dataSource;
}
use of net.sf.dynamicreports.report.datasource.DRDataSource in project hmftools by hartwigmedical.
the class PDFWriter method generateNotSequenceableReport.
@VisibleForTesting
@NotNull
static JasperReportBuilder generateNotSequenceableReport(@NotNull final NotSequencedPatientReport report) {
// MIVO: hack to get page footers working; the footer band and noData bands are exclusive, see additional comment below for details
final DRDataSource singleItemDataSource = new DRDataSource("item");
singleItemDataSource.add(new Object());
return report().pageFooter(cmp.pageXslashY()).lastPageFooter(cmp.verticalList(signatureFooter(report.signaturePath()), cmp.pageXslashY(), cmp.text("End of report.").setStyle(stl.style().setHorizontalTextAlignment(HorizontalTextAlignment.CENTER)))).addDetail(NonSequenceablePage.of(report).reportComponent()).setDataSource(singleItemDataSource);
}
use of net.sf.dynamicreports.report.datasource.DRDataSource in project hmftools by hartwigmedical.
the class PDFWriter method generatePatientReport.
@VisibleForTesting
@NotNull
static JasperReportBuilder generatePatientReport(@NotNull final SequencedPatientReport report, @NotNull final HmfReporterData reporterData) {
final ComponentBuilder<?, ?> totalReport = cmp.multiPageList().add(ImmutableFindingsPage.of(report, reporterData).reportComponent()).newPage().add(ImmutableCircosPage.of(report.circosPath()).reportComponent()).newPage().add(ImmutableGenePanelPage.of(reporterData).reportComponent()).newPage().add(ImmutableExplanationPage.builder().build().reportComponent()).newPage().add(SampleDetailsPage.of(report).reportComponent());
// MIVO: hack to get page footers working; the footer band and noData bands are exclusive:
// - footerBand, detailBand, etc are shown when data source is not empty
// - noData band is shown when data source is empty; intended to be used when there is no data to show in the report
// (e.g. would be appropriate to be used for notSequenceableReport)
//
// more info: http://www.dynamicreports.org/examples/bandreport
//
// todo: fix when implementing new report layout
final DRDataSource singleItemDataSource = new DRDataSource("item");
singleItemDataSource.add(new Object());
return report().pageFooter(cmp.pageXslashY()).lastPageFooter(cmp.verticalList(signatureFooter(report.signaturePath()), cmp.pageXslashY(), cmp.text("End of report.").setStyle(stl.style().setHorizontalTextAlignment(HorizontalTextAlignment.CENTER)))).addDetail(totalReport).setDataSource(singleItemDataSource);
}
Aggregations