К основному содержанию
скилл CX Codex

pymol — скилл для Claude Code: рендер белковых структур

Скилл для PyMOL: строит изображения белковых и молекулярных структур, делает выравнивания, меряет расстояния и контакты. Пригодится, когда есть файл структуры и нужна картинка или метрика.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add google-deepmind/science-skills --skill pymol -a claude-code
Открыть на GitHub

Что делает pymol

Скилл учит агента писать скрипты PyMOL и запускать их через uv. Рендеринг идёт через OSMesa — программно, без GPU, дисплея и X-сервера. Файл структуры сначала скачивают на машину, потом скрипт его загружает.

Внутри — набор готовых рецептов: раскраска по вторичной структуре, по B-factor и pLDDT, подсветка активных остатков, поверхность, электростатическая поверхность, раскраска цепей комплекса, поиск полостей, наложение двух структур с RMSD, in silico мутагенез. Каждый скрипт начинается с обязательной инициализации и заголовка PEP 0723, зависимости подтягивает uv run. Запускать скрипты нужно из каталога проекта, а в конце каждого — cmd.quit(), иначе процесс зависнет.

Для работы нужен установленный uv в PATH. Если файла .licenses/pymol_LICENSE.txt в корне проекта ещё нет, скилл просит проверить лицензию на https://www.pymol.org/ и создаёт файл с отметкой времени. Скилл не берётся за докинг, молекулярную динамику и предсказания AlphaFold, а при одной лишь последовательности без структуры сначала ищет способ её получить.

Какие задачи решает

  • отрендерить картинку белка из файла структуры
  • раскрасить модель по B-factor или pLDDT
  • наложить две структуры и получить RMSD
  • подсветить активный центр или сайт связывания лиганда
  • померить расстояние между остатками и подписать его

Примеры запросов агенту

  • Отрендери структуру из AF-P00520-F1-model_v4.cif в cartoon и раскрась по вторичной структуре
  • Наложи две структуры и покажи RMSD
  • Подсветь остатки в сайте связывания лиганда как sticks

Как установить pymol

1Через Skills CLI (Vercel)

npx skills add google-deepmind/science-skills --skill pymol -a claude-code

2Вручную: положить файлы

~/.claude/skills/pymol/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/pymol/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора39

chembl-database Скилл даёт агенту доступ к базе ChEMBL: молекулы, мишени, биоактивность, одобренные лекарства и поиск по структуре. CX Codex +1 2 200установок alphagenome-single-variant-analysis Скилл разбирает эффект генетического варианта в формате chr:pos:ref>alt через AlphaGenome API: экспрессия, доступность хроматина, гистоновые метки. CX Codex +1 2 200установок uniprot-database Скилл ищет белки, аннотации функций и последовательности в базах UniProtKB, UniParc и UniRef. Помогает сопоставлять идентификаторы и выгружать биологические данные. CX Codex +1 2 200установок openfda-database Ищет, считает и выгружает данные из openFDA API. Нужен для запросов о препаратах, отзывах, маркировке, NDC и событиях безопасности FDA. CX Codex +1 2 200установок ncbi-sequence-fetch Получает белковые и нуклеотидные последовательности из баз NCBI через E-utilities. Пригодится для поиска данных по номерам accession, генам, локусам, PubMed ID или патентам. CX Codex +1 2 200установок pubchem-database Скилл для работы с базой PubChem: ищет соединения по имени, CID или SMILES и вытаскивает свойства, безопасность и биоактивность. CX Codex +1 2 200установок alphafold-database-fetch-and-analyze Скачивает предсказанные структуры AlphaFold по UniProt ID и разбирает их: уверенность pLDDT, неупорядоченные участки, границы доменов. CX Codex +1 2 200установок pdb-database Ищет и выгружает экспериментальные 3D-структуры белков и лигандов из RCSB PDB по атрибутам, схожести последовательностей или химическому описанию. CX Codex +1 2 200установок

Похожие

