{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains material from [PyRosetta](https://RosettaCommons.github.io/PyRosetta.notebooks);\n", "content is available [on Github](https://github.com/RosettaCommons/PyRosetta.notebooks.git).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Residue Parameter Files](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/B.00-Appendix-B.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Links to Online Help](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/D.00-Appendix-D.ipynb) >

\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Cleaning pdb files" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Many pdb files have extraneous information and often do not conform to file standards. You may have to “clean” your pdb file before loading it into PyRosetta. You can do this through a variety of methods.\n", "\n", "- From within a UNIX shell:\n", "\n", "`grep \"^ATOM\" 1ABC.pdb > 1ABC.clean.pdb`\n", "\n", "\n", "- From within a DOS shell:\n", "\n", "`findstr /b \"ATOM\" 1ABC.pdb > 1ABC.clean.pdb`\n", "\n", "\n", "- Using a PyRosetta toolbox method cleanATOM\n", "\n", "`from pyrosetta.toolbox import cleanATOM\n", "cleanATOM(\"1YY8.pdb\")`\n", "\n", "In this example, the toolbox method cleanATOM will create a file called `1YY8.clean.pdb`, with all non-ATOM lines removed. Warning: this method will overwrite any other files of the same name in its directory.\n", "All of these methods will remove all lines that do not begin with ATOM in the pdb file and create a new “clean” pdb file named `1ABC.clean.pdb`.\n", "\n", "One could also easily write a script to clean multiple pdb files at once. Here is an example Bash (UNIX shell) script that will clean all pdb files in a single directory:\n", "\n", "`#!/bin/sh\n", "for pdbfile in *.pdb do\n", "echo \"cleaning $pdbfile...\"\n", "grep ^ATOM $pdbfile > ${pdbfile%.pdb}.clean.pdb\n", "done`\n", "\n", "\n", "If after cleaning a pdb file, PyRosetta still gives errors, you might use your text editor to open the pdb file and edit or remove the offending data lines manually." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Residue Parameter Files](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/B.00-Appendix-B.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Links to Online Help](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/D.00-Appendix-D.ipynb) >

\"Open" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.0" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }