Agent Skillssynthetic-sciences/openscience › molecule-visualization

molecule-visualization

GitHub

用于生成出版级分子可视化图像,支持2D结构图、分子网格对比、骨架高亮、蛋白配体相互作用及3D交互视图,服务于药物发现与计算化学工作流。

backend/cli/skills/chemistry/molecule-visualization/SKILL.md synthetic-sciences/openscience

Trigger Scenarios

生成分子结构图片 绘制蛋白配体结合模式图 进行构效关系SAR分析

Install

npx skills add synthetic-sciences/openscience --skill molecule-visualization -g -y
More Options

Non-standard path

npx skills add https://github.com/synthetic-sciences/openscience/tree/main/backend/cli/skills/chemistry/molecule-visualization -g -y

Use without installing

npx skills use synthetic-sciences/openscience@molecule-visualization

指定 Agent (Claude Code)

npx skills add synthetic-sciences/openscience --skill molecule-visualization -a claude-code -g -y

安装 repo 全部 skill

npx skills add synthetic-sciences/openscience --all -g -y

预览 repo 内 skill

npx skills add synthetic-sciences/openscience --list

SKILL.md

Frontmatter
{
    "name": "molecule-visualization",
    "license": "MIT",
    "category": "chemistry",
    "metadata": {
        "skill-author": "Synthetic Sciences"
    },
    "description": "Publication-quality molecular visualization. 2D structure drawings (PNG\/SVG), molecule grids with property annotations, scaffold highlighting, protein-ligand interaction diagrams, and interactive 3D views."
}

Molecule Visualization

Generate publication-quality molecular images for drug discovery, medicinal chemistry, and computational chemistry workflows. This skill provides a comprehensive suite of tools for rendering 2D structural drawings, annotated molecule grids, scaffold decomposition views, protein-ligand interaction diagrams, and interactive 3D molecular viewers.

When to Use

  • 2D structure drawings: Generate clean, high-resolution depictions of small molecules for papers, patents, reports, and presentations.
  • Molecule grids: Compare compound series side-by-side with property annotations (QED, LogP, MW, etc.).
  • Scaffold highlighting: Visualize SAR by decomposing molecules into core scaffolds and R-groups.
  • Interaction diagrams: Summarize protein-ligand binding modes from docking or crystal structures.
  • 3D interactive views: Create browser-based 3D viewers for proteins, ligands, and complexes.

Installation

All scripts require Python 3.8+ and the following packages:

# Core (required for all scripts)
pip install rdkit-pypi pillow matplotlib

# For protein-ligand interaction diagrams
pip install biopython

# For 3D interactive views
pip install py3Dmol

# Full installation
pip install rdkit-pypi pillow matplotlib biopython py3Dmol

Core Workflows

1. Single Molecule Drawing (scripts/draw_2d.py)

Render a single molecule as a high-quality PNG or SVG image.

# Basic usage
python scripts/draw_2d.py --smiles "c1ccccc1" --output benzene.png

# With atom highlighting and title
python scripts/draw_2d.py \
  --smiles "CC(=O)Oc1ccccc1C(=O)O" \
  --output aspirin.svg \
  --title "Aspirin" \
  --highlight-atoms 0,1,2,3 \
  --highlight-color "#4A90D9"

# Show atom indices for reference
python scripts/draw_2d.py \
  --smiles "c1ccc(NC(=O)c2ccccc2)cc1" \
  --output benzanilide.png \
  --show-atom-indices \
  --size 600x400

2. Molecule Grid (scripts/draw_grid.py)

Compare multiple molecules in a grid layout with optional property annotations.

# From CSV file
python scripts/draw_grid.py \
  --input compounds.csv \
  --output grid.png \
  --cols 4 \
  --properties "qed,mw,logp"

# From comma-separated SMILES
python scripts/draw_grid.py \
  --input "c1ccccc1,c1ccncc1,c1ccoc1" \
  --output ring_comparison.png \
  --title "Aromatic Ring Comparison"

3. Scaffold Highlighting (scripts/draw_scaffold.py)

Decompose molecules into scaffolds and R-groups for SAR analysis.

# Manual scaffold specification
python scripts/draw_scaffold.py \
  --smiles "c1ccc(NC(=O)c2ccccc2Cl)cc1" \
  --scaffold "c1ccc(NC(=O)c2ccccc2)cc1" \
  --output scaffold.png

# Automatic Murcko scaffold detection
python scripts/draw_scaffold.py \
  --smiles "CC(=O)Oc1ccccc1C(=O)O" \
  --scaffold auto \
  --output murcko.png

# R-group decomposition across analogs
python scripts/draw_scaffold.py \
  --smiles "c1ccc(NC(=O)c2ccccc2)cc1" \
  --scaffold "c1ccc(NC(=O)c2ccccc2)cc1" \
  --analogs analogs.csv \
  --output rgroup_table.png

4. Protein-Ligand Interaction Diagram (scripts/draw_interactions.py)

Generate 2D interaction diagrams from protein-ligand complexes.

python scripts/draw_interactions.py \
  --protein receptor.pdb \
  --ligand ligand.sdf \
  --output interactions.png \
  --distance-cutoff 4.0

5. Interactive 3D View (scripts/render_3d.py)

Create self-contained HTML files with interactive 3D molecular viewers.

# Protein with cartoon representation
python scripts/render_3d.py \
  --input protein.pdb \
  --output view.html \
  --style cartoon \
  --color chain

# Protein-ligand complex
python scripts/render_3d.py \
  --input protein.pdb \
  --ligand ligand.sdf \
  --output complex.html \
  --style cartoon

6. Pocket Visualization (scripts/render_3d.py --mode pockets)