anysearch anysearch-ai Скилл подключает поиск в интернете, тематические запросы, параллельный поиск и извлечение содержимого страниц. Пригодится, когда агенту нужны свежие сведения или нужно проверить утверждение. CX Codex +1 38 500установок academic-paper Imbad0202 Скилл разворачивает конвейер из 12 агентов для подготовки научных статей в 11 режимах. Помогает пройти путь от поиска литературы и плана до проверки цитат и ответа рецензентам. CX Codex +1 10 800установок nature-figure Yuan1z0825 Скилл собирает, правит и проверяет рисунки для научных статей на Python или R. Пригодится, когда графики идут в submission, а не в отчёт. CX Codex +1 18 800установок academic-paper-reviewer Imbad0202 Скилл имитирует коллегиальную проверку научной статьи через пять ролей. Пригодится для рецензии, повторной проверки правок и оценки методологии. CX Codex +1 9 800установок nature-polishing Yuan1z0825 Скилл для правки, перевода и сокращения готового академического текста. Держит факты, термины и границы доказательств на месте. CX Codex +1 17 500установок nature-citation Yuan1z skill, refactored into static/dynamic layers Ищет статьи из Nature и семейства CNS для подтверждения тезисов рукописи, связывает утверждения с источниками и готовит экспорт для менеджера ссылок. Пригодится, когда нужны ссылки именно из этих журналов. CX Codex +1 15 600установок

Вопросы о pymol

Как установить pymol в Claude Code?

Выполните npx skills add google-deepmind/science-skills --skill pymol -a claude-code. Скилл появится по пути ~/.claude/skills/pymol/SKILL.md.

Что делает скилл pymol?

Пишет и запускает скрипты PyMOL: рендерит структуры в PNG, сохраняет сессию .pse, считает расстояния, контакты и RMSD при наложении.

Что нужно, чтобы скилл заработал?

На хосте должен стоять uv в PATH. Зависимости скрипт объявляет в заголовке PEP 0723, и uv run ставит их сам, включая pymol-open-source-whl.

Исходный текст

SKILL.md · Apache-2.0
---
name: pymol
description: >
  Visualize, analyze, and render protein and molecular structures using PyMOL.
  Use when the user wants to create images of protein structures, perform
  structural alignments or superposition, measure distances or contacts,
  highlight binding sites or active site residues, color by B-factor/pLDDT,
  or analyze protein-ligand interactions. Do not use for docking,
  molecular dynamics, or sequence-only analysis.
---

# PyMOL

## Prerequisites

1.  **`uv`**: Read the `uv` skill and follow its Setup instructions to ensure
    `uv` is installed and on PATH.
2.  **User Notification**: If .licenses/pymol_LICENSE.txt does not already exist
    in the workspace root directory then (1) prominently notify the user to
    check the license at https://www.pymol.org/, then (2) create the file
    recording the notification text and timestamp.

## Overview

All PyMOL commands run on the host via `uv` with OSMesa software rendering — no
GPU, display, or X server is needed. Structure files must be downloaded to the
host before running PyMOL.

**Do NOT use when:**

-   The user wants to run AlphaFold predictions.
-   The user wants docking or molecular dynamics simulations.
-   The user only has a sequence and no structure file — fetch the structure
    first. Check if any other installed skills can retrieve structures from the
    PDB or AlphaFold Database before proceeding.

## Setup (Agent Instructions)

Ensure that `uv` is installed on the host system. The PyMOL scripts use PEP 0723
headers to declare their dependencies, and `uv run` will automatically handle
installing them (including `pymol-open-source-whl`) when the script is executed.

## Core Rules

-   **Output paths must be absolute or relative to the user's project root.**
    Always run PyMOL scripts from the user's project directory.
-   **Software rendering only.** Use `cmd.png()` for output. Never use
    `cmd.draw()` or `cmd.ray()` with hardware acceleration — OSMesa does not
    support it. Set environment variable `PYOPENGL_PLATFORM=osmesa` for headless
    rendering.
-   **Always save a `.pse` session file** alongside any PNG output. This lets
    the user open the session in their local PyMOL for further inspection.
-   **Always call `cmd.quit()`** at the end of every PyMOL script. Omitting it
    causes the process to stop responding.
-   **Init boilerplate is mandatory.** Every PyMOL script must begin with the
    initialization sequence. `from pymol import cmd` must come after
    `finish_launching()`, not before.
