pax_global_header00006660000000000000000000000064145362746420014527gustar00rootroot0000000000000052 comment=e4368bcdbb4d862606f12f2456bf888db6ded4a0 pdb-tools-2.5.1/000077500000000000000000000000001453627464200134375ustar00rootroot00000000000000pdb-tools-2.5.1/.bumpversion.cfg000066400000000000000000000002351453627464200165470ustar00rootroot00000000000000[bumpversion] current_version = 2.5.1 commit = True message = [SKIP] version bump {current_version} -> {new_version} tag = True [bumpversion:file:setup.py] pdb-tools-2.5.1/.gitattributes000066400000000000000000000000531453627464200163300ustar00rootroot00000000000000# Set LF for Python files *py text eol=lf pdb-tools-2.5.1/.github/000077500000000000000000000000001453627464200147775ustar00rootroot00000000000000pdb-tools-2.5.1/.github/ISSUE_TEMPLATE/000077500000000000000000000000001453627464200171625ustar00rootroot00000000000000pdb-tools-2.5.1/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000011531453627464200216540ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve title: '' labels: bug assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. Ex. My PDB file is blank after I use this tool! **To Reproduce** Steps to reproduce the behavior. Preferrably, a code snippet. ``` pdb_fetch.py 1xxx.pdb | pdb_oopsy.py > result cat result # result is empty! ``` **Expected behavior** The output PDB file should not be blank, but should have YY replaced! **Desktop (please complete the following information):** - OS: [e.g. Mac OS, Linux, Windows] - Python Version [e.g. 2.7, 3.6, 3.7] pdb-tools-2.5.1/.github/ISSUE_TEMPLATE/tool-request.md000066400000000000000000000014441453627464200221520ustar00rootroot00000000000000--- name: Tool request about: Suggest an idea for a new pdb-tool title: '' labels: Tool Request assignees: '' --- **Is your tool request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always trying to do [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. Ex. I would like a tool that did [...] **Does any of the existing tools or a combination of them do what you want?** A clear and concise description of any alternative solutions or features you've considered. **Remember** Each `pdb-tools` should do one and one job only. If you have to describe what you want using an _and_, probably it is the job for at least _two_ tools. We want simple tools that can be combined, for flexibility. pdb-tools-2.5.1/.github/workflows/000077500000000000000000000000001453627464200170345ustar00rootroot00000000000000pdb-tools-2.5.1/.github/workflows/build_and_test.yml000066400000000000000000000071551453627464200225470ustar00rootroot00000000000000--- name: build_and_test on: # yamllint disable-line rule:truthy pull_request: branches: - master push: branches: - master jobs: # Only lint in one platform to save compute time linter: runs-on: ${{ matrix.platform }} strategy: matrix: platform: [ubuntu-latest] python-version: ["3.10"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip setuptools wheel shell: bash - name: Linter run: | python -m pip install flake8 flake8 . build_and_test: name: Build & Test runs-on: ${{ matrix.platform }} needs: [linter] strategy: matrix: platform: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade bump2version twine python -m pip install --upgrade coverage - name: Build run: | python --version python setup.py sdist bdist_wheel twine check dist/*.whl twine check dist/*.tar.gz bump2version --dry-run --verbose --allow-dirty patch bump2version --dry-run --verbose --allow-dirty minor bump2version --dry-run --verbose --allow-dirty major - name: Install pdb-tools run: | python -m pip install . - name: Test on Linux run: | script -q -e -c "coverage run -p setup.py test" shell: bash if: matrix.os == 'ubuntu-latest' - name: Test on MacOS / Windows run: | coverage run -p setup.py test shell: bash if: matrix.os != 'ubuntu-latest' env: SKIP_TTY_TESTS: true # Store coverage data for later # https://hynek.me/articles/ditch-codecov-python/ - name: Store coverage data uses: actions/upload-artifact@v3 with: name: coverage-data path: .coverage.* if-no-files-found: ignore retention-days: 2 # Combine and analyze coverage # https://hynek.me/articles/ditch-codecov-python/ coverage: name: Combine & Check coverage. runs-on: ubuntu-latest needs: [build_and_test] steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: "3.10" - run: | python -m pip install --upgrade pip setuptools wheel python -m pip install --upgrade coverage - name: Download coverage data. uses: actions/download-artifact@v2 with: name: coverage-data # We should update the threshold as we write more tests. # It should be the minimum we are comfortable with. - name: Combine coverage & fail if it's < threshold %. run: | python -m coverage combine python -m coverage html --skip-covered --skip-empty python -m coverage report --fail-under=80 - name: Upload HTML report if check failed. uses: actions/upload-artifact@v2 with: name: html-report path: htmlcov if: ${{ failure() }} pdb-tools-2.5.1/.github/workflows/bump-version-on-push.yml000066400000000000000000000032771453627464200236050ustar00rootroot00000000000000--- # yamllint disable rule:line-length name: Bump_and_Package on: # yamllint disable-line rule:truthy push: branches: - master jobs: bump-version: runs-on: ubuntu-latest if: "!startsWith(github.event.head_commit.message, '[SKIP]')" steps: - uses: actions/checkout@v1 - name: Set up Python uses: actions/setup-python@v1 with: python-version: '3.x' - name: Setup Git run: | git config user.name "JoaoRodrigues" git config user.email 'joaorodrigues@users.noreply.github.com' git remote set-url origin \https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY git checkout "${GITHUB_REF:11}" - name: Create skip flag run: | echo "SKIPBUMP=FALSE" >> $GITHUB_ENV - name: Install dependencies run: | python -m pip install --upgrade pip pip install bump2version setuptools wheel twine - name: Bump Minor Version run: | bump2version minor echo "SKIPBUMP=TRUE" >> $GITHUB_ENV if: "startsWith(github.event.head_commit.message, '[FEATURE]')" # Default action - name: Bump Patch Version run: | bump2version patch if: env.SKIPBUMP == 'FALSE' # No major version change should go through automatically. - name: Commit version change to master run: | git push --follow-tags - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python setup.py sdist bdist_wheel twine upload dist/* pdb-tools-2.5.1/.github/workflows/yaml_linter.yml000066400000000000000000000004621453627464200221000ustar00rootroot00000000000000--- name: Yaml Lint on: [push, pull_request] # yamllint disable-line rule:truthy jobs: lintAllTheThings: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: yaml-lint uses: ibiqlik/action-yamllint@v3 with: file_or_dir: .github/workflows/*.yml pdb-tools-2.5.1/.gitignore000066400000000000000000000001001453627464200154160ustar00rootroot00000000000000# Python setuptools build/ dist/ *egg-info/ *__pycache__ *.pyc pdb-tools-2.5.1/CODE_OF_CONDUCT.md000066400000000000000000000064411453627464200162430ustar00rootroot00000000000000# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at j.p.g.l.m.rodrigues@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq pdb-tools-2.5.1/CONTRIBUTING.md000066400000000000000000000151111453627464200156670ustar00rootroot00000000000000# Contributing to pdb-tools First off, thank you for taking the time to contribute! The tone of the following 'guidelines' might seem a bit harsh (a lot of *do nots*) but it will make everyone's life easier. Make sure you read through this at least once before issuing a pull request or opening an issue. ## What should I know before getting started? The crux of any tool of `pdb-tools` is simplicity. Simplicity both for the end-user but also for developers. You will find that the tools often repeat a lot of code, for example the `check_input` functions. While this might look ugly from a development point of view, it makes scripts simpler (fancy options will very quickly turn ugly), faster (no imports) and more understandable for old and new developers. This is also why we do not make use of `argparse`. A corolary of this simplicity is that every tool should do **one and one job only**. The only exception to this is `pdb_tidy` and it will very likely remain so. Even then, its job is to 'produce a valid PDB', despite doing multiple tasks under the hood. The tools are meant to be chained together, so if you want to have two tasks accomplished, write two tools and have them talk. Finally. **Dependencies are strictly not allowed**. Take this as an exercise to work on your Python Standard Library skills. ## How do I write an issue? If you found a problem with one of the tools, if it does not behave as expected, if you think it should do something different or something more, or if you think that there should be a tool do to something new, please do open an issue. If a tool is not working, let us know exactly what you did and what the outcome was. Whatever you tell us that helps us reproduce your workflow will make our job much easier to answer your question and provide a fix if necessary.    **Bad issue reporter** pdb_reatom.py does not work. Please fix. # believe it or not people do write this.    **Good issue reporter** I tried using pdb_reatom.py on a PDB file and it did not renumber nitrogen atoms. Here is an example: $ cat 1abc.pdb ATOM 9 N ASN A 1 22.066 40.557 1.420 1.00 1.00 ATOM 2 N ASN A 2 43.123 76.234 0.123 1.00 1.00 END $ pdb_reatom 1abc.pdb ATOM 9 N ASN A 1 22.066 40.557 1.420 1.00 1.00 ATOM 2 N ASN A 2 43.123 76.234 0.123 1.00 1.00 END I was expecting the two atoms to be consecutively renumbered from 1. I am using pdb-tools version 2.0.0: $ pip show pdb-tools Name: pdb-tools Version: 2.0.0 Location: /path/to/virtualenv/lib/python3.7/site-packages ## How do I contribute code? We welcome and will gladly review any pull request. If you have never used git or GitHub before, have a look at the [guides](https://guides.github.com/) page. To contribute to `pdb-tools`, use the *Fork* button to create your own copy of the `pdb-tools` repository. Then, download `git` on your laptop/desktop computer and proceed like the snippet below, where we pretend to add a new tool: ```bash # Clone your own fork of pdb-tools git clone https://github.com/yourusername/pdb-tools.git cd pdb-tools # Add our repository as 'upstream' to make sure you are using the latest # version of the code. git remote add upstream https://github.com/haddocking/pdb-tools.git # Pull our master to update your local version # If there are changes, you should push them to the 'master' of your fork. git pull upstream master git push origin master # Update your fork if necessary # Create a feature branch to start working on your new tool. # Name the new branch clearly and concisely after the change you are proposing # # We use feature branches to avoid conflicts in the master branch. Updating # should always be smooth and you can deal with merge conflicts in your branches git checkout -b pdb_newtool # Work on your new tool! # Include hours of work here and make sure to read the conventions below. # Also, try to add a test case too under tests/ # We can help you fleshing it out if you need it. ... # If you are making changes to an existing tool, run the test suite before # committing your changes. python setup.py test # When you have committed all your changes, run flake8 to make sure there are # no style issues. You can find our flake8 settings in `setup.cfg`. python -m pip install flake8 flake8 . # Update the documentation, if you added new tools (or changed docstrings). cd docs/ python doctools.py git add index.md && git commit -m "Updated documentation" # When there are no issues left, push to your fork on github git push origin pdb_newtool # And then, online, create a pull request. # That is it. ``` ## Conventions In an effort to try and make all tools look the same, stick to these conventions when writing a new one or modifying an existing one: ### Coding conventions Every pull request will be checked for style using Flake8. We ignore line length warnings and the use of lambdas. Do not abuse the first one though. We always try to stick to 80 characters, unless it's stupid to do so. * Do not use camelCase. Stick to snake_case. * Write docstrings and comment your code, specially if it is not obvious! * Name your variables properly, we don't charge you for a few extra lines. ### Tool design conventions * Every tool should have the same structure: `check_input`, `do_task`, `main`. Do **not** deviate from this, unless you absolutely need to. * User interfaces must follow the `pdb_tool [-option] ` paradigm. Do not try and make it `pdb_tool -opt1 -opt2 -opt3`. See `pdb_rplchain` and `pdb_wc` for good examples of how to handle multiple options. * Avoid reading the entire file in memory unless you have to. This makes it nice for people processing very large files. * Following the previous item, make use of generators (`yield`) to output the results of your tool. ## Merging Pull Requests If you are tasked with merging a pull request yourself, you should know that there is an automated job running every time a push is made to the master branch. This job will trigger a version bump and automatically publish the new package to PyPi. By default, only the patch (x.x.Y) number is incremented. If you want to trigger a minor version (x.Y.x) update, start your commit with `[FEATURE]`. Note that since we use merge commits, this means you have to edit the title of the merge commit. It is your responsibility to handle this as a package maintainer! Finally, if your last commit message starts with `[SKIP]`, the automated job does not run, so use this flag if your commits are for documentation, README, etc. pdb-tools-2.5.1/LICENSE000066400000000000000000000261261453627464200144530ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2018 João Pedro Rodrigues Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.pdb-tools-2.5.1/MANIFEST.in000066400000000000000000000005771453627464200152060ustar00rootroot00000000000000graft pdbtools include LICENSE include README.md include citation.tex exclude .appveyor.yml exclude .bumpversion.cfg exclude .coveragerc exclude .travis.yml exclude CODE_OF_CONDUCT.md exclude CONTRIBUTING.md exclude MANIFEST.in exclude PACKING.md exclude tox.ini prune docs prune tests global-exclude *.py[cod] __pycache__/* *.so *.dylib global-exclude *.swp global-exclude tags pdb-tools-2.5.1/PACKAGING.md000066400000000000000000000021641453627464200152500ustar00rootroot00000000000000# Packaging pdb-tools This guide describes (roughly) how to package `pdb-tools` into something `pip` can handle. ## Versioning `pdb-tools` uses semantic versioning: MAJOR.MINOR.PATCH (e.g. 2.0.0). It works more or less like this: * For every new release fixing bugs, increment the PATCH counter (e.g. 2.0.1). * For every release adding minor features to tools or new tools that do not impact any of the existing ones, increment MINOR (e.g. 2.1.0). * For major changes that will most likely impact the usage of existing tools, increment MAJOR (e.g. 3.0.0). In practice, when packaging the distribution we should update the version number in `setup.py` accordingly (otherwise `twine` will give an error). ## Packaging This is a rough guide to building a distributable package: ### (1) Ensure all tests pass: ```bash python setup.py test ``` 2. Ensure there are no warnings from flake8: ```bash flake8 --ignore=E501,E731 ``` 3. Build the distributable package: ```bash python setup.py sdist bdist_wheel # Upload to PyPI: testing repo for now. #twine upload --repository-url https://test.pypi.org/legacy/ dist/* twine upload dist/* ``` pdb-tools-2.5.1/README.md000066400000000000000000000125441453627464200147240ustar00rootroot00000000000000# pdb-tools [![PyPI version](https://badge.fury.io/py/pdb-tools.svg)](https://pypi.python.org/pypi/pdb-tools) [![PyPi Downloads](https://img.shields.io/pypi/dm/pdb-tools.svg)](https://pypi.python.org/pypi/pdb-tools) [![tests](https://github.com/haddocking/pdb-tools/workflows/ci/badge.svg?branch=master)](https://github.com/haddocking/pdb-tools/actions?workflow=ci) [![DOI](https://zenodo.org/badge/27217350.svg)](https://doi.org/10.12688/f1000research.17456.1) A swiss army knife for manipulating and editing PDB files. ## Looking for the _other_ pdb-tools? The Harms lab maintains a set of tools also called `pdbtools`, which perform a slightly different set of functions. You can find them [here](https://github.com/harmslab/pdbtools). ## About Manipulating PDB files is often painful. Extracting a particular chain or set of residues, renumbering residues, splitting or merging models and chains, or just ensuring the file is conforming to the PDB specifications are examples of tasks that can be done using any decent parsing library or graphical interface. These, however, almost always require 1) scripting knowledge, 2) time, and 3) installing one or more programs. `pdb-tools` were designed to be a swiss-knife for the PDB format. They have no external dependencies, besides obviously the [Python programming language](http://www.python.org). They are the descendant of a set of old FORTRAN77 programs that had the particular advantage of working with streams, i.e. the output of one script could be piped into another. Since FORTRAN77 is a pain too, I rewrote them in Python and added a few more utilities. The philosophy of the scripts is simple: one script, one task. If you want to do two things, pipe the scripts together. Requests for new scripts will be taken into consideration - use the Issues button or write them yourself and create a Pull Request. ## Installation Instructions `pdb-tools` are available on PyPi and can be installed though `pip`. This is the recommended way as it makes updating/uninstalling rather simple: ```bash pip install pdb-tools ``` Because we use semantic versioning in the development of `pdb-tools`, every bugfix or new feature results in a new version of the software that is automatically published on PyPI. As such, there is no difference between the code on github and the latest version you can install with `pip`. To update your installation to the latest version of the code run: ```bash pip install --upgrade pdb-tools ``` ## What can I do with them? The names of the tools should be self-explanatory. Their command-line interface is also pretty consistent. Therefore, here is a couple of examples to get you started: * Downloading a structure ```bash pdb_fetch 1brs > 1brs.pdb # 6 chains pdb_fetch -biounit 1brs > 1brs.pdb # 2 chains ``` * Renumbering a structure ```bash pdb_reres -1 1ctf.pdb > 1ctf_renumbered.pdb ``` * Selecting chain(s) ```bash pdb_selchain -A 1brs.pdb > 1brs_A.pdb pdb_selchain -A,D 1brs.pdb > 1brs_AD.pdb ``` * Deleting hydrogens ```bash pdb_delelem -H 1brs.pdb > 1brs_noH.pdb ``` * Selecting backbone atoms ```bash pdb_selatom -CA,C,N,O 1brs.pdb > 1brs_bb.pdb ``` * Selecting chains, removing HETATM, and producing a valid PDB file ```bash pdb_selchain -A,D 1brs.pdb | pdb_delhetatm | pdb_tidy > 1brs_AD_noHET.pdb ``` *Note: On Windows the tools will have the `.exe` extension.* ## What _can't_ I do with them? Operations that involve coordinates or numerical calculations are usually not in the scope of `pdb-tools`. Use a proper library for that, it will be much faster and scalable. Also, although we provide mmCIF<->PDB converters, we do not support large mmCIF files with more than 99999 atoms, or 9999 residues in a single chain. Our tools will complain if you try using them on such a molecule. ## Citation We finally decided to write up a small publication describing the tools. If you used them in a project that is going to be published, please cite us: ``` Rodrigues JPGLM, Teixeira JMC, Trellet M and Bonvin AMJJ. pdb-tools: a swiss army knife for molecular structures. F1000Research 2018, 7:1961 (https://doi.org/10.12688/f1000research.17456.1) ``` If you use a reference manager that supports BibTex, use this record: ``` @Article{ 10.12688/f1000research.17456.1, AUTHOR = { Rodrigues, JPGLM and Teixeira, JMC and Trellet, M and Bonvin, AMJJ}, TITLE = {pdb-tools: a swiss army knife for molecular structures [version 1; peer review: 2 approved] }, JOURNAL = {F1000Research}, VOLUME = {7}, YEAR = {2018}, NUMBER = {1961}, DOI = {10.12688/f1000research.17456.1} } ``` ## Requirements `pdb-tools` should run on Python 2.7+ and Python 3.x. We test on Python 2.7, 3.6, and 3.7. There are no dependencies. ## Installing from Source Download the zip archive or clone the repository with git. We recommend the `git` approach since it makes updating the tools extremely simple. ```bash # To download git clone https://github.com/haddocking/pdb-tools cd pdb-tools # To update git pull origin master # To install python setup.py install ``` ## Contributing If you want to contribute to the development of `pdb-tools`, provide a bug fix, or a new tools, read our `CONTRIBUTING` instructions [here](https://github.com/haddocking/pdb-tools/blob/master/CONTRIBUTING.md). ## License `pdb-tools` are open-source and licensed under the Apache License, version 2.0. For details, see the LICENSE file. pdb-tools-2.5.1/citation.tex000066400000000000000000000017241453627464200157770ustar00rootroot00000000000000@article {Rodrigues483305, author = {Rodrigues, Jo{\~a}o P.G.L.M. and Teixeira, Jo{\~a}o M.C. and Trellet, Mika{\"e}l and Bonvin, Alexandre M.J.J.}, title = {pdb-tools: a swiss army knife for molecular structures}, elocation-id = {483305}, year = {2018}, doi = {10.1101/483305}, publisher = {Cold Spring Harbor Laboratory}, abstract = {The pdb-tools are a collection of Python scripts for working with molecular structure data in the PDB format. They allow users to edit, convert, and validate PDB files, from the command-line, in a simple but efficient manner. The pdb-tools are implemented in Python, without any external dependencies, and are freely available under the open-source Apache License at https://github.com/haddocking/pdb-tools/ and on PyPI (https://pypi.org/project/pdb-tools/).}, URL = {https://www.biorxiv.org/content/early/2018/12/04/483305}, eprint = {https://www.biorxiv.org/content/early/2018/12/04/483305.full.pdf}, journal = {bioRxiv} }pdb-tools-2.5.1/docs/000077500000000000000000000000001453627464200143675ustar00rootroot00000000000000pdb-tools-2.5.1/docs/_config.yml000066400000000000000000000005021453627464200165130ustar00rootroot00000000000000title: 'pdb-tools' headline: '' logo: /logo/pdb-tools.png show_downloads: true description: 'A swiss army knife for editing PDB files.' theme: jekyll-theme-minimal github: zip_url: https://github.com/haddocking/pdb-tools/archive/2.0.0-rc1.zip tar_url: https://github.com/haddocking/pdb-tools/archive/2.0.0-rc1.tar.gz pdb-tools-2.5.1/docs/assets/000077500000000000000000000000001453627464200156715ustar00rootroot00000000000000pdb-tools-2.5.1/docs/assets/css/000077500000000000000000000000001453627464200164615ustar00rootroot00000000000000pdb-tools-2.5.1/docs/assets/css/style.scss000066400000000000000000000004711453627464200205200ustar00rootroot00000000000000--- --- @import "{{ site.theme }}"; /* Pad image bottom */ .wrapper img { padding-bottom: 1%; } /* Remove bullets from ordered lists */ ul { list-style-type: none; padding: 0; margin: 0; } /* Make content wider */ .wrapper { width: 1200px; } section { width: 860px; } footer { width: 280px; } pdb-tools-2.5.1/docs/cookbook.md000066400000000000000000000004631453627464200165220ustar00rootroot00000000000000--- layout: default --- * Removing hydrogens, renaming `HIP` to `HIS`, and renumbering atoms, for all PDBs from a folder to a new folder: ```bash mkdir folder_new for i in folder/*pdb; do pdb_delelem -H $i | pdb_rplresname -HIP:HIS | pdb_reatom -1 | pdb_tidy > folder_new/$(basename $i); done ``` pdb-tools-2.5.1/docs/doctools.py000066400000000000000000000035201453627464200165670ustar00rootroot00000000000000#!/usr/bin/env python """ Scrapes tool headers for documentation. """ import importlib from pathlib import Path with open('index.md', 'w') as handle: with open('index.md.template') as template: print(template.read(), file=handle) import pdbtools modfile = Path(pdbtools.__file__) for f in sorted(list(modfile.parent.iterdir())): # ignore __init__.py and others. if f.stem.startswith('_') or f.suffix != '.py': continue # Dynamically import tool to get __doc__ name = f.stem try: tool = importlib.import_module(f'pdbtools.{name}') except ModuleNotFoundError: print(f'Could not import module: {name}') continue # Parse documentation from docstrings # Preserve white-space as best as possible. # First non-empty line is always short description. # Last lines are always licensing disclaimer summary = None long_description = [] doctext = tool.__doc__.replace('<', '<').replace('>', '>') for line in doctext.split('\n'): if summary is None and not line.strip(): continue if line.startswith('This program is part of the'): break elif summary is None: summary = line else: long_description.append(line) long_description = '\n'.join(long_description) print('
', file=handle) print('
', file=handle) print(f"{name}

{summary}

", file=handle) print( f'{long_description}', file=handle ) print('
', file=handle) print('
', file=handle) pdb-tools-2.5.1/docs/index.md000066400000000000000000000712601453627464200160260ustar00rootroot00000000000000--- layout: default --- A swiss army knife for manipulating and editing PDB files. ## Installation Instructions `pdb-tools` are available on PyPi and can be installed though `pip`. This is the recommended way as it makes updating/uninstalling rather simple: ```bash pip install pdb-tools ``` Because we use semantic versioning in the development of `pdb-tools`, every bugfix or new feature results in a new version of the software that is automatically published on PyPI. As such, there is no difference between the code on github and the latest version you can install with `pip`. To update your installation to the latest version of the code run: ```bash pip install --upgrade pdb-tools ``` ## What can I do with them? The purpose of each tool should be obvious from its name. In any case, [here](#list-of-tools) is a list of all the tools in the suite and their function. All tools share the same command-line interface. Below are a couple of examples to get you started. If you want to check out more examples of how to use the tools and their applications, or have any cool examples of your own, check out the [cookbook](cookbook). * Downloading a structure ```bash pdb_fetch 1brs > 1brs.pdb # 6 chains pdb_fetch -biounit 1brs > 1brs.pdb # 2 chains ``` * Renumbering a structure ```bash pdb_reres -1 1ctf.pdb > 1ctf_renumbered.pdb ``` * Selecting chain(s) ```bash pdb_selchain -A 1brs.pdb > 1brs_A.pdb pdb_selchain -A,D 1brs.pdb > 1brs_AD.pdb ``` * Deleting hydrogens ```bash pdb_delelem -H 1brs.pdb > 1brs_noH.pdb ``` * Selecting backbone atoms ```bash pdb_selatom -CA,C,N,O 1brs.pdb > 1brs_bb.pdb ``` * Selecting chains, removing HETATM, and producing a valid PDB file ```bash pdb_selchain -A,D 1brs.pdb | pdb_delhetatm | pdb_tidy > 1brs_AD_noHET.pdb ``` *Note: On Windows the tools will have the `.exe` extension.* ## What _can't_ I do with them? Operations that involve coordinates or numerical calculations are usually not in the scope of `pdb-tools`. Use a proper library for that, it will be much faster and scalable. Also, although we provide mmCIF<->PDB converters, we do not support large mmCIF files with more than 99999 atoms, or 9999 residues in a single chain. Our tools will complain if you try using them on such a molecule. ## About Manipulating PDB files is often painful. Extracting a particular chain or set of residues, renumbering residues, splitting or merging models and chains, or just ensuring the file is conforming to the PDB specifications are examples of tasks that can be done using any decent parsing library or graphical interface. These, however, almost always require 1) scripting knowledge, 2) time, and 3) installing one or more programs. `pdb-tools` were designed to be a swiss army knife for the PDB format. The philosophy of the scripts is simple: one script, one task. If you want to do two things, pipe the scripts together. Requests for new scripts will be taken into consideration - use the Issues button or write them yourself and create a Pull Request. ## Looking for the _other_ pdb-tools? The Harms lab maintains a set of tools also called `pdbtools`, which perform a slightly different set of functions. You can find them [here](https://github.com/harmslab/pdbtools). ## Citation We finally decided to write up a small publication describing the tools. If you used them in a project that is going to be published, please cite us: ``` Rodrigues JPGLM, Teixeira JMC, Trellet M and Bonvin AMJJ. pdb-tools: a swiss army knife for molecular structures. F1000Research 2018, 7:1961 (https://doi.org/10.12688/f1000research.17456.1) ``` If you use a reference manager that supports BibTex, use this record: ``` @Article{ 10.12688/f1000research.17456.1, AUTHOR = { Rodrigues, JPGLM and Teixeira, JMC and Trellet, M and Bonvin, AMJJ}, TITLE = {pdb-tools: a swiss army knife for molecular structures [version 1; peer review: 2 approved] }, JOURNAL = {F1000Research}, VOLUME = {7}, YEAR = {2018}, NUMBER = {1961}, DOI = {10.12688/f1000research.17456.1} } ``` ## Requirements `pdb-tools` should run on Python 2.7+ and Python 3.x. We test on Python 2.7, 3.6, and 3.7. There are no dependencies. ## Installing from Source Download the zip archive or clone the repository with git. We recommend the `git` approach since it makes updating the tools extremely simple. ```bash # To download git clone https://github.com/haddocking/pdb-tools cd pdb-tools # To update git pull origin master # To install python setup.py install ``` ## Contributing If you want to contribute to the development of `pdb-tools`, provide a bug fix, or a new tools, read our `CONTRIBUTING` instructions [here](https://github.com/haddocking/pdb-tools/blob/master/CONTRIBUTING.md). ## License `pdb-tools` are open-source and licensed under the Apache License, version 2.0. For details, see the LICENSE file. ## List of Tools
pdb_b

