',
+ f'Functional dependency — {html_escape(_release_name(evidence.release_identifier), quote=True)}
',
+ ]
+ for section in sections:
+ heading, content = section.split("\n", 1)
+ if not heading.startswith("### "):
+ raise DependencyPresentationError("invalid_dependency_presentation_structure")
+ rendered.append(f"{html_escape(heading[4:], quote=True)}
")
+ rendered.append(f'{html_escape(content, quote=True)}')
+ rendered.append("")
+ return "\n".join(rendered) + "\n"
diff --git a/targetintel/html_reports.py b/targetintel/html_reports.py
index 2f4b3e4..50c8809 100644
--- a/targetintel/html_reports.py
+++ b/targetintel/html_reports.py
@@ -22,6 +22,11 @@
make_feasibility_report_section,
render_feasibility_html,
)
+from targetintel.functional_dependency.presentation import (
+ DependencyPresentationError,
+ render_dependency_html,
+)
+from targetintel.functional_dependency.report_contract import DependencyReportEvidence
DEFAULT_HTML_REPORT_DIR = Path("results/html_reports")
@@ -374,6 +379,7 @@ def make_target_html_report(
evidence_card: EvidenceCard | None = None,
feasibility_annotations: tuple[object, ...] | list[object] | None = None,
feasibility_target_identifier_type: str | None = None,
+ dependency_evidence: DependencyReportEvidence | None = None,
) -> str:
"""
Generate one standalone HTML target report.
@@ -401,6 +407,13 @@ def make_target_html_report(
annotations=feasibility_annotations,
))
feasibility_suffix = f"\n\n{feasibility_html}" if feasibility_html else ""
+ dependency_suffix = ""
+ if dependency_evidence is not None:
+ if not isinstance(dependency_evidence, DependencyReportEvidence):
+ raise DependencyPresentationError("invalid_dependency_report_evidence")
+ if dependency_evidence.gene_symbol != symbol:
+ raise DependencyPresentationError("dependency_evidence_target_mismatch")
+ dependency_suffix = f"\n\n{render_dependency_html(dependency_evidence)}"
html = f"""
@@ -443,7 +456,7 @@ def make_target_html_report(
-{_make_evidence_html(evidence_card)}{feasibility_suffix}
+{_make_evidence_html(evidence_card)}{feasibility_suffix}{dependency_suffix}