Skip to main content

Hadder--专用蛋白质补氢工具

Hex.pm

很多蛋白质数据库往往会采用去掉氢原子的方式来存储各种pdb蛋白质结构文件, 这就要求我们在实际构建力场的过程中手动去补齐氢原子, 本开源工具就可以实现这样的功能。

安装与使用

本软件支持pip一键安装与更新:

$ python3 -m pip install hadder --upgrade -i https://pypi.org/simple

支持在python中调用API接口,来完成蛋白质补氢:

from hadder import AddHydrogen
AddHydrogen('input.pdb', 'output.pdb')

如果成功运行,会在终端窗口上打印如下文字:

1 H-Adding task with 3032 atoms complete in 0.116 seconds.

在1.4以及之后的版本中,安装完成后,也支持直接使用命令行操作来补氢:

$ python3 -m hadder -h
usage: __main__.py [-h] [-i I] [-o O]

optional arguments:
  -h, --help  show this help message and exit
  -i I        Set the input pdb file path.
  -o O        Set the output pdb file path.
  
$ python3 -m hadder -i input.pdb -o ouput.pdb # e.g. $ python3 -m hadder -i examples/case2.pdb -o examples/case2-complete.pdb
1 H-Adding task with 3032 atoms complete in 0.116 seconds.

不论是调用API接口的补氢,还是使用命令形式的补氢,都建议使用绝对路径来进行文件索引。如果在此处使用相对路径,会导致一些文件索引错误的问题。

示例

在examples路径下有一个case2.pdb的文件,这是一个不含氢原子的蛋白质,其结构如下图所示:

使用Hadder完成补氢的操作之后,得到的结果如下图所示:

代码贡献

如果希望在本仓库贡献您的代码,为开源社区的用户提供更多的技术支持,请在按照如下操作确保代码符合PEP8规范之后, 再提交Pull Request进入审核阶段,审核结束后即可合并分支。

安装Flake8

Flake8是一个常用的代码规范检查工具,可以使用pip进行安装和管理。但是由于不同版本的Flake8检查出来的问题可能存在不一致的现象, 因此我们要求使用Flake8的3.8.4指定版本,安装方法如下:

$ python3 -m pip install flake8==3.8.4

使用Flake8

进入到hadder/路径下,执行如下指令:

$ flake8

如果返回的结果为空,即表明当前路径下的所有python文件符合相关的规范要求,可以提交PR进入审核阶段。

博客推荐

  1. 从Hadder看蛋白质分子中的加氢算法
  2. 用脚本的形式运行Hadder
  3. 蛋白质基础组成结构
  4. 氨基酸分子结构和原子命名

Metadata

Release files for hadder 3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hadder 3.8
File Size Uploaded Provenance Actions
hadder-3.8.tar.gz 17.7 kB Without provenance Details for hadder-3.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hadder 3.8
File Interpreter ABI Platform Actions
hadder-3.8-py3-none-any.whl Python 3 none any Details for hadder-3.8-py3-none-any.whl

Total release size: 35.1 kB

Release files / hadder-3.8.tar.gz

Download URL hadder-3.8.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5c2804a3278dd0acf8efe65f95cc1890a8b6d8a6ddce7851682dba5ac396525e
BLAKE2b-256 checksum
How to use checksums
68fcaaa1d3363d92b8535428897d082f42781c7aaa02f60aa0d0bd1a5604efbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.5

Release files / hadder-3.8-py3-none-any.whl

Download URL hadder-3.8-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ffbeadb57d4fcf033a56d4a19681e7720813bff3966ed74b224bdc534ef44bc
BLAKE2b-256 checksum
How to use checksums
978e6601c7c3090e8c15a5b8af7313ede8a8d464062343f47e37a54a4f8ee83e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.5

Security for hadder 3.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page