Modifies the temperature factor column of a PDB file (default 10.0).

Usage: python pdb_b.py -<bfactor> <pdb file> Example: python pdb_b.py -10.0 1CTF.pdb
pdb_chain

Modifies the chain identifier column of a PDB file (default is an empty chain).

Usage: python pdb_chain.py -<chain id> <pdb file> Example: python pdb_chain.py -C 1CTF.pdb
pdb_chainbows

Renames chain identifiers sequentially, based on TER records.

Since HETATM records are not separated by TER records and usually come together at the end of the PDB file, this script will attempt to reassign their chain identifiers based on the changes it made to ATOM lines. This might lead to bad output in certain corner cases. Usage: python pdb_chainbows.py <pdb file> Example: python pdb_chainbows.py 1CTF.pdb
pdb_chainxseg

Swaps the segment identifier for the chain identifier.

Usage: python pdb_chainxseg.py <pdb file> Example: python pdb_chainxseg.py 1CTF.pdb
pdb_chkensemble

Checks all models in a multi-model PDB file have the same composition.

Composition is defined as same atoms/residues/chains. Usage: python pdb_chkensemble.py <pdb file> Example: python pdb_chkensemble.py 1CTF.pdb
pdb_delchain

Deletes all atoms matching specific chains in the PDB file.

