packmol
This skill should be used when the user asks to "create a packmol input", "pack molecules with packmol", "solvate a protein", "build an initial configuration", "setup molecular dynamics", or discusses molecular packing, solvation, or building simulation starting structures.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o packmol.zip https://jpskill.com/download/17827.zip && unzip -o packmol.zip && rm packmol.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17827.zip -OutFile "$d\packmol.zip"; Expand-Archive "$d\packmol.zip" -DestinationPath $d -Force; ri "$d\packmol.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
packmol.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
packmolフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 11
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Packmol Skill
Packmol を使用して、分子動力学シミュレーションの初期配置を構築します。
Packmol とは?
Packmol は、空間的な制約に従って分子を配置することで、MD シミュレーションの初期配置を作成します。分子をボックス内、タンパク質の周囲、界面、または複雑な形状(球、円柱、楕円体)内に配置し、分子同士が重ならないようにします。
インストール
Packmol は pip を使用してインストールします。
pip install packmol
インストールを確認します。
packmol -h
その他のインストールオプションについては、Packmol website を参照してください。
クイックスタート
基本的なボックスパッキング
水分子の単純なボックスを作成します。
# water_box.inp
tolerance 2.0
filetype pdb
output water_box.pdb
structure water.pdb
number 1000
inside box 0. 0. 0. 40. 40. 40.
end structure
Packmol を実行します。
packmol < water_box.inp
タンパク質の溶媒和
タンパク質を水とイオンで溶媒和します。
# solvation.inp
tolerance 2.0
filetype pdb
output solvated.pdb
structure protein.pdb
number 1
fixed 0. 0. 0. 0. 0. 0.
center
end structure
structure water.pdb
number 5000
inside box -10. -10. -10. 50. 50. 50.
end structure
structure SOD.pdb
number 10
inside box -10. -10. -10. 50. 50. 50.
end structure
structure CLA.pdb
number 10
inside box -10. -10. -10. 50. 50. 50.
end structure
液液界面
水/クロロホルム界面を構築します。
# interface.inp
tolerance 2.0
filetype pdb
output interface.pdb
pbc -20. -20. -30. 20. 20. 30.
structure water.pdb
number 1000
below plane 0. 0. 1. 0.
end structure
structure chloroform.pdb
number 200
above plane 0. 0. 1. 0.
end structure
コアコンセプト
入力ファイル構造
すべての Packmol 入力ファイルには以下が必要です。
- tolerance: 原子間の最小距離 (Å)
- output: 出力ファイル名
- filetype: フォーマット (pdb, xyz, tinker)
- structure blocks: 配置する分子を定義
Structure Block の構文
structure molecule.pdb
number <N> # 分子の数
inside|outside <constraint> # 空間的な制約
[optional parameters]
end structure
一般的な制約の種類
- box:
inside box xmin ymin zmin xmax ymax zmax - sphere:
inside sphere xcenter ycenter zcenter radius - cylinder:
inside cylinder x1 y1 z1 dx dy dz radius length - plane:
above plane a b c dまたはbelow plane a b c d - ellipsoid:
inside ellipsoid xc yc zc xa yb zc scale
制約に関する完全なドキュメントについては、references/constraints.md を参照してください。
ワークフロー
1. 基本的な分子パッキング
複数の種類の分子を含むボックスを構築します。
例: 水/エタノール混合物
tolerance 2.0
output mixture.pdb
filetype pdb
structure water.pdb
number 800
inside box 0. 0. 0. 40. 40. 40.
end structure
structure ethanol.pdb
number 200
inside box 0. 0. 0. 40. 40. 40.
end structure
2. タンパク質の溶媒和
中和のために、生体分子を水とイオンで溶媒和します。
重要なパラメータ:
- タンパク質には
fixedとcenterを使用します - 中性と濃度を保つために Na+/Cl- イオンを追加します
- タンパク質 + 溶媒シェルのサイズに基づいてボックスサイズを計算します
自動溶媒和ヘルパー:
python scripts/solvate_helper.py protein.pdb --shell 15.0 --charge +4
3. 界面システム
平面制約を使用して、液液または液気界面を構築します。
例: 水/ヘキサン界面
tolerance 2.0
output interface.pdb
pbc -20. -20. -30. 20. 20. 30.
structure water.pdb
number 1000
below plane 0. 0. 1. 0.
end structure
structure hexane.pdb
number 200
above plane 0. 0. 1. 0.
end structure
4. 高度な制約
複雑な形状には、球形、円筒形、または楕円形の制約を使用します。
例: 球状ベシクル
structure lipid.pdb
number 2000
inside sphere 0. 0. 0. 40.
atoms 1 2 3 4
outside sphere 0. 0. 0. 35.
end atoms
end structure
structure water.pdb
number 2000
inside sphere 0. 0. 0. 35.
end structure
structure water.pdb
number 5000
outside sphere 0. 0. 0. 45.
end structure
入力パラメータ
必須パラメータ
- tolerance
<distance>: 分子間の最小距離 (Å)。デフォルト: 全原子に対して 2.0 - output
<filename>: 出力ファイル名 - filetype
<format>: pdb, xyz, または tinker
オプションパラメータ
- pbc
<dimensions>: 周期境界条件 (例:pbc 30. 30. 60.) - seed
<integer>: 再現性のための乱数シード - discale
<factor>: 最適化のための距離スケーリング (デフォルト: 1.0) - maxit
<N>: 最大反復回数 (デフォルト: 20) - precision
<value>: 収束精度 (デフォルト: 0.01)
パラメータに関する完全なリファレンスについては、references/parameters.md を参照してください。
Structure Block のオプション
位置決めオプション
- number: 分子数
- inside/outside: 空間的な制約
- fixed: 位置と回転を固定 (6 つのパラメータ: x, y, z, α, β, γ)
- center: 位置決めに重心を使用
回転制約
constrain_rotation x 180. 20. # x 軸周りの回転を制約
constrain_rotation y 180. 20. # y 軸周りの回転を制約
constrain_rotation z 180. 20. # z 軸周りの回転を制約
原子選択
分子内の特定の原子に制約を適用します。
structure molecule.pdb
number 100
inside box 0. 0. 0. 30. 30. 30.
atoms 1 2 3
inside box 0. 0. 25. 30. 30. 30.
end atoms
end structure
Packmol の実行
基本的な実行
packmol < input.inp
出力解釈
成功メッセージ:
------------------------------
Success!
Final objective function value: .22503E-01
Maximum violation of target distance: 0.000000
Maximum violation of the constraints: .78985E-02
------------------------------
有効な解を得るには、両方の違反が < 0.01 であることを確認してください。
バリデーション
オーバーラップの確認
python scripts/che 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Packmol Skill
Build initial configurations for molecular dynamics simulations using Packmol.
What is Packmol?
Packmol creates initial configurations for MD simulations by packing molecules according to spatial constraints. It places molecules in boxes, around proteins, at interfaces, or within complex geometries (spheres, cylinders, ellipsoids) while ensuring no overlaps.
Installation
Install Packmol via pip:
pip install packmol
Verify installation:
packmol -h
For more installation options, see the Packmol website.
Quick Start
Basic Box Packing
Create a simple box of water molecules:
# water_box.inp
tolerance 2.0
filetype pdb
output water_box.pdb
structure water.pdb
number 1000
inside box 0. 0. 0. 40. 40. 40.
end structure
Run Packmol:
packmol < water_box.inp
Solvate a Protein
Solvate a protein with water and ions:
# solvation.inp
tolerance 2.0
filetype pdb
output solvated.pdb
structure protein.pdb
number 1
fixed 0. 0. 0. 0. 0. 0.
center
end structure
structure water.pdb
number 5000
inside box -10. -10. -10. 50. 50. 50.
end structure
structure SOD.pdb
number 10
inside box -10. -10. -10. 50. 50. 50.
end structure
structure CLA.pdb
number 10
inside box -10. -10. -10. 50. 50. 50.
end structure
Liquid-Liquid Interface
Build a water/chloroform interface:
# interface.inp
tolerance 2.0
filetype pdb
output interface.pdb
pbc -20. -20. -30. 20. 20. 30.
structure water.pdb
number 1000
below plane 0. 0. 1. 0.
end structure
structure chloroform.pdb
number 200
above plane 0. 0. 1. 0.
end structure
Core Concepts
Input File Structure
Every Packmol input file requires:
- tolerance: Minimum distance between atoms (Å)
- output: Output filename
- filetype: Format (pdb, xyz, tinker)
- structure blocks: Define molecules to place
Structure Block Syntax
structure molecule.pdb
number <N> # Number of molecules
inside|outside <constraint> # Spatial constraint
[optional parameters]
end structure
Common Constraint Types
- box:
inside box xmin ymin zmin xmax ymax zmax - sphere:
inside sphere xcenter ycenter zcenter radius - cylinder:
inside cylinder x1 y1 z1 dx dy dz radius length - plane:
above plane a b c dorbelow plane a b c d - ellipsoid:
inside ellipsoid xc yc zc xa yb zc scale
See references/constraints.md for complete constraint documentation.
Workflows
1. Basic Molecular Packing
Build boxes with multiple molecule types.
Example: Water/ethanol mixture
tolerance 2.0
output mixture.pdb
filetype pdb
structure water.pdb
number 800
inside box 0. 0. 0. 40. 40. 40.
end structure
structure ethanol.pdb
number 200
inside box 0. 0. 0. 40. 40. 40.
end structure
2. Protein Solvation
Solvate biomolecules with water and ions for neutralization.
Key parameters:
- Use
fixedwithcenterfor the protein - Add Na+/Cl- ions for neutrality and concentration
- Calculate box size based on protein + solvent shell
Automatic solvation helper:
python scripts/solvate_helper.py protein.pdb --shell 15.0 --charge +4
3. Interface Systems
Build liquid-liquid or liquid-vapor interfaces using plane constraints.
Example: Water/hexane interface
tolerance 2.0
output interface.pdb
pbc -20. -20. -30. 20. 20. 30.
structure water.pdb
number 1000
below plane 0. 0. 1. 0.
end structure
structure hexane.pdb
number 200
above plane 0. 0. 1. 0.
end structure
4. Advanced Constraints
Use spherical, cylindrical, or ellipsoidal constraints for complex geometries.
Example: Spherical vesicle
structure lipid.pdb
number 2000
inside sphere 0. 0. 0. 40.
atoms 1 2 3 4
outside sphere 0. 0. 0. 35.
end atoms
end structure
structure water.pdb
number 2000
inside sphere 0. 0. 0. 35.
end structure
structure water.pdb
number 5000
outside sphere 0. 0. 0. 45.
end structure
Input Parameters
Required Parameters
- tolerance
<distance>: Minimum intermolecular distance (Å). Default: 2.0 for all-atom - output
<filename>: Output file name - filetype
<format>: pdb, xyz, or tinker
Optional Parameters
- pbc
<dimensions>: Periodic boundary conditions (e.g.,pbc 30. 30. 60.) - seed
<integer>: Random seed for reproducibility - discale
<factor>: Distance scaling for optimization (default: 1.0) - maxit
<N>: Maximum iterations (default: 20) - precision
<value>: Convergence precision (default: 0.01)
See references/parameters.md for complete parameter reference.
Structure Block Options
Positioning Options
- number: Molecule count
- inside/outside: Spatial constraint
- fixed: Fix position and rotation (6 parameters: x, y, z, α, β, γ)
- center: Use center of mass for positioning
Rotation Constraints
constrain_rotation x 180. 20. # Constrain rotation around x-axis
constrain_rotation y 180. 20. # Constrain rotation around y-axis
constrain_rotation z 180. 20. # Constrain rotation around z-axis
Atom Selection
Apply constraints to specific atoms within molecules:
structure molecule.pdb
number 100
inside box 0. 0. 0. 30. 30. 30.
atoms 1 2 3
inside box 0. 0. 25. 30. 30. 30.
end atoms
end structure
Running Packmol
Basic Execution
packmol < input.inp
Output Interpretation
Success message:
------------------------------
Success!
Final objective function value: .22503E-01
Maximum violation of target distance: 0.000000
Maximum violation of the constraints: .78985E-02
------------------------------
Check that both violations are < 0.01 for a valid solution.
Validation
Check Overlaps
python scripts/check_overlaps.py output.pdb --tolerance 2.0
Verify Success
python scripts/verify_success.py input.inp output.pdb
Analyze Density
python scripts/analyze_density.py output.pdb
Validate Input
python scripts/validate_input.py input.inp
Troubleshooting
Common Issues
-
"Killed" error: System too large
- Reduce number of molecules
- Use restart files to build incrementally
- See references/troubleshooting.md
-
No convergence:
- Try
discale 1.5to scale distances - Reduce molecule count
- Simplify constraints
- Increase
maxit
- Try
-
Strange geometries:
- Add
checkkeyword to validate constraints without packing - Verify constraint syntax
- Check for conflicting constraints
- Add
-
Incorrect atom count:
- Verify structure files are readable
- Check for duplicate atoms in input files
- Validate with
scripts/validate_input.py
See references/troubleshooting.md for detailed solutions.
Examples
Explore example input files in the examples/ directory:
- Basic: examples/basic/ - Simple boxes and mixtures
- Solvation: examples/solvation/ - Proteins with water and ions
- Interface: examples/interface/ - Liquid-liquid interfaces
- Advanced: examples/advanced/ - Vesicles, bilayers, complex geometries
Templates
Use templates in templates/ as starting points:
- templates/basic_template.inp: Minimal template for simple packing
- templates/solvation_template.inp: Protein solvation setup
- templates/interface_template.inp: Interface systems
Helper Scripts
Use Python scripts in scripts/ for automation:
- generate_input.py: Generate inputs programmatically
- validate_input.py: Validate input syntax before running
- check_overlaps.py: Detect atomic overlaps in output
- analyze_density.py: Calculate system density
- solvate_helper.py: Automatic protein solvation setup
- verify_success.py: Verify Packmol completed successfully
Advanced Topics
Periodic Boundary Conditions
Use pbc for periodic systems:
pbc 30. 30. 60. # or pbc xmin ymin zmin xmax ymax zmax
Restart Files
Build large systems incrementally:
structure water.pdb
number 1000
inside box 0. 0. 0. 40. 40. 40.
restart_to water1.pack
end structure
Then restart:
structure water.pdb
number 1000
restart_from water1.pack
end structure
Atom-Specific Radii
Set different radii for multiscale models:
structure molecule.pdb
number 100
radius 1.5 # All atoms
end structure
structure molecule.pdb
number 100
atoms 1 2
radius 1.5 # Specific atoms
end atoms
end structure
Constraint Validation
Validate constraints without packing:
structure molecule.pdb
number 100
inside box 0. 0. 0. 30. 30. 30.
check
end structure
Best Practices
- Start simple: Test with few molecules before scaling up
- Use appropriate tolerance: 2.0 Å for all-atom, larger for coarse-grained
- Check constraints: Add
checkkeyword to validate regions - Validate output: Use scripts to check overlaps and density
- Reproducibility: Set
seedfor repeatable results - Large systems: Use restart files or build in stages
- Box size: Allow 10-15 Å padding around solutes for solvation
Tips for Common Use Cases
Protein Solvation
- Add 10-15 Å solvent shell around protein
- Calculate ions for neutrality:
N_ions = charge / e - Add salt ions for desired concentration (e.g., 0.15 M NaCl)
- Use
fixedwithcenterfor protein positioning
Mixed Solvents
- Calculate total number of molecules from desired molar ratios
- Use same tolerance for all components
- Test with small systems first
Membrane Systems
- Use
constrain_rotationto orient lipids - Build in stages: lipids first, then water
- Consider using specialized membrane builders for large systems
Nanotubes/Pores
- Use
cylinderconstraint for pore region - Combine with
outsideconstraint for bulk region - May need atom selection for specific molecule orientations
Resources
- Official documentation: Packmol User Guide
- Examples: Packmol Examples
- GitHub: Packmol Repository
- Paper: Martínez et al. J Comput Chem 2009
References
For detailed information on specific topics, see:
- constraints.md - Complete constraint syntax and examples
- parameters.md - All input parameters and options
- file_formats.md - File format specifications
- troubleshooting.md - Problem-solving guide
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (11,470 bytes)
- 📎 references/constraints.md (9,883 bytes)
- 📎 references/file_formats.md (10,488 bytes)
- 📎 references/parameters.md (13,150 bytes)
- 📎 references/troubleshooting.md (14,332 bytes)
- 📎 scripts/analyze_density.py (11,757 bytes)
- 📎 scripts/check_overlaps.py (8,880 bytes)
- 📎 scripts/generate_input.py (17,032 bytes)
- 📎 scripts/solvate_helper.py (14,883 bytes)
- 📎 scripts/validate_input.py (14,666 bytes)
- 📎 scripts/verify_success.py (13,961 bytes)