Skip to main content

Hydrogen adder for pdb protein files

Project description

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. 氨基酸分子结构和原子命名

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

hadder-3.8.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

hadder-3.8-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file hadder-3.8.tar.gz.

File metadata

  • Download URL: hadder-3.8.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for hadder-3.8.tar.gz
Algorithm Hash digest
SHA256 5c2804a3278dd0acf8efe65f95cc1890a8b6d8a6ddce7851682dba5ac396525e
MD5 2f0bacc30a2e10b876de8cf168846eef
BLAKE2b-256 68fcaaa1d3363d92b8535428897d082f42781c7aaa02f60aa0d0bd1a5604efbf

See more details on using hashes here.

File details

Details for the file hadder-3.8-py3-none-any.whl.

File metadata

  • Download URL: hadder-3.8-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for hadder-3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8ffbeadb57d4fcf033a56d4a19681e7720813bff3966ed74b224bdc534ef44bc
MD5 28c00b158a54923fb2dadfd869d6d257
BLAKE2b-256 978e6601c7c3090e8c15a5b8af7313ede8a8d464062343f47e37a54a4f8ee83e

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