Usage: python pdb_delchain.py -<option> <pdb file> Example: python pdb_delchain.py -A 1CTF.pdb # removes chain A from PDB file python pdb_delchain.py -A,B 1CTF.pdb # removes chains A and B from PDB file
pdb_delelem

Deletes all atoms matching the given element in the PDB file.

Elements are read from the element column. Usage: python pdb_delelem.py -<option> <pdb file> Example: python pdb_delelem.py -H 1CTF.pdb # deletes all protons python pdb_delelem.py -N 1CTF.pdb # deletes all nitrogens python pdb_delelem.py -H,N 1CTF.pdb # deletes all protons and nitrogens
pdb_delhetatm

Removes all HETATM records in the PDB file.

Usage: python pdb_delhetatm.py <pdb file> Example: python pdb_delhetatm.py 1CTF.pdb
pdb_delinsertion

Deletes insertion codes in a PDB file.

Deleting an insertion code shifts the residue numbering of downstream residues. Allows for picking specific residues to delete insertion codes for. Usage: python pdb_delinsertion.py [-<option>] <pdb file> Example: python pdb_delinsertion.py 1CTF.pdb # delete ALL insertion codes python pdb_delinsertion.py -A9,B12 1CTF.pdb # deletes ins. codes for res # 9 of chain A and 12 of chain B.
pdb_delres

Deletes a range of residues from a PDB file.

The range option has three components: start, end, and step. Start and end are optional and if ommitted the range will start at the first residue or end at the last, respectively. The step option can only be used if both start and end are provided. Note that the start and end values of the range are purely numerical, while the range actually refers to every N-th residue, regardless of their sequence number. Usage: python pdb_delres.py -[resid]:[resid]:[step] <pdb file> Example: python pdb_delres.py -1:10 1CTF.pdb # Deletes residues 1 to 10 python pdb_delres.py -1: 1CTF.pdb # Deletes residues 1 to END python pdb_delres.py -:5 1CTF.pdb # Deletes residues from START to 5. python pdb_delres.py -::5 1CTF.pdb # Deletes every 5th residue python pdb_delres.py -1:10:5 1CTF.pdb # Deletes every 5th residue from 1 to 10
pdb_delresname

Removes all residues matching the given name in the PDB file.

Residues names are matched *without* taking into consideration spaces. Usage: python pdb_delresname.py -<option> <pdb file> Example: python pdb_delresname.py -ALA 1CTF.pdb # removes only Alanines python pdb_delresname.py -ASP,GLU 1CTF.pdb # removes (-) charged residues
pdb_element

Assigns the elements in the PDB file from atom names.

Usage: python pdb_element.py <pdb file> Example: python pdb_element.py 1CTF.pdb
pdb_fetch

Downloads a structure in PDB format from the RCSB website.

Allows downloading the (first) biological structure if selected. Usage: python pdb_fetch.py [-biounit] <pdb code> Example: python pdb_fetch.py 1brs # downloads unit cell, all 6 chains python pdb_fetch.py -biounit 1brs # downloads biounit, 2 chains
pdb_fixinsert

Fixes insertion codes in a PDB file.

Works by deleting an insertion code and shifting the residue numbering of downstream residues. Allows for picking specific residues to delete insertion codes for. Usage: python pdb_fixinsert.py [-<option>] <pdb file> Example: python pdb_fixinsert.py 1CTF.pdb # delete ALL insertion codes python pdb_fixinsert.py -A9,B12 1CTF.pdb # deletes ins. codes for res # 9 of chain A and 12 of chain B.
pdb_fromcif

Rudimentarily converts a mmCIF file to the PDB format.

Will not convert if the file does not 'fit' in PDB format, e.g. too many chains, residues, or atoms. Will convert only the coordinate section. Usage: python pdb_fromcif.py <pdb file> Example: python pdb_fromcif.py 1CTF.pdb
pdb_gap

Finds gaps between consecutive protein residues in the PDB.

Detects gaps both by a distance criterion or discontinuous residue numbering. Only applies to protein residues. Usage: python pdb_gap.py <pdb file> Example: python pdb_gap.py 1CTF.pdb
pdb_head

Returns the first N coordinate (ATOM/HETATM) lines of the file.

Usage: python pdb_head.py -<num> <pdb file> Example: python pdb_head.py -100 1CTF.pdb # first 100 ATOM/HETATM lines of the file
pdb_intersect

Returns a new PDB file only with atoms in common to all input PDB files.

Atoms are judged equal is their name, altloc, res. name, res. num, insertion code and chain fields are the same. Coordinates are taken from the first input file. Keeps matching TER/ANISOU records. Usage: python pdb_intersect.py <pdb file> <pdb file> Example: python pdb_intersect.py 1XYZ.pdb 1ABC.pdb
pdb_keepcoord

Removes all non-coordinate records from the file.

Keeps only MODEL, ENDMDL, END, ATOM, HETATM, CONECT. Usage: python pdb_keepcoord.py <pdb file> Example: python pdb_keepcoord.py 1CTF.pdb
pdb_merge

Merges several PDB files into one.

The contents are not sorted and no lines are deleted (e.g. END, TER statements) so we recommend piping the results through `pdb_tidy.py`. Usage: python pdb_merge.py <pdb file> <pdb file> Example: python pdb_merge.py 1ABC.pdb 1XYZ.pdb
pdb_mkensemble

Merges several PDB files into one multi-model (ensemble) file.

Strips all HEADER information and adds REMARK statements with the provenance of each conformer. Usage: python pdb_mkensemble.py <pdb file> <pdb file> Example: python pdb_mkensemble.py 1ABC.pdb 1XYZ.pdb
pdb_occ

Modifies the occupancy column of a PDB file (default 1.0).

Usage: python pdb_occ.py -<occupancy> <pdb file> Example: python pdb_occ.py -1.0 1CTF.pdb
pdb_reatom

Renumbers atom serials in the PDB file starting from a given value (default 1).

Usage: python pdb_reatom.py -<number> <pdb file> Example: python pdb_reatom.py -10 1CTF.pdb # renumbers from 10 python pdb_reatom.py --1 1CTF.pdb # renumbers from -1
pdb_reres

Renumbers the residues of the PDB file starting from a given number (default 1).

Usage: python pdb_reres.py -<number> <pdb file> Example: python pdb_reres.py -10 1CTF.pdb # renumbers from 10 python pdb_reres.py --1 1CTF.pdb # renumbers from -1
pdb_rplchain

Performs in-place replacement of a chain identifier by another.

Usage: python pdb_rplchain.py -<from>:<to> <pdb file> Example: python pdb_rplchain.py -A:B 1CTF.pdb # Replaces chain A for chain B
pdb_rplresname

Performs in-place replacement of a residue name by another.

Affects all residues with that name. Usage: python pdb_rplresname.py -<from>:<to> <pdb file> Example: python pdb_rplresname.py -HIP:HIS 1CTF.pdb # changes all HIP residues to HIS
pdb_seg

Modifies the segment identifier column of a PDB file (default is an empty segment).

Usage: python pdb_seg.py -<segment id> <pdb file> Example: python pdb_seg.py -C 1CTF.pdb
pdb_segxchain

Swaps the chain identifier by the segment identifier.

If the segment identifier is longer than one character, the script will truncate it. Does not ensure unique chain IDs. Usage: python pdb_segxchain.py <pdb file> Example: python pdb_segxchain.py 1CTF.pdb
pdb_selaltloc

Selects altloc labels for the entire PDB file.