-   See [references/PYMOL_REFERENCE.md](references/PYMOL_REFERENCE.md) for
    selection syntax, common commands, and gotchas.
-   **Pre-Flight File Check**: Before writing the PyMOL script or running it,
    you MUST verify that the requested structure file actually exists on the
    host machine.
-   **Verify Structure Load**: After loading a structure with `cmd.load()`,
    always verify it succeeded by checking `cmd.count_atoms("all")`. If the
    result is 0, print an error to stdout and call `cmd.quit()` immediately.
-   **Auto-detect Alpha-Carbon Trace**: For a **cartoon** representation your
    PyMOL scripts should automatically detect if the structure is an
    alpha-carbon trace (`cmd.count_atoms("name CA") == cmd.count_atoms("all")`),
    then you MUST follow the **Alpha carbon trace cartoon** recipe.
-   **Notification**: If this skill is used, ensure this is mentioned in the
    output.

## Quick Start

*   Ensure structure files are downloaded to a directory in the user's project.
*   Write a PyMOL Python script (e.g., `render.py`) with the required init
    boilerplate and PEP 0723 header.
*   Run it via `uv run`: `bash uv run render.py`

### Minimal example script (`render.py`)

```python
# /// script
# requires-python = ">=3.10, <3.13"
# dependencies = [
#     "pymol-open-source-whl",
# ]
# ///

import os
import sys

# Set environment variable for headless rendering
os.environ["PYOPENGL_PLATFORM"] = "osmesa"

import pymol # pytype: disable=import-error
pymol.pymol_argv = ["pymol", "-cq"]
pymol.finish_launching()

from pymol import cmd # pytype: disable=import-error

cmd.load("AF-P00520-F1-model_v4.cif", "structure")
cmd.show("cartoon")
cmd.color("green", "ss h")
cmd.color("yellow", "ss s")
cmd.color("gray", "ss l+''")
cmd.orient()
cmd.set("ray_opaque_background", 1)
cmd.png("output/render.png", width=1200, height=900, dpi=150)
cmd.save("output/session.pse")
cmd.quit()
```

## Common Recipes

See [references/RECIPES.md](references/RECIPES.md) for complete, copy-paste
ready recipes. Available recipes:

-   **Cartoon with secondary structure coloring** — basic helix/sheet/loop
    coloring
-   **Alpha carbon trace cartoon** — force cartoon representation for CA-only
    structures
-   **B-factor (pLDDT) coloring** — continuous spectrum coloring by B-factor
-   **AlphaFold pLDDT coloring** — canonical threshold-based confidence colors
-   **Highlight specific residues** — show active site or key residues as sticks
-   **Surface rendering** — transparent surface over cartoon
-   **Electrostatic surface rendering** — vacuum electrostatics (qualitative)
-   **Multi-chain complex colors** — automatic per-chain coloring
-   **B-factor putty analysis** — tube width proportional to flexibility
-   **Cavity and pocket visualization** — surface cavity detection with ligand
    focus
-   **Multi-structure batch rendering** — render a directory of structures
-   **Measure distance between residues** — CA–CA distance with labels
-   **Zoom into binding pocket** — simple pocket focus
-   **Protein-ligand interaction** — ligand isolation, styled rendering, polar
    contacts
-   **Two-structure superposition with RMSD** — align/cealign with auto-fallback
-   **In silico mutagenesis** — mutate residues with the mutagenesis wizard
-   **Load and modify an existing session** — re-open a `.pse` file

## Interpreting Output

-   The `output/` directory contains PNG images and a `.pse` session file.
-   Any measurements or metrics (distances, RMSD, atom counts) are printed to
    stdout by the PyMOL script. Report these values to the user.
-   Present PNG images to the user and describe the visualization.
-   Tell the user they can open the `.pse` file in their local PyMOL to further
    explore, rotate, or modify the visualization.
-   If the user wants modifications, load the saved `.pse` in a new script and
    re-run.
-   Large sessions with surfaces can exceed the `--max_output_mb` limit (default
    500 MB). Increase it with `--max_output_mb=1000` if needed.

© google-deepmind · Apache-2.0 · google-deepmind/science-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой