This skill covers walking the Bio.PDB SMCRA hierarchy (Structure-Model-Chain-Residue-Atom) while surfacing the heterogeneity it hides by default. The tree is convenient but lossy: a DisorderedAtom silently forwards to one conformer, a residue key is a 3-tuple whose insertion code and hetero flag are routinely dropped, the sequence PPBuilder returns is the observed (ATOM) sequence with missing-density gaps concatenated away rather than the SEQRES or UniProt canonical sequence, and NMR files carry many models that naive iteration conflates. The skill turns each of those defaults into an explicit decision so the coordinates, sequence, and residue selection are statements about the molecule rather than artifacts of the parser.
pip install biopython
Tell your AI agent what you want to do: - "List all chains and how many residues each has" - "Extract the observed sequence from chain A and tell me where the density gaps are" - "Show every alternate conformation at residue 42 before I measure a distance" - "Find all ligands but keep the catalytic metal"
"Get residue 100A from chain H using the full residue id tuple"
"What are the coordinates of every altloc of the CB atom in residue 50?"
"Read this mmCIF with auth numbering so the residue numbers match the paper"
"Count amino acids, ligands, and waters per chain"
"List all C-alpha coordinates for model 0 only"
"Extract the observed sequence and compare its length to SEQRES"
"Build the one-letter sequence but map selenomethionine to M"
"Enumerate all disordered atoms in chain A and their occupancies"
"This is an NMR ensemble - compute per-model CA spread instead of using model 1"
Structure (whole PDB/mmCIF entry)
Model (NMR conformer, or the single asymmetric unit)
Chain (polypeptide, nucleic acid, or hetero groups)
Residue (amino acid, nucleotide, ligand, water)
Atom (individual atom; may be a DisorderedAtom)
disordered_get_list() before any distance or RMSD.(hetflag, resseq, icode); index with the full tuple and never drop the insertion code (antibody 100A/100B) or the hetero flag.pdb-seqres) for true length and map to UniProt by residue number or SIFTS, not by string position.'W', not 'H_'; a startswith('H_') water strip misses water and a blanket != ' ' strip deletes catalytic metals and mid-chain selenomethionine.