Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bio-structural-biology-structure-navigation

БесплатноЗапускает вложенные скриптыНе проверен

Navigate the Bio.PDB SMCRA hierarchy (Structure-Model-Chain-Residue-Atom) safely, surfacing the heterogeneity it hides by default. Use when deciding how to…

lilinjiот lilinji★ 18 звёзд на GitHub

Об этом скилле

Version Compatibility

Reference examples tested with: biopython 1.83+

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Structure Navigation

"Walk the chains, residues, and atoms; pull out the sequence" -> Traverse the Structure-Model-Chain-Residue-Atom (SMCRA) tree, but treat every level as a lossy projection that hides heterogeneity unless asked otherwise.

  • Python: structure[0]['A'][(' ', 100, ' ')]['CA'].coord for full-tuple direct access

Governing Principle: SMCRA is a convenient tree that HIDES heterogeneity by default

The SMCRA model (Structure > Model > Chain > Residue > Atom) is a readable in-memory tree, but its defaults quietly collapse the very heterogeneity that changes the answer. Five traps recur, and none of them raises an error - the code runs and returns a plausible-looking number computed on the wrong thing.

  1. A DisorderedAtom silently forwards every uncaught call to ONE child - the HIGHEST-OCCUPANCY altloc, not literally altloc 'A'. So get_atoms(), .coord, distances, clashes, and RMSDs all use a single conformer, invisibly, even when the active site is 60/40 disordered. This is the #1 correctness trap. Enumerate with is_disordered() and disordered_get_list(); never let both altlocs of one atom enter the same geometric calculation.
  2. The residue id is a 3-tuple (hetflag, resseq, icode). Naive residue.id[1] drops both the hetero flag and the INSERTION CODE, so antibody residues 100, 100A, 100B collapse onto one key; chain[100] works only until an insertion code, a hetero residue, or an altloc residue exists at that number, then raises a KeyError that looks like the residue is missing. Key on the full tuple; reduce to id[1] only for display.
  3. The sequence PPBuilder extracts is the OBSERVED (ATOM-record) sequence with missing-density gaps silently concatenated away - it is NOT the SEQRES/construct/UniProt canonical sequence. A disordered 12-residue loop becomes 12 vanished characters with no marker, so mapping conservation or alignment columns by string position is off-by-many after the first gap. Map through residue NUMBERS (auth_seq_id) or SIFTS, never by string index.
  4. NMR and multi-state files have multiple Model objects. Iterating chains without first selecting a model conflates conformers; structure[0] silently picks one NMR member and over-claims precision. Ask "how many models and why" first.
  5. mmCIF carries two numbering schemes: auth (matches the paper, has insertion codes, can be negative/gapped) and label (gapless 1..N, no icodes). MMCIFParser defaults to auth; flip auth_residues=False and residue 100 becomes a different residue. Pick one scheme and stay in it.

Decision: which sequence source

These three "sequences" are routinely conflated; each answers a different question and the wrong one silently misindexes everything downstream.

Source What it is Get it via Use when Fails when
ATOM / observed Only residues with modeled coordinates; gaps concatenated away PPBuilder().build_peptides() then pp.get_sequence() Per-atom geometry, contacts, extracting exactly what was resolved Aligning to UniProt/MSA by string position (gaps shift the frame)
SEQRES / declared Full sequence the depositor says is in the crystal, including unresolved residues SeqIO.parse(file, 'pdb-seqres') or 'cif-seqres' Knowing the true construct length, locating missing loops Assuming every SEQRES residue has coordinates (it does not)
UniProt / canonical The reference biological sequence (no tags, no engineered mutations) database-access/uniprot-access + SIFTS residue mapping Mapping conservation/domains/mutations onto structure positions Assuming construct == canonical (tags, point mutations, chimeras differ)

Decision: residue selection idiom

Filter on the hetflag (id[0]), not the residue name, and know exactly what each idiom keeps and drops.

Goal Idiom Keeps / drops correctly?
Standard amino acids only r.id[0] == ' ' Correct; drops water, ligands, and modified residues
Water r.id[0] == 'W' Correct; water hetflag is 'W', NOT 'H_' - a startswith('H_') water strip MISSES water
Ligands and hetero groups r.id[0].startswith('H_') Also catches modified residues (MSE, SEP, PTR) mid-chain - not just free ligands
Strip hetero blindly r.id[0] != ' ' DANGEROUS - deletes catalytic metals, cofactors, AND selenomethionine (MSE) out of the chain
A specific residue type r.resname == 'ARG' Fine for type queries; never use resname to classify water vs ligand vs standard

R

Полный SKILL.md на GitHub

Установить bio-structural-biology-structure-navigation в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/enumerate_disorder.pyexamples/extract_sequence.pyexamples/find_ligands.pyexamples/iterate_structure.pyusage-guide.md

FAQ

Что делает скилл bio-structural-biology-structure-navigation?

Navigate the Bio.PDB SMCRA hierarchy (Structure-Model-Chain-Residue-Atom) safely, surfacing the heterogeneity it hides by default. Use when deciding how to handle altloc/DisorderedAtom conformers before a distance or RMSD, indexing residues insertion-code-safe with the full (hetflag, resseq, icode) tuple, choosing the ATOM/observed vs SEQRES/canonical vs UniProt sequence, selecting the right Model for an NMR ensemble, filtering waters/hetero/metals correctly, and reconciling auth vs label numbering. Keywords SMCRA, altloc, DisorderedAtom, insertion code, SEQRES, PPBuilder, auth_seq_id.

Как установить скилл bio-structural-biology-structure-navigation?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-structural-biology-structure-navigation запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bio-structural-biology-structure-navigation с