{ "cells": [ { "cell_type": "markdown", "id": "40131c37", "metadata": { "language": "markdown" }, "source": [ "# 3D peptide-binding pocket with CDR overlay\n", "\n", "Interactive [py3Dmol](https://3dmol.csb.pitt.edu/) view (histo.fyi-style) of the MHC groove with\n", "the peptide and the overlaid TCR CDR1-3 loops, in the canonical (oriented) frame. The py3Dmol\n", "widget is interactive in a live Jupyter kernel; the static docs build cannot render the widget, so\n", "a matplotlib snapshot of the same oriented interface is shown at the end as a fallback." ] }, { "cell_type": "code", "execution_count": 1, "id": "cd791730", "metadata": { "execution": { "iopub.execute_input": "2026-06-16T12:53:58.333343Z", "iopub.status.busy": "2026-06-16T12:53:58.333274Z", "iopub.status.idle": "2026-06-16T12:54:03.667271Z", "shell.execute_reply": "2026-06-16T12:54:03.666625Z" }, "language": "python" }, "outputs": [ { "data": { "text/plain": [ "[MhcCall(chain_id='D', chain_role='MHCa', mhc_class='MHCI', allele='HLA-A*02:1219N', locus='A', species='human', identity=100.0, bits=596.0, qstart=1, qend=274, tstart=25, tend=298, cigar='274M'),\n", " MhcCall(chain_id='E', chain_role='B2M', mhc_class='MHCI', allele='B2M', locus='B2M', species='human', identity=97.9, bits=212.0, qstart=1, qend=99, tstart=21, tend=119, cigar='99M')]" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Load + annotate a native complex\n", "from tcren.structure import parse_structure\n", "from tcren.annotation import classify_chains\n", "from tcren.mhc import annotate_mhc\n", "\n", "structure = parse_structure('data/Native2026/1ao7.pdb.gz', pdb_id='1ao7')\n", "classify_chains(structure, organism='human')\n", "annotate_mhc(structure)" ] }, { "cell_type": "code", "execution_count": 2, "id": "7f06f6b6", "metadata": { "execution": { "iopub.execute_input": "2026-06-16T12:54:03.668720Z", "iopub.status.busy": "2026-06-16T12:54:03.668584Z", "iopub.status.idle": "2026-06-16T12:54:08.749598Z", "shell.execute_reply": "2026-06-16T12:54:08.749022Z" }, "language": "python" }, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.