Skip to main content

Lightweight pdb4amber derivative without Amber binary dependencies

Project description

pdb4ambermini

基于 pdb4amber 的精简工具(移除了对 Amber 可执行程序的依赖),用于清理/准备 PDB/CIF 结构,让其更适合 Amber 力场。支持保留输入文件中的 SEQRES 信息。

功能

  • 读取本地文件、stdin、URL 或 PDB ID(依赖 ParmEd 下载)。
  • 自动识别并重命名组氨酸(HIS → HID/HIE/HIP),可选常 pH 模式(ASP/GLU/HIS → AS4/GL4/HIP)。
  • 检测二硫键并重命名 CYS → CYX,可选择写入/关闭 S–S CONECT 记录。
  • 识别残基缺口、非标准残基;输出重编号对照表、非标准残基列表、二硫键列表。
  • 支持删除氢、去水、按掩码 strip 原子/残基、模型选择、altloc 处理(保留/丢弃/按占据度)。
  • 支持残基突变(如 -m "3-ALA,4-GLU"),输出为 PDB 或 MOL2。
  • 新增:--keep-seqres 保留输入 PDB 中的 SEQRES 行,原样放在输出 PDB 开头。

安装

pip install pdb4ambermini

命令行示例

# 查看帮助
pdb4ambermini --help

# 最简单用法,输出到文件
pdb4ambermini input.pdb -o cleaned.pdb

# 仅保留蛋白并去水
pdb4ambermini input.pdb -p -d -o protein.pdb

# 按掩码删除原子/残基
pdb4ambermini input.pdb -s ':LIG,HOH' -o stripped.pdb

# 处理 PDB ID,常 pH 重命名,按模型选择
pdb4ambermini 1tsu --pdbid --constantph --model 1 -o out.pdb

# 突变并保留 altloc
pdb4ambermini input.pdb -m "10-ALA,15-GLU" --keep-altlocs -o mutated.pdb

# 保留理论完整序列 SEQRES
pdb4ambermini input.pdb --keep-seqres -o with_seqres.pdb

主要参数

  • -i/--in 输入文件(默认 stdin);-o/--out 输出文件(默认 stdout)
  • -y/--nohyd 去氢;-d/--dry 去水;-s/--strip 指定掩码 strip 原子/残基
  • -m/--mutate 突变;-p 仅保留蛋白;-a 仅保留 Amber 支持残基
  • --constantph 常 pH 重命名;--most-populous altloc 取占据度最大;--keep-altlocs 保留 altloc
  • --pdbid 以 PDB ID 下载;--model 指定模型(负数保留全部)
  • --no-conect 不写二硫键 CONECT;--noter 不写 TER
  • --keep-seqres 保留输入 PDB 的 SEQRES 行并放在输出开头

Python 调用示例

from pdb4ambermini.pdb4amber import run

ns_names, gaps, disulfides = run(
    arg_pdbout="cleaned.pdb",
    arg_pdbin="input.pdb",   # 可为路径、类文件对象或 parmed.Structure
    arg_nohyd=False,
    arg_dry=False,
    arg_strip_atom_mask=None,
    arg_mutate_string=None,
    arg_prot=False,
    arg_amber_compatible_residues=False,
    arg_constph=False,
    arg_mostpop=False,
    arg_model=0,
    arg_keep_altlocs=False,
    arg_logfile="pdb4ambermini.log",
    arg_conect=True,
    arg_noter=False,
    arg_keep_seqres=True,
)
print("非标准残基:", ns_names)
print("缺口:", gaps)
print("二硫键:", disulfides)

许可

MIT License。项目基于 pdb4amber(BSD-3-Clause,AMBER 项目),原始源码的版权与 BSD 条款已在 LICENSE 中注明。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdb4ambermini-0.1.2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdb4ambermini-0.1.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file pdb4ambermini-0.1.2.tar.gz.

File metadata

  • Download URL: pdb4ambermini-0.1.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for pdb4ambermini-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a525594bff2183377df72024c6650ee88f0b817bba8e6beb526823f7522a08b1
MD5 53b72d87910036a6f7df715b7904a1b8
BLAKE2b-256 f6ceca4a97459a9ef7f01f8a1d072db19e0757e85bb743491b2269455ba04701

See more details on using hashes here.

File details

Details for the file pdb4ambermini-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pdb4ambermini-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for pdb4ambermini-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49396838a8dd086babf8dec04bbea1dc25d0a63b8a5ce37a98c8220f20f3f303
MD5 0ea1a8808aa12ebe4c82e4b82de24259
BLAKE2b-256 c60673b002d6eff8920cfcc0a9e6d61f12ee58ad48850dbc763df5d2a83cf124

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page