Visualize detected binding pockets as colored spheres on the protein surface. Sphere color indicates druggability: green (>0.7), orange (0.4-0.7), red (<0.4). Sphere size is proportional to pocket volume.

# After pocket-detection/detect.py or druggability.py
python scripts/render_3d.py \
  --input protein.pdb \
  --pockets druggability.json \
  --mode pockets \
  --output pocket_view.html

# With specific residues highlighted
python scripts/render_3d.py \
  --input protein.pdb \
  --pockets pockets.json \
  --mode pockets \
  --highlight-residues "189,195,57" \
  --output pocket_view.html

7. Docking Results Visualization (scripts/render_3d.py --mode docking-results)

Overlay top docked poses on the protein, colored by rank (green = best, red = worst). The top-ranked pose gets a translucent surface highlight.

# After molecular-docking/dock.py
python scripts/render_3d.py \
  --input protein.pdb \
  --poses dock_results/poses.sdf \
  --mode docking-results \
  --top-n 5 \
  --output docking_results.html

Script Reference

Script Purpose Key Inputs
draw_2d.py Single molecule 2D drawing SMILES, output path
draw_grid.py Multi-molecule grid CSV or SMILES list, output path
draw_scaffold.py Scaffold and R-group analysis SMILES, scaffold, output path
draw_interactions.py Protein-ligand interactions PDB, SDF, output path
render_3d.py Interactive 3D viewer PDB/SDF/SMILES, output HTML

Style Guide

See references/style_guide.md for detailed guidance on:

  • Colors: CPK atom coloring scheme (C=gray, N=blue, O=red, S=yellow, Cl=green, etc.)
  • Resolution: 300 DPI minimum for print; 150 DPI for screen. Vector (SVG) preferred for publications.
  • Font sizes: 12pt minimum for labels in figures; 8pt minimum for atom indices.
  • Image dimensions: Single molecule 400x300px default; grid cells 300x250px; interaction diagrams 800x800px.
  • Interaction colors: Green for H-bonds, gray for hydrophobic, orange for pi-stacking, red for salt bridges.
  • Colorblind-friendly: Prefer blue/orange instead of red/green when accessibility is a concern.
  • 2D vs 3D: Use 2D for SAR tables, patent figures, and print publications. Use 3D for binding mode analysis, presentations, and supplementary material.

Version History

  • e9844a4 Current 2026-07-11 17:22

Same Skill Collection

.openscience/skill/bun-file-io/SKILL.md
backend/cli/skills/biology/anndata/SKILL.md
backend/cli/skills/biology/benchling-integration/SKILL.md
backend/cli/skills/biology/bioimage-analysis/SKILL.md
backend/cli/skills/biology/bioservices/SKILL.md
backend/cli/skills/biology/cancer-genomics-analysis/SKILL.md
backend/cli/skills/biology/clinical-imaging/SKILL.md
backend/cli/skills/biology/clinical-reports/SKILL.md
backend/cli/skills/biology/cobrapy/SKILL.md
backend/cli/skills/biology/curated-bio-datasets/SKILL.md
backend/cli/skills/biology/deeptools/SKILL.md
backend/cli/skills/biology/dnanexus-integration/SKILL.md
backend/cli/skills/biology/etetoolkit/SKILL.md
backend/cli/skills/biology/flow-cytometry-analysis/SKILL.md
backend/cli/skills/biology/flowio/SKILL.md
backend/cli/skills/biology/gget/SKILL.md
backend/cli/skills/biology/glycobiology/SKILL.md
backend/cli/skills/biology/histolab/SKILL.md
backend/cli/skills/biology/immunology-assays/SKILL.md
backend/cli/skills/biology/latchbio-integration/SKILL.md
backend/cli/skills/biology/microbial-dynamics/SKILL.md
backend/cli/skills/biology/molecular-cloning/SKILL.md
backend/cli/skills/biology/neurokit2/SKILL.md
backend/cli/skills/biology/neuropixels-analysis/SKILL.md
backend/cli/skills/biology/omero-integration/SKILL.md
backend/cli/skills/biology/opentrons-integration/SKILL.md
backend/cli/skills/biology/pathml/SKILL.md
backend/cli/skills/biology/pharmacology-wetlab/SKILL.md
backend/cli/skills/biology/protocolsio-integration/SKILL.md
backend/cli/skills/biology/pydeseq2/SKILL.md
backend/cli/skills/biology/pyhealth/SKILL.md
backend/cli/skills/biology/pylabrobot/SKILL.md
backend/cli/skills/biology/pysam/SKILL.md
backend/cli/skills/biology/scanpy/SKILL.md
backend/cli/skills/biology/scikit-bio/SKILL.md
backend/cli/skills/biology/scikit-survival/SKILL.md
backend/cli/skills/biology/scvi-tools/SKILL.md
backend/cli/skills/biology/synthetic-biology/SKILL.md
backend/cli/skills/biology/treatment-plans/SKILL.md
backend/cli/skills/chemistry/admet-prediction/SKILL.md
backend/cli/skills/chemistry/admet-reasoning/SKILL.md
backend/cli/skills/chemistry/binding-affinity/SKILL.md
backend/cli/skills/chemistry/datamol/SKILL.md
backend/cli/skills/chemistry/deepchem/SKILL.md
backend/cli/skills/chemistry/denovo-design/SKILL.md
backend/cli/skills/chemistry/diffdock/SKILL.md
backend/cli/skills/chemistry/drug-design/SKILL.md
backend/cli/skills/chemistry/hypogenic/SKILL.md
backend/cli/skills/chemistry/matchms/SKILL.md
backend/cli/skills/chemistry/medchem/SKILL.md

Metadata

Files
0
Version
1b7978c
Hash
b1ecad8b
Indexed
2026-07-11 17:22

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-06 01:25
浙ICP备14020137号-1 $방문자$