By default, selects the label with the highest occupancy value for each atom, but the user can define a specific altloc label to select. Selecting by highest occupancy removes all altloc labels for all atoms. If the user provides an option (e.g. -A), only atoms with conformers with an altloc A are processed by the script. If you select -A and an atom has conformers with altlocs B and C, both B and C will be kept in the output. Usage: python pdb_selaltloc.py [-<option>] <pdb file> Example: python pdb_selaltloc.py 1CTF.pdb # picks locations with highest occupancy python pdb_selaltloc.py -A 1CTF.pdb # picks alternate locations labelled 'A'
pdb_selatom

Selects all atoms matching the given name in the PDB file.

Atom names are matched *without* taking into consideration spaces, so ' CA ' (alpha carbon) and 'CA ' (calcium) will both be kept if -CA is passed. Usage: python pdb_selatom.py -<option> <pdb file> Example: python pdb_selatom.py -CA 1CTF.pdb # keeps only alpha-carbon atoms python pdb_selatom.py -CA,C,N,O 1CTF.pdb # keeps only backbone atoms
pdb_selchain

Extracts one or more chains from a PDB file.

Usage: python pdb_selchain.py -<chain id> <pdb file> Example: python pdb_selchain.py -C 1CTF.pdb # selects chain C python pdb_selchain.py -A,C 1CTF.pdb # selects chains A and C
pdb_selelem

Selects all atoms that match the given element(s) in the PDB file.

Elements are read from the element column. Usage: python pdb_selelem.py -<option> <pdb file> Example: python pdb_selelem.py -H 1CTF.pdb # selects all protons python pdb_selelem.py -N 1CTF.pdb # selects all nitrogens python pdb_selelem.py -H,N 1CTF.pdb # selects all protons and nitrogens
pdb_selhetatm

Selects all HETATM records in the PDB file.

Usage: python pdb_selhetatm.py <pdb file> Example: python pdb_selhetatm.py 1CTF.pdb
pdb_selmodel

Extracts one or more models from a PDB file.

If the PDB file has no MODEL records, returns the entire file. Usage: python pdb_selmodel.py -<model id> <pdb file> Example: python pdb_selmodel.py -1 1GGR.pdb # selects model 1 python pdb_selmodel.py -1,3 1GGR.pdb # selects models 1 and 3
pdb_selres

Selects residues by their index, piecewise or in a range.

The range option has three components: start, end, and step. Start and end are optional and if ommitted the range will start at the first residue or end at the last, respectively. Usage: python pdb_selres.py -[resid]:[resid]:[step] <pdb file> Example: python pdb_selres.py -1,2,4,6 1CTF.pdb # Extracts residues 1, 2, 4 and 6 python pdb_selres.py -1:10 1CTF.pdb # Extracts residues 1 to 10 python pdb_selres.py -1:10,20:30 1CTF.pdb # Extracts residues 1 to 10 and 20 to 30 python pdb_selres.py -1: 1CTF.pdb # Extracts residues 1 to END python pdb_selres.py -:5 1CTF.pdb # Extracts residues from START to 5. python pdb_selres.py -::5 1CTF.pdb # Extracts every 5th residue python pdb_selres.py -1:10:5 1CTF.pdb # Extracts every 5th residue from 1 to 10
pdb_selresname

Selects all residues matching the given name in the PDB file.

Residues names are matched *without* taking into consideration spaces. Usage: python pdb_selresname.py -<option> <pdb file> Example: python pdb_selresname.py -ALA 1CTF.pdb # keeps only Alanines python pdb_selresname.py -ASP,GLU 1CTF.pdb # keeps (-) charged residues
pdb_selseg

Selects all atoms matching the given segment identifier.

Usage: python pdb_selseg.py -<segment id> <pdb file> Example: python pdb_selseg.py -C 1CTF.pdb # selects segment C python pdb_selseg.py -C,D 1CTF.pdb # selects segments C and D
pdb_shiftres

Shifts the residue numbers in the PDB file by a constant value.

Usage: python pdb_shiftres.py -<number> <pdb file> Example: python pdb_shiftres.py -10 1CTF.pdb # adds 10 to the original numbering python pdb_shiftres.py --5 1CTF.pdb # subtracts 5 from the original numbering
pdb_sort

Sorts the ATOM/HETATM/ANISOU/CONECT records in a PDB file.

Atoms are always sorted by their serial number, meaning the original ordering of the atoms within each residue are not changed. Alternate locations are sorted by default. Residues are sorted according to their residue sequence number and then by their insertion code (if any). Chains are sorted by their chain identifier. Finally, the file is sorted by all keys, and the records are placed in the following order: - ATOM/ANISOU, intercalated if the latter exist - HETATM - CONECT, sorted by the serial number of the central (first) atom MASTER, TER, END statements are removed. Headers (HEADER, REMARK, etc) are kept and placed first. Does NOT support multi-model files. Use pdb_splitmodel, then pdb_sort on each model, and then pdb_mkensemble. Usage: python pdb_sort.py -<option> <pdb file> Example: python pdb_sort.py 1CTF.pdb # sorts by chain and residues python pdb_sort.py -C 1CTF.pdb # sorts by chain (A, B, C ...) only python pdb_sort.py -R 1CTF.pdb # sorts by residue number/icode only
pdb_splitchain

Splits a PDB file into several, each containing one chain.

Usage: python pdb_splitchain.py <pdb file> Example: python pdb_splitchain.py 1CTF.pdb
pdb_splitmodel

Splits a PDB file into several, each containing one MODEL.

Usage: python pdb_splitmodel.py <pdb file> Example: python pdb_splitmodel.py 1CTF.pdb
pdb_splitseg

Splits a PDB file into several, each containing one segment.

Usage: python pdb_splitseg.py <pdb file> Example: python pdb_splitseg.py 1CTF.pdb
pdb_tidy

Modifies the file to adhere (as much as possible) to the format specifications.

Expects a sorted file - REMARK/ATOM/HETATM/END - so use pdb_sort in case you are not sure. This includes: - Adding TER statements after chain breaks/changes - Truncating/Padding all lines to 80 characters - Adds END statement at the end of the file Will remove all original TER/END statements from the file. Usage: python pdb_tidy.py [-strict] <pdb file> Example: python pdb_tidy.py 1CTF.pdb python pdb_tidy.py -strict 1CTF.pdb # does not add TER on chain breaks
pdb_tocif

Rudimentarily converts the PDB file to mmCIF format.

Will convert only the coordinate section. Usage: python pdb_tocif.py <pdb file> Example: python pdb_tocif.py 1CTF.pdb
pdb_tofasta

Extracts the residue sequence in a PDB file to FASTA format.

Canonical amino acids and nucleotides are represented by their one-letter code while all others are represented by 'X'. The -multi option splits the different chains into different records in the FASTA file. Usage: python pdb_tofasta.py [-multi] <pdb file> Example: python pdb_tofasta.py 1CTF.pdb
pdb_uniqname

Renames atoms sequentially (C1, C2, O1, ...) for each HETATM residue.

Relies on an element column being present (see pdb_element). Usage: python pdb_uniqname.py <pdb file> Example: python pdb_uniqname.py 1CTF.pdb
pdb_validate

Validates the PDB file ATOM/HETATM lines according to the format specifications.

Does not catch all the errors though... people are creative! Usage: python pdb_validate.py <pdb file> Example: python pdb_validate.py 1CTF.pdb
pdb_wc

Summarizes the contents of a PDB file, like the wc command in UNIX.

