Skip to content

Commit 7d8156b

Browse files
committed
ODR pdf reformatting
1 parent 8524f98 commit 7d8156b

1 file changed

Lines changed: 29 additions & 15 deletions

File tree

bin/create_report.py

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4263,7 +4263,7 @@ def create_run_highlights_box(samples_dict, args, available_width, styles):
42634263
heading_style = ParagraphStyle(
42644264
'RunHighlightsHeading',
42654265
parent=styles['Heading2'],
4266-
fontSize=12,
4266+
fontSize=14,
42674267
leading=14,
42684268
alignment=TA_CENTER,
42694269
textColor=colors.HexColor("#1E2A32"),
@@ -4883,7 +4883,7 @@ def draw_header(canvas, doc):
48834883
spaceAfter=6,
48844884
))
48854885
story.append(Spacer(1, 0.03*inch))
4886-
for sample_name in sorted(samples_dict.keys()):
4886+
for sample_number, sample_name in enumerate(sorted(samples_dict.keys()), start=1):
48874887
bookmark_name = f"sample_{sanitize_bookmark_name(sample_name)}"
48884888
story.append(AnchorFlowable(bookmark_name))
48894889

@@ -4950,11 +4950,11 @@ def _pick_threshold(cutoffs_dict):
49504950
_cutoff_source_value = _conf_src if _conf_src else '—'
49514951

49524952
_sample_title = Table(
4953-
[[Paragraph(f'{sample_name}', sample_title_style)]],
4953+
[[Paragraph(f'Sample {sample_number}: {sample_name}', sample_title_style)]],
49544954
colWidths=[available_width],
49554955
)
49564956
_sample_title.setStyle(TableStyle([
4957-
('BACKGROUND', (0, 0), (-1, -1), colors.HexColor('#F4F8FB')),
4957+
('BACKGROUND', (0, 0), (-1, -1), colors.HexColor('#DCE6EE')),
49584958
('LEFTPADDING', (0, 0), (-1, -1), 10),
49594959
('RIGHTPADDING', (0, 0), (-1, -1), 8),
49604960
('TOPPADDING', (0, 0), (-1, -1), 8),
@@ -5019,10 +5019,7 @@ def _pick_threshold(cutoffs_dict):
50195019
_sample_card.setStyle(TableStyle(_sample_card_style))
50205020
story.append(KeepTogether([_sample_card,
50215021
Spacer(1, 0.03*inch)]))
5022-
if sampletype in ['blood', 'csf', 'sterile', 'serum']:
5023-
story.append(Paragraph(f"<font color=\"#666666\">\t&#8594; {sampletype} sample likely leads to lower TASS scores due to relatively low read count or coverage of organisms. All pathogens are defaulted to primary pathogens.</font>", small_style))
5024-
if sampletype != "blood":
5025-
story.append(Paragraph(f"<font color=\"#666666\">\t&#8594; {sampletype} follows the same anticipated clinical distribution as blood samples.</font>", small_style))
5022+
50265023
# ── Check if any qualifying strains have below-threshold zscore ───
50275024
# If so, add a note explaining the diamond symbol and faded rows.
50285025
_zt_note = args.zscore_threshold
@@ -5198,7 +5195,7 @@ def _pair_has_flora(pair):
51985195

51995196
story.append(HRFlowable(
52005197
width="100%",
5201-
thickness=1.5,
5198+
thickness=1.0,
52025199
color=colors.HexColor('#AABBC8'),
52035200
spaceBefore=0,
52045201
spaceAfter=0,
@@ -5487,33 +5484,50 @@ def _render_isil_section(sim_label, comp_key, miss_list, so_comp_key):
54875484
discussions_url = "https://github.com/jhuapl-bio/taxtriage/discussions"
54885485
issues_url = "https://github.com/jhuapl-bio/taxtriage/issues"
54895486

5487+
story.append(Paragraph(
5488+
"• Sterile samples (<b>blood, CSF, sterile, and serum</b>) may yield lower TASS scores due to relatively low read count or limited genomic coverage. "
5489+
"All detected pathogens for these sample types are therefore classified as <b>primary pathogens</b> by default.",
5490+
metadata_style
5491+
))
5492+
story.append(Spacer(1, 0.05*inch))
5493+
54905494
story.append(Paragraph(
54915495
"• Sample names and species groups throughout the report are hyperlinked for navigation. "
54925496
"Selecting a sample or organism entry will jump directly to its corresponding section in the document.",
54935497
metadata_style
54945498
))
5495-
story.append(Spacer(1, 0.03*inch))
5499+
story.append(Spacer(1, 0.05*inch))
5500+
5501+
story.append(Paragraph(
5502+
"• Organism groups are sorted by TASS score by default, or alphabetically when the alphabetical sorting option is enabled. ",
5503+
metadata_style
5504+
))
5505+
story.append(Spacer(1, 0.05*inch))
5506+
5507+
story.append(Paragraph(
5508+
"• Only samples and organism groups containing visible qualifying strains are included in the index and navigation sections. ",
5509+
metadata_style
5510+
))
5511+
story.append(Spacer(1, 0.05*inch))
54965512

54975513
story.append(Paragraph(
5498-
"• Organism groups are sorted by TASS score by default, or alphabetically when the alphabetical sorting option is enabled. "
5499-
"• Only samples and organism groups containing visible qualifying strains are included in the index and navigation sections. "
55005514
"• When subkey grouping is enabled, each genus-level group expands into species/subkey summary rows followed by qualifying child strains that also pass the reporting threshold.",
55015515
metadata_style
55025516
))
5503-
story.append(Spacer(1, 0.03*inch))
5517+
story.append(Spacer(1, 0.05*inch))
55045518

55055519
story.append(Paragraph(
55065520
"• Low-confidence, high-consequence detections that do not appear in the PDF report may still be present in the corresponding Discovery Analysis TXT output file.",
55075521
metadata_style
55085522
))
5509-
story.append(Spacer(1, 0.03*inch))
5523+
story.append(Spacer(1, 0.05*inch))
55105524

55115525
story.append(Paragraph(
55125526
f'• Please visit our <a href="{url2}"><b><font color="blue">DOCUMENTATION PAGE</font></b></a> '
55135527
f'for additional details on TASS confidence scoring.',
55145528
metadata_style
55155529
))
5516-
story.append(Spacer(1, 0.05*inch))
5530+
story.append(Spacer(1, 0.08*inch))
55175531

55185532
story.append(Paragraph(
55195533
f'Questions, feedback, or issues related to this report or the TaxTriage workflow can be submitted through the GitHub repository. '

0 commit comments

Comments
 (0)