COURSE_DIR and environment validation.Before we launch the OpenMM demos, review two focused notebooks to explore the inputs.
<a href="/Curso-MD-Analisis/episodes/notebooks/01-introduction-sequence-check.ipynb">01-introduction-sequence-check.ipynb</a> now focuses on the protein2-ligand2.pdb coordinates and extracts the amino-acid sequence for the two chains before the simulation steps.<a href="/Curso-MD-Analisis/episodes/notebooks/01-introduction-ligand-check.ipynb">01-introduction-ligand-check.ipynb</a> explores the new $COURSE_DIR/data/complex/ligand2.sdf entry with RDKit, reports its properties, and sketches the ligand before combining it with OpenMM.Recorrer esta versión guiada del episodio muestra la estructura del directorio COURSE_DIR, explica cómo leer un PDB con Biopython y prepara el sistema de alanina para el flujo de trabajo básico. (notebook |
script) |
$COURSE_DIR/data/complex/protein2-ligand2.pdb with the new <a href="/Curso-MD-Analisis/episodes/notebooks/01-introduccion-protein2-nglview.ipynb">complex viewer</a> to inspect the binding pose with nglview.bash docs/episodes/scripts/01-split-protein2-ligand2.sh and check the standalone protein in <a href="/Curso-MD-Analisis/episodes/notebooks/01-introduccion-protein2-protein-nglview.ipynb">protein viewer</a> as well as the ligand in <a href="/Curso-MD-Analisis/episodes/notebooks/01-introduccion-protein2-ligand-nglview.ipynb">ligand viewer</a>.Recreate the canonical protein2.pdb / ligand2.pdb pair any time the $COURSE_DIR/data/complex folder changes by running the helper script below (copy/paste from the repository). It assumes the full complex resides in $COURSE_DIR/data/complex/protein2-ligand2.pdb:
#!/usr/bin/env bash
set -euo pipefail
COURSE_DIR="${COURSE_DIR:-$HOME/Concepcion26}"
INPUT_PATH="$COURSE_DIR/data/complex/protein2-ligand2.pdb"
OUTPUT_DIR="$COURSE_DIR/data/complex"
if [[ ! -f "$INPUT_PATH" ]]; then
echo "Error: missing $INPUT_PATH" >&2
exit 1
fi
mkdir -p "$OUTPUT_DIR"
python - <<PY
from pathlib import Path
input_path = Path("$INPUT_PATH")
output_dir = Path("$OUTPUT_DIR")
protein_path = output_dir / "protein2.pdb"
ligand_path = output_dir / "ligand2.pdb"
protein_lines = []
ligand_lines = []
with input_path.open("r") as fh:
for line in fh:
if line.startswith("HETATM") and line[17:20].strip() == "SUB":
ligand_lines.append(line)
else:
protein_lines.append(line)
protein_path.write_text("".join(protein_lines))
ligand_path.write_text("".join(ligand_lines))
print(f"Saved protein {protein_path}")
print(f"Saved ligand {ligand_path}")
PY
Run this once after updating the data bundle so every episode reads the same split files.
| Esta versión completa repasa la preparación del complejo proteína-ligando: secuencia rápida con Biopython, visualización con nglview y escritura de archivos Amber para la simulación. (notebook | script) |
nglview viewers keep the same split seen above but in interactive form: complex viewer, protein viewer, and ligand viewer.