{% if biological_candidates %}
=== Antigen biology and targeting ===
Reference translation evidence and patient RNA support are separate.
Reference comparisons are not measurements of patient-normal protein.
{% for antigen in biological_candidates %}
{{ antigen.rank }}. {{ antigen.gene }} — {{ antigen.kind }}
{% for label, value in antigen.facts %}{{ label }}: {{ value }}
{% endfor %}Tumor: {{ antigen.sequence }} [source aa {{ antigen.sequence_start }}–{{ antigen.sequence_end }}]
{% for junction in antigen.junctions %}Junction: {{ junction.left }} -> {{ junction.right }}{% for start, end in junction.boundaries %}; {% if start == end %}after source aa {{ antigen.sequence_start - 1 + start }}{% else %}split codon at source aa {{ antigen.sequence_start + start }}{% endif %}{% endfor %}
{% endfor %}{% for comparison in antigen.comparisons %}{{ comparison.label }}:
{% for start in range(0, comparison.tumor | length, 65) %}Tumor  {{ comparison.tumor[start:start + 65] }}
       {{ comparison.differences[start:start + 65] }}
Ref    {{ comparison.reference[start:start + 65] }}
{% endfor %}{% else %}{% if antigen.kind != 'CTA' %}Normal/reference protein comparison not recorded.
{% endif %}{% endfor %}{% for target in antigen.targeting_preview %}{{ target.peptide }} [{{ target.start + 1 }}-{{ target.end }}]: {{ target.status }}; {{ target.source_summary }}
{% endfor %}
{% endfor %}{% endif %}
{% if cta_targeting_summary %}
=== CTA regions assessed against OncoRef ===
Positions are peptide starts (1-based), grouped by peptide length.
{% for source in cta_targeting_summary %}{{ source.gene }}{% if source.gene_id %} — {{ source.gene_id }}{% endif %}
{% for row in source.rows %}{{ row.length }} aa; starts {{ row.starts }}: {{ row.status }}{% if row.status == 'excluded' %} (do not target: Unsafe containment){% endif %}; {{ row.matches }}
{% endfor %}{% endfor %}{% endif %}
