{ "cells": [ { "cell_type": "markdown", "id": "08a1bdac", "metadata": { "language": "markdown" }, "source": [ "# Example — GILGFVFTL / HLA-A*02:01 and the CDR3β Arg–Ser motif\n", "\n", "The influenza M1₅₈₋₆₆ epitope **GILGFVFTL** presented by **HLA-A*02:01** is recognised by a\n", "strongly biased, public T-cell response built on TRBV19, whose hallmark is a conserved\n", "**Arg–Ser (RS) motif** in CDR3β. The canonical structure is the **JM22** TCR (PDB **1oga**),\n", "with CDR3β `ASSSRSSYEQY` — the Arg and the following Ser reach into the peptide.\n", "\n", "This public RS motif is documented in **VDJdb** (Shugay M, Bagaev DV, Zvyagin IV, *et al.*,\n", "*Nucleic Acids Research* 2018;46(D1):D419–D427, https://doi.org/10.1093/nar/gkx760; record\n", "retrieved from PubMed, PMID 28977646). Here we orient 1oga into the canonical frame and use the\n", "tcren complementarity maps to show *where* the Arg–Ser residues contact the peptide. The\n", "structure is read only from the bootstrapped HF `Native2026` set." ] }, { "cell_type": "code", "execution_count": 1, "id": "7aa2908d", "metadata": { "execution": { "iopub.execute_input": "2026-06-16T12:54:12.372086Z", "iopub.status.busy": "2026-06-16T12:54:12.371923Z", "iopub.status.idle": "2026-06-16T12:54:17.958131Z", "shell.execute_reply": "2026-06-16T12:54:17.957664Z" }, "language": "python" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "python 3.11.15 | tcren 0.1.0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "peptide=GILGFVFTL CDR3β=ASSSRSSYEQY crossing=83° incident=-14°\n" ] } ], "source": [ "# Load the JM22 complex (1oga) from the HF set, type chains (arda), annotate the MHC groove.\n", "import warnings; warnings.filterwarnings('ignore')\n", "import sys\n", "from pathlib import Path\n", "import numpy as np, polars as pl, matplotlib, matplotlib.pyplot as plt\n", "import tcren\n", "from tcren.structure.io import import_structure\n", "from tcren.annotation import classify_chains\n", "from tcren.mhc import annotate_mhc\n", "from tcren.orient import docking_angles\n", "from tcren.project2d import (project_structure, residue_markup_table, contacts_table,\n", " ca_contacts_table, pocket_markers, region_pair_contacts)\n", "from tcren.viz import render_complementarity_map\n", "from IPython.display import SVG, display\n", "print('python', sys.version.split()[0], '| tcren', tcren.__version__)\n", "\n", "s = import_structure(Path('data/Native2026/1oga.pdb.gz'), pdb_id='1oga')\n", "classify_chains(s, organism='human'); annotate_mhc(s)\n", "cdr3b = next(r.sequence for c in s.chains if c.chain_type == 'TRB'\n", " for r in c.regions if r.region_type == 'CDR3')\n", "pep = next(c.sequence() for c in s.chains if c.chain_type == 'PEPTIDE')\n", "ang = docking_angles(s)\n", "print(f'peptide={pep} CDR3β={cdr3b} crossing={ang.crossing_angle:.0f}° incident={ang.incident_angle:.0f}°')" ] }, { "cell_type": "markdown", "id": "6f4264e9", "metadata": { "language": "markdown" }, "source": [ "## Where does the Arg–Ser motif touch the peptide?" ] }, { "cell_type": "code", "execution_count": 2, "id": "93ea9562", "metadata": { "execution": { "iopub.execute_input": "2026-06-16T12:54:17.959673Z", "iopub.status.busy": "2026-06-16T12:54:17.959559Z", "iopub.status.idle": "2026-06-16T12:54:17.976935Z", "shell.execute_reply": "2026-06-16T12:54:17.976557Z" }, "language": "python" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CDR3β residues contacting the peptide: ['R98', 'S100', 'S99']\n" ] }, { "data": { "text/html": [ "
| cdr3b_res | peptide_res | min_dist | contact_type | motif |
|---|---|---|---|---|
| str | str | f64 | str | bool |
| "S99" | "V6" | 3.09 | "hydrogen_bond" | true |
| "R98" | "F5" | 3.78 | "polar" | true |
| "S100" | "F5" | 3.82 | "polar" | true |
| "S99" | "F5" | 4.03 | "polar" | true |
| "R98" | "F7" | 4.16 | "hydrophobic" | true |
| "R98" | "V6" | 4.84 | "polar" | true |