Parse and manipulate PDB files with shell and PyMol


Many tasks we are performing in Integrative Modelling involve 3D structures of molecules. Visualising them, modifying them to fit a particular program requirements or just parsing them to analyse them can sometimes be time-consuming.
We are presenting here two approaches to quickly and easily manipulate PDB files.

Shell scripting (based on PDB-tools suite)

Several short and efficient python scripts have been gathered in the PDB-tools repository, developed and maintained by Joao Rodrigues and other contributors within the Computational Structural Group of Pr. Alexandre Bonvin lab. The main strength of these scripts relies on their simplicity of usage and the possibility to concatenate them in a full and complex pipeline, together with basic shell commands if needed, in the same way you pipe your favorite shell commands everyday. Last but not least, this suite of scripts do not required anything else than Python2.7+ and a shell terminal and their installation is really trivial. All the details can be found in the github repository of the project.
Here are few usage examples:

Downloading, extracting a chain and extracting its amino-acid sequence

Getting general information on a PDB file

Finding gaps in a PDB

PyMol ‘alter’ command

If you prefer to go through a 3D viewer, PyMol is a nice alternative to edit a PDB structure. More specifically, the ‘alter’ command, allows you to sequentially modify chain IDs or renumber a whole PDB. It can also be used in a more complete pipeline to change the representation (like vdw radius) of a selection of atoms based on their distance to a specific residue for instance. Possibilities are quite huge and you will know better than us the different steps that will lead to your next journal quality picture!
Few examples (you can find other example and a more complete definition of the command on its PyMol wiki page):

Change chain label and residue index

Change the b values of all atoms to the distance of the atoms to a reference point

 

Do not hesitate to give us feedback on these tips and tricks by dropping a comment on our forum or directly in the “Leave a reply” field below.

Leave a Reply