By default, this tool produces a general summary, but you can use several options to produce focused but more detailed summaries: [m] - no. of models. [c] - no. of chains (plus per-model if multi-model file). [r] - no. of residues (plus per-model if multi-model file). [a] - no. of atoms (plus per-model if multi-model file). [h] - no. of HETATM (plus per-model if multi-model file). [o] - presence of disordered atoms (altloc). [i] - presence of insertion codes. Usage: python pdb_wc.py [-<option>] <pdb file> Example: python pdb_wc.py 1CTF.pdb
pdb-tools-2.5.1/docs/index.md.template000066400000000000000000000115001453627464200176270ustar00rootroot00000000000000--- layout: default --- A swiss army knife for manipulating and editing PDB files. ## Installation Instructions `pdb-tools` are available on PyPi and can be installed though `pip`. This is the recommended way as it makes updating/uninstalling rather simple: ```bash pip install pdb-tools ``` Because we use semantic versioning in the development of `pdb-tools`, every bugfix or new feature results in a new version of the software that is automatically published on PyPI. As such, there is no difference between the code on github and the latest version you can install with `pip`. To update your installation to the latest version of the code run: ```bash pip install --upgrade pdb-tools ``` ## What can I do with them? The purpose of each tool should be obvious from its name. In any case, [here](#list-of-tools) is a list of all the tools in the suite and their function. All tools share the same command-line interface. Below are a couple of examples to get you started. If you want to check out more examples of how to use the tools and their applications, or have any cool examples of your own, check out the [cookbook](cookbook). * Downloading a structure ```bash pdb_fetch 1brs > 1brs.pdb # 6 chains pdb_fetch -biounit 1brs > 1brs.pdb # 2 chains ``` * Renumbering a structure ```bash pdb_reres -1 1ctf.pdb > 1ctf_renumbered.pdb ``` * Selecting chain(s) ```bash pdb_selchain -A 1brs.pdb > 1brs_A.pdb pdb_selchain -A,D 1brs.pdb > 1brs_AD.pdb ``` * Deleting hydrogens ```bash pdb_delelem -H 1brs.pdb > 1brs_noH.pdb ``` * Selecting backbone atoms ```bash pdb_selatom -CA,C,N,O 1brs.pdb > 1brs_bb.pdb ``` * Selecting chains, removing HETATM, and producing a valid PDB file ```bash pdb_selchain -A,D 1brs.pdb | pdb_delhetatm | pdb_tidy > 1brs_AD_noHET.pdb ``` *Note: On Windows the tools will have the `.exe` extension.* ## What _can't_ I do with them? Operations that involve coordinates or numerical calculations are usually not in the scope of `pdb-tools`. Use a proper library for that, it will be much faster and scalable. Also, although we provide mmCIF<->PDB converters, we do not support large mmCIF files with more than 99999 atoms, or 9999 residues in a single chain. Our tools will complain if you try using them on such a molecule. ## About Manipulating PDB files is often painful. Extracting a particular chain or set of residues, renumbering residues, splitting or merging models and chains, or just ensuring the file is conforming to the PDB specifications are examples of tasks that can be done using any decent parsing library or graphical interface. These, however, almost always require 1) scripting knowledge, 2) time, and 3) installing one or more programs. `pdb-tools` were designed to be a swiss army knife for the PDB format. The philosophy of the scripts is simple: one script, one task. If you want to do two things, pipe the scripts together. Requests for new scripts will be taken into consideration - use the Issues button or write them yourself and create a Pull Request. ## Looking for the _other_ pdb-tools? The Harms lab maintains a set of tools also called `pdbtools`, which perform a slightly different set of functions. You can find them [here](https://github.com/harmslab/pdbtools). ## Citation We finally decided to write up a small publication describing the tools. If you used them in a project that is going to be published, please cite us: ``` Rodrigues JPGLM, Teixeira JMC, Trellet M and Bonvin AMJJ. pdb-tools: a swiss army knife for molecular structures. F1000Research 2018, 7:1961 (https://doi.org/10.12688/f1000research.17456.1) ``` If you use a reference manager that supports BibTex, use this record: ``` @Article{ 10.12688/f1000research.17456.1, AUTHOR = { Rodrigues, JPGLM and Teixeira, JMC and Trellet, M and Bonvin, AMJJ}, TITLE = {pdb-tools: a swiss army knife for molecular structures [version 1; peer review: 2 approved] }, JOURNAL = {F1000Research}, VOLUME = {7}, YEAR = {2018}, NUMBER = {1961}, DOI = {10.12688/f1000research.17456.1} } ``` ## Requirements `pdb-tools` should run on Python 2.7+ and Python 3.x. We test on Python 2.7, 3.6, and 3.7. There are no dependencies. ## Installing from Source Download the zip archive or clone the repository with git. We recommend the `git` approach since it makes updating the tools extremely simple. ```bash # To download git clone https://github.com/haddocking/pdb-tools cd pdb-tools # To update git pull origin master # To install python setup.py install ``` ## Contributing If you want to contribute to the development of `pdb-tools`, provide a bug fix, or a new tools, read our `CONTRIBUTING` instructions [here](https://github.com/haddocking/pdb-tools/blob/master/CONTRIBUTING.md). ## License `pdb-tools` are open-source and licensed under the Apache License, version 2.0. For details, see the LICENSE file. ## List of Tools pdb-tools-2.5.1/docs/logo/000077500000000000000000000000001453627464200153275ustar00rootroot00000000000000pdb-tools-2.5.1/docs/logo/pdb-tools.png000066400000000000000000002673311453627464200177540ustar00rootroot00000000000000PNG  IHDR< pHYs.#.#x?v IDATx ձ Seay>AAcJA74PWB|*q%QP$FAD6% BWsO{}߅[]N*IQ ExBEQ&' ILo(R.'$E4g$4g[r׆H4i@pLÙG p(#zN! Mٽǚ^Tm4A ;wv|/.Kz^ IR/xWqI뗥lAzB S|8j8^+8 5L65q.>I0 4 6^CƅIۋ|H)  vT^ݸi?Ѩm$ IJٙ5gI"0E?zCeeX|"{u4^]ϏAadbA{{ͺC0~sHc@&SHFa$Ia5w֫@[֩Y׉Vi>?gG\Gee7̙w_%uBB=AII|TJGg,IR~]sD?180)"=$! JU6u;vP'$6AI;f +kƛC }m`S;-[馼+H5[N5xVxw~B _P?}H׸[ \FN>v(ph{ti/f^ p$A6Y.X h=ZC߲We4Xhې&ď J -[>)  !Ə( z!rfut}$LeEnX z: dg(EaԼ[)E3ڝhAmҒ>*Do]x;h`?zj%0%hH#+N}m0A@S5o~7.mV`ageGm ,EQܶTLN`w&/i%=:7h 7 XC §N Jӎ!d2U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ư` xdO~l#JYEQ ](7Þ;v:ө%('mE4|F /tڛ`=v2kAɑ-(᧣W^@#.pA bg={;q}tݭwe0B!'C4P/ ^Zj;k-(Iu^\(JjلǺXJqR%61 ޚr;=)}?HbcMxv),i3S\aW{no?Fv}ѧg&jz! ˡX:G>,KlRZ+ޓuc)ezhCNBS8e,m;zб_|}4{lJOO eASe~>.?u {"@' _#n̏G~`dϽT*m/m{.IIt! JD -t0`{J9[uK&u-H!9؋?Dtp v}[%r6I;7I7ۃ=F]칵io\ 6UW8~[-mIU5 ~~i썿 4,{qUԡڏTv|2h:ֺ&^[|رt٥#p#p{.Z6 ڈcq Kt -%Ǩnh֋M^2h% r{PcLUB2ЙV0| AM{SXG8*umܱ-%6S)HmF\K%/+@~>?|@ BSzIAt8&&%usb;ZI;@%Jiwi)8+q \Џ NMۇXp{I&oZ/G BED+^%V叙tRΒX3{BxԎ_S-u#.=4GkV\:r(3׏L/}r{ϋw?xq3B-KR?ZaVC큩Tޖc Y=?&2#[POG):5hMTq'Ai+Qgt[Mͽ'~e9ދ\Џ NM[z,Voe{4 lp< P_`Ejjy ].l%_#n랽 m͛mpT!m{(4OF ;&~哀"؞zɸL/4{p lpL!y<ZUs0;JOO ӍMe>Y\칸,`bo x@.IItUKGrip(!E#n=}Ah{$A"@68b%=47.? 3ڈ[0Wicp<O"Zlk@wJ MMݻ'fJ5ر^6qB6 qCZEPLL tXI](JvT[[CE7[z6`mx<D T! XF\@MN#ٸCB )O`"-q`.I[̂. ( m*"(IΫ0 ث1 y<D4X T5 !9Bs ,V4BB~ IENDB`pdb-tools-2.5.1/pdbtools/000077500000000000000000000000001453627464200152655ustar00rootroot00000000000000pdb-tools-2.5.1/pdbtools/__init__.py000066400000000000000000000063701453627464200174040ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """The pdb-tools library. A Swiss army knife for manipulating and editing PDB files. You can use pdb-tools as a library or as a series of convenient command-line applications. The complete documentation is available at: http://www.bonvinlab.org/pdb-tools/ Examples at the command-line ---------------------------- $ pdb_fetch 1brs > 1brs.pdb $ pdb_reres -1 1ctf.pdb > 1ctf_renumbered.pdb $ pdb_selchain -A,D 1brs.pdb | pdb_delhetatm | pdb_tidy > 1brs_AD_noHET.pdb Examples using pdb-tools as library ----------------------------------- You can import according to your needs: >>> import pdbtools >>> from pdbtools import * >>> from pdbtools import MODULE >>> from pdbtools import pdb_selchain Chain the different functionalities conveniently: >>> from pdbtools import pdb_selchain, pdb_selatom, pdb_keepcoord >>> with open('dummy.pdb') as fh: >>> chain_a = pdb_selchain.run(fh, ['A']) >>> only_N = pdb_selatom.run(chain_a, ['N']) >>> coords = pdb_keepcoord.run(only_N) >>> final = pdb_reres.run(coords, 5) >>> print(''.join(final)) The list of MODULEs is specified bellow. All packages have three functions: `check_input`, `main`, and `run`. The latter executes the logic of each package. `check_input` checks and prepares potential input parameters to feed `run`. Use `check_input` in case you are not sure the received input is correct. You can chain both functions: >>> MODULE.run(**MODULE.check_input(*args)) If you control the input parameters use `run` directly. In general, `run` functions are generators yielding the modified PDB data line-by-line. `main` is used solely in the context of the command-line interface. All MODULEs and `run` functions provide comprehensive documentation. >>> help(MODULE) >>> help(MODULE.run) """ __all__ = [ 'pdb_b', 'pdb_chainbows', 'pdb_chain', 'pdb_chainxseg', 'pdb_chkensemble', 'pdb_delchain', 'pdb_delelem', 'pdb_delhetatm', 'pdb_delinsertion', 'pdb_delresname', 'pdb_delres', 'pdb_element', 'pdb_fetch', 'pdb_fixinsert', 'pdb_fromcif', 'pdb_gap', 'pdb_head', 'pdb_intersect', 'pdb_keepcoord', 'pdb_merge', 'pdb_mkensemble', 'pdb_occ', 'pdb_reatom', 'pdb_reres', 'pdb_rplchain', 'pdb_rplresname', 'pdb_seg', 'pdb_segxchain', 'pdb_selaltloc', 'pdb_selatom', 'pdb_selchain', 'pdb_selelem', 'pdb_selhetatm', 'pdb_selresname', 'pdb_selres', 'pdb_selseg', 'pdb_shiftres', 'pdb_sort', 'pdb_splitchain', 'pdb_splitmodel', 'pdb_splitseg', 'pdb_tidy', 'pdb_tocif', 'pdb_tofasta', 'pdb_uniqname', 'pdb_validate', 'pdb_wc', ] pdb-tools-2.5.1/pdbtools/pdb_b.py000066400000000000000000000116421453627464200167110ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Modifies the temperature factor column of a PDB file (default 10.0). Usage: python pdb_b.py - Example: python pdb_b.py -10.0 1CTF.pdb This program is part of the `pdb-tools` suite of utilities and should not be distributed isolatedly. The `pdb-tools` were created to quickly manipulate PDB files using the terminal, and can be used sequentially, with one tool streaming data to another. They are based on old FORTRAN77 code that was taking too much effort to maintain and compile. RIP. """ import os import sys __author__ = "Joao Rodrigues" __email__ = "j.p.g.l.m.rodrigues@gmail.com" def check_input(args): """Checks whether to read from stdin/file and validates user input/options. """ # Defaults option = 10.0 fh = sys.stdin # file handle if not len(args): # Reading from pipe with default option if sys.stdin.isatty(): sys.stderr.write(__doc__) sys.exit(1) elif len(args) == 1: # One of two options: option & Pipe OR file & default option if args[0].startswith('-'): option = args[0][1:] if sys.stdin.isatty(): # ensure the PDB data is streamed in emsg = 'ERROR!! No data to process!\n' sys.stderr.write(emsg) sys.stderr.write(__doc__) sys.exit(1) else: if not os.path.isfile(args[0]): emsg = 'ERROR!! File not found or not readable: \'{}\'\n' sys.stderr.write(emsg.format(args[0])) sys.stderr.write(__doc__) sys.exit(1) fh = open(args[0], 'r') elif len(args) == 2: # Two options: option & File if not args[0].startswith('-'): emsg = 'ERROR! First argument is not an option: \'{}\'\n' sys.stderr.write(emsg.format(args[0])) sys.stderr.write(__doc__) sys.exit(1) if not os.path.isfile(args[1]): emsg = 'ERROR!! File not found or not readable: \'{}\'\n' sys.stderr.write(emsg.format(args[1])) sys.stderr.write(__doc__) sys.exit(1) option = args[0][1:] fh = open(args[1], 'r') else: # Whatever ... sys.stderr.write(__doc__) sys.exit(1) # Validate option try: option = float(option) except ValueError: emsg = 'ERROR!! You provided an invalid b-factor value: \'{}\'' sys.stderr.write(emsg.format(option)) sys.exit(1) return (fh, option) def pad_line(line): """Pad line to 80 characters in case it is shorter.""" size_of_line = len(line) if size_of_line < 80: padding = 80 - size_of_line + 1 line = line.strip('\n') + ' ' * padding + '\n' return line[:81] # 80 + newline character def run(fhandle, bfactor): """ Set the temperature column in all ATOM/HETATM records to a given value. This function is a generator. Parameters ---------- fhandle : a line-by-line iterator of the original PDB file. bfactor : float The desired bfactor. Yields ------ str (line-by-line) The modified (or not) PDB line. """ _pad_line = pad_line records = ('ATOM', 'HETATM') bfactor = "{0:>6.2f}".format(bfactor) for line in fhandle: if line.startswith(records): line = _pad_line(line) yield line[:60] + bfactor + line[66:] else: yield line alter_bfactor = run def main(): # Check Input pdbfh, bfactor = check_input(sys.argv[1:]) # Do the job new_pdb = run(pdbfh, bfactor) # Output results try: _buffer = [] _buffer_size = 5000 # write N lines at a time for lineno, line in enumerate(new_pdb): if not (lineno % _buffer_size): sys.stdout.write(''.join(_buffer)) _buffer = [] _buffer.append(line) sys.stdout.write(''.join(_buffer)) sys.stdout.flush() except IOError: # This is here to catch Broken Pipes # for example to use 'head' or 'tail' without # the error message showing up pass # last line of the script # Close file handle even if it is sys.stdin, no problem here. pdbfh.close() sys.exit(0) if __name__ == '__main__': main() pdb-tools-2.5.1/pdbtools/pdb_chain.py000066400000000000000000000115331453627464200175510ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Modifies the chain identifier column of a PDB file (default is an empty chain). Usage: python pdb_chain.py - Example: python pdb_chain.py -C 1CTF.pdb This program is part of the `pdb-tools` suite of utilities and should not be distributed isolatedly. The `pdb-tools` were created to quickly manipulate PDB files using the terminal, and can be used sequentially, with one tool streaming data to another. They are based on old FORTRAN77 code that was taking too much effort to maintain and compile. RIP. """ import os import sys __author__ = "Joao Rodrigues" __email__ = "j.p.g.l.m.rodrigues@gmail.com" def check_input(args): """Checks whether to read from stdin/file and validates user input/options. """ # Defaults option = ' ' fh = sys.stdin # file handle if not len(args): # Reading from pipe with default option if sys.stdin.isatty(): sys.stderr.write(__doc__) sys.exit(1) elif len(args) == 1: # One of two options: option & Pipe OR file & default option if args[0].startswith('-'): option = args[0][1:] if sys.stdin.isatty(): # ensure the PDB data is streamed in emsg = 'ERROR!! No data to process!\n' sys.stderr.write(emsg) sys.stderr.write(__doc__) sys.exit(1) else: if not os.path.isfile(args[0]): emsg = 'ERROR!! File not found or not readable: \'{}\'\n' sys.stderr.write(emsg.format(args[0])) sys.stderr.write(__doc__) sys.exit(1) fh = open(args[0], 'r') elif len(args) == 2: # Two options: option & File if not args[0].startswith('-'): emsg = 'ERROR! First argument is not an option: \'{}\'\n' sys.stderr.write(emsg.format(args[0])) sys.stderr.write(__doc__) sys.exit(1) if not os.path.isfile(args[1]): emsg = 'ERROR!! File not found or not readable: \'{}\'\n' sys.stderr.write(emsg.format(args[1])) sys.stderr.write(__doc__) sys.exit(1) option = args[0][1:] fh = open(args[1], 'r') else: # Whatever ... sys.stderr.write(__doc__) sys.exit(1) # Validate option if len(option) != 1: emsg = 'ERROR!! Chain identifiers must be a single character: \'{}\'\n' sys.stderr.write(emsg.format(option)) sys.exit(1) return (fh, option) def pad_line(line): """Helper function to pad line to 80 characters in case it is shorter""" size_of_line = len(line) if size_of_line < 80: padding = 80 - size_of_line + 1 line = line.strip('\n') + ' ' * padding + '\n' return line[:81] # 80 + newline character def run(fhandle, chain_id): """ Set the chain identifier column in all ATOM/HETATM records to a value. This function is a generator. Parameters ---------- fhandle : a line-by-line iterator of the original PDB file. chain_id : str The new chain ID. Yields ------ str (line-by-line) The modified (or not) PDB line. """ _pad_line = pad_line records = ('ATOM', 'HETATM', 'TER', 'ANISOU') for line in fhandle: if line.startswith(records): line = _pad_line(line) yield line[:21] + chain_id + line[22:] else: yield line alter_chain = run def main(): # Check Input pdbfh, chain = check_input(sys.argv[1:]) # Do the job new_pdb = run(pdbfh, chain) try: _buffer = [] _buffer_size = 5000 # write N lines at a time for lineno, line in enumerate(new_pdb): if not (lineno % _buffer_size): sys.stdout.write(''.join(_buffer)) _buffer = [] _buffer.append(line) sys.stdout.write(''.join(_buffer)) sys.stdout.flush() except IOError: # This is here to catch Broken Pipes # for example to use 'head' or 'tail' without # the error message showing up pass # last line of the script # We can close it even if it is sys.stdin pdbfh.close() sys.exit(0) if __name__ == '__main__': main() pdb-tools-2.5.1/pdbtools/pdb_chainbows.py000066400000000000000000000106061453627464200204440ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2020 João Pedro Rodrigues # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Renames chain identifiers sequentially, based on TER records. Since HETATM records are not separated by TER records and usually come together at the end of the PDB file, this script will attempt to reassign their chain identifiers based on the changes it made to ATOM lines. This might lead to bad output in certain corner cases. Usage: python pdb_chainbows.py Example: python pdb_chainbows.py 1CTF.pdb This program is part of the `pdb-tools` suite of utilities and should not be distributed isolatedly. The `pdb-tools` were created to quickly manipulate PDB files using the terminal, and can be used sequentially, with one tool streaming data to another. They are based on old FORTRAN77 code that was taking too much effort to maintain and compile. RIP. """ import os import string import sys __author__ = "Joao Rodrigues" __email__ = "j.p.g.l.m.rodrigues@gmail.com" def check_input(args): """Checks whether to read from stdin/file and validates user input/options. """ # Defaults fh = sys.stdin # file handle if not len(args): # Reading from pipe with default option if sys.stdin.isatty(): sys.stderr.write(__doc__) sys.exit(1) elif len(args) == 1: if not os.path.isfile(args[0]): emsg = 'ERROR!! File not found or not readable: \'{}\'\n' sys.stderr.write(emsg.format(args[0])) sys.stderr.write(__doc__) sys.exit(1) fh = open(args[0], 'r') else: # Whatever ... emsg = 'ERROR!! Script takes 1 argument, not \'{}\'\n' sys.stderr.write(emsg.format(len(args))) sys.stderr.write(__doc__) sys.exit(1) return fh def run(fhandle): """ Set chains sequentially based on existing TER records. Follow sequence [ABC...abc...012...]. This function is a generator. Parameters ---------- fhandle : an iterable giving the PDB file line-by-line Yields ------ str (line-by-line) The modified (or not) PDB line. """ chainlist = list( string.digits[::-1] + string.ascii_lowercase[::-1] + string.ascii_uppercase[::-1] ) # 987...zyx...cbaZYX...BCA. max_chains = len(chainlist) chain_map = {} # for HETATM. curchain = chainlist.pop() records = ('ATOM', 'TER', 'ANISOU') for line in fhandle: if line.startswith(records): chain_map[line[21]] = curchain line = line[:21] + curchain + line[22:] if line.startswith('TER'): try: curchain = chainlist.pop() except IndexError: emsg = 'ERROR!! Structure contains more than {} TER records.\n' sys.stderr.write(emsg.format(max_chains)) sys.stderr.write(__doc__) sys.exit(1) elif line.startswith('HETATM'): hetchain = chain_map[line[21]] line = line[:21] + hetchain + line[22:] yield line set_chain_sequence = run def main(): # Check Input pdbfh = check_input(sys.argv[1:]) # Do the job new_pdb = run(pdbfh) try: _buffer = [] _buffer_size = 5000 # write N lines at a time for lineno, line in enumerate(new_pdb): if not (lineno % _buffer_size): sys.stdout.write(''.join(_buffer)) _buffer = [] _buffer.append(line) sys.stdout.write(''.join(_buffer)) sys.stdout.flush() except IOError: # This is here to catch Broken Pipes # for example to use 'head' or 'tail' without # the error message showing up pass # last line of the script # We can close it even if it is sys.stdin pdbfh.close() sys.exit(0) if __name__ == '__main__': main() pdb-tools-2.5.1/pdbtools/pdb_chainxseg.py000066400000000000000000000073441453627464200204450ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Swaps the segment identifier for the chain identifier. Usage: python pdb_chainxseg.py Example: python pdb_chainxseg.py 1CTF.pdb This program is part of the `pdb-tools` suite of utilities and should not be distributed isolatedly. The `pdb-tools` were created to quickly manipulate PDB files using the terminal, and can be used sequentially, with one tool streaming data to another. They are based on old FORTRAN77 code that was taking too much effort to maintain and compile. RIP. """ import os import sys __author__ = "Joao Rodrigues" __email__ = "j.p.g.l.m.rodrigues@gmail.com" def check_input(args): """Checks whether to read from stdin/file and validates user input/options. """ # Defaults fh = sys.stdin # file handle if not len(args): # Reading from pipe if sys.stdin.isatty(): sys.stderr.write(__doc__) sys.exit(1) elif len(args) == 1: # Reading from file if not os.path.isfile(args[0]): emsg = 'ERROR!! File not found or not readable: \'{}\'\n' sys.stderr.write(emsg.format(args[0])) sys.stderr.write(__doc__) sys.exit(1) fh = open(args[0], 'r') else: # Whatever ... emsg = 'ERROR!! Script takes 1 argument, not \'{}\'\n' sys.stderr.write(emsg.format(len(args))) sys.stderr.write(__doc__) sys.exit(1) return fh def pad_line(line): """Helper function to pad line to 80 characters in case it is shorter""" size_of_line = len(line) if size_of_line < 80: padding = 80 - size_of_line + 1 line = line.strip('\n') + ' ' * padding + '\n' return line[:81] # 80 + newline character def run(fhandle): """ Replace the segment identifier with the contents of the chain identifier. Acts on ATOM/HETATM/ANISOU. This function is a generator. Parameters ---------- fhandle : a line-by-line iterator of the original PDB file. Yields ------ str (line-by-line) The modified (or not) PDB line. """ _pad_line = pad_line records = ('ATOM', 'HETATM', 'ANISOU') for line in fhandle: if line.startswith(records): line = _pad_line(line) yield line[:72] + line[21].ljust(4) + line[76:] else: yield line place_chain_on_seg = run def main(): # Check Input pdbfh = check_input(sys.argv[1:]) # Do the job new_pdb = run(pdbfh) try: _buffer = [] _buffer_size = 5000 # write N lines at a time for lineno, line in enumerate(new_pdb): if not (lineno % _buffer_size): sys.stdout.write(''.join(_buffer)) _buffer = [] _buffer.append(line) sys.stdout.write(''.join(_buffer)) sys.stdout.flush() except IOError: # This is here to catch Broken Pipes # for example to use 'head' or 'tail' without # the error message showing up pass # last line of the script # We can close it even if it is sys.stdin pdbfh.close() sys.exit(0) if __name__ == '__main__': main() pdb-tools-2.5.1/pdbtools/pdb_chkensemble.py000066400000000000000000000122421453627464200207450ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Checks all models in a multi-model PDB file have the same composition. Composition is defined as same atoms/residues/chains. Usage: python pdb_chkensemble.py Example: python pdb_chkensemble.py 1CTF.pdb This program is part of the `pdb-tools` suite of utilities and should not be distributed isolatedly. The `pdb-tools` were created to quickly manipulate PDB files using the terminal, and can be used sequentially, with one tool streaming data to another. They are based on old FORTRAN77 code that was taking too much effort to maintain and compile. RIP. """ import itertools import os import sys __author__ = "Joao Rodrigues" __email__ = "j.p.g.l.m.rodrigues@gmail.com" def check_input(args): """Checks whether to read from stdin/file and validates user input/options. """ # Defaults fh = sys.stdin # file handle if not len(args): # Reading from pipe with default option if sys.stdin.isatty(): sys.stderr.write(__doc__) sys.exit(1) elif len(args) == 1: if not os.path.isfile(args[0]): emsg = 'ERROR!! File not found or not readable: \'{}\'\n' sys.stderr.write(emsg.format(args[0])) sys.stderr.write(__doc__) sys.exit(1) fh = open(args[0], 'r') else: # Whatever ... emsg = 'ERROR!! Script takes 1 argument, not \'{}\'\n' sys.stderr.write(emsg.format(len(args))) sys.stderr.write(__doc__) sys.exit(1) return fh def run(fhandle): """ Check if the ensemble is valid. - Same atoms in each model - Paired MODEL/ENDMDL tags Parameters ---------- fhandle : a line-by-line iterator of the original PDB file. Returns ------- int 1 if an error was found. 0 if no errors are found. """ model_open = False model_no = None model_data = {} # list of sets records = ('ATOM', 'HETATM', 'ANISOU', 'TER') for lineno, line in enumerate(fhandle): if line.startswith('MODEL'): if model_open: emsg = 'ERROR!! MODEL record found before ENDMDL at line \'{}\'\n' sys.stderr.write(emsg.format(lineno)) return 1 model_open = True model_no = int(line[10:14]) model_data[model_no] = set() elif line.startswith('ENDMDL'): if not model_open: emsg = 'ERROR!! ENDMDL record found before MODEL at line \'{}\'\n' sys.stderr.write(emsg.format(lineno)) return 1 model_open = False model_no = None # will fail to add lines if a new model is not open elif line.startswith(records): if not model_open: emsg = 'ERROR!! MODEL record missing before ATOM at line \'{}\'\n' sys.stderr.write(emsg.format(lineno)) return 1 atom_uid = line[6:27] model_data[model_no].add(atom_uid) else: if model_open: # Missing last ENDMDL emsg = 'ERROR!! ENDMDL record missing at line \'{}\'\n' sys.stderr.write(emsg.format(lineno)) return 1 # Verify all models have the same atoms bad_ensemble = False model_no_list = list(model_data.keys()) for model_i, model_j in itertools.combinations(model_no_list, 2): atoms_i = model_data[model_i] atoms_j = model_data[model_j] difference_ij = atoms_i - atoms_j difference_ji = atoms_j - atoms_i if difference_ij or difference_ji: bad_ensemble = True msg = 'Models {} and {} differ:\n' sys.stderr.write(msg.format(model_i, model_j)) if len(difference_ij): d_ij = sorted(difference_ij) msg = 'Atoms in model {} only:\n' sys.stderr.write(msg.format(model_i)) sys.stderr.write('\n'.join(d_ij)) if len(difference_ji): d_ji = sorted(difference_ji) msg = 'Atoms in model {} only:\n' sys.stderr.write(msg.format(model_j)) sys.stderr.write('\n'.join(d_ji)) if not bad_ensemble: n_models = len(model_data) msg = 'Ensemble of {} models *seems* OK\n' sys.stdout.write(msg.format(n_models)) return 0 return 1 check_ensemble = run def main(): # Check Input pdbfh = check_input(sys.argv[1:]) # Do the job status_code = check_ensemble(pdbfh) pdbfh.close() sys.exit(status_code) if __name__ == '__main__': main() pdb-tools-2.5.1/pdbtools/pdb_delchain.py000066400000000000000000000121211453627464200202300ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Deletes all atoms matching specific chains in the PDB file. Usage: python pdb_delchain.py -