Draw Protein Dimensions

From PyMOLWiki
Revision as of 05:30, 13 August 2015 by PabloGuardado (talk | contribs) (Created page with "{{Infobox script-repo |type = script |filename = Draw_Protein_Dimensions.py |author = Pablo Guardado Calvo }} This script will draw the dimension...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Type Python Script
Download Draw_Protein_Dimensions.py
Author(s) Pablo Guardado Calvo
License
This code has been put under version control in the project Pymol-script-repo

This script will draw the dimensions of a protein based on an Inertia Axis Aligned Bounding Box (IABB).


The idea behind this script is to calculate an approximate minimal bounding box (MBB) to extract the cell dimensions of a protein. To calculate the MBB is not trivial and usually the Axis Aligned Bounding Box (AABB) does not show up the real dimensions of the protein. This script calculates the inertia tensor of the object, extract the eigenvectors and use them to rotate the molecule (using as rotation matrix the transpose of the eigenvector matrix). The result is a molecule oriented with the inertia axis aligned with the cartesian axis. A new Bounding Box is calculated that is called Inertia Axis Aligned Bounding Box (IABB), with a volume always lower than AABB volume, and in many cases may correspond with the lowest volume. Of course, maybe it exists another Bounding Box with a lower volume (the minimal Bounding Box).

As always with these type of things, you have to use at your own risk. I did not try all the possible combinations, but if you find a bug, do not hesitate to contact me (pablo.guardado (at) gmail.com) or try to modify the code for yourself to correct it.

To load the script just type:

run path-to-the-script/Draw_Protein_Dimensions.py

or if you want something more permanent add the previous line to your .pymolrc file

The script works just typing:

draw_Protein_Dimensions selection

This will draw the cell dimensions of your selection based on a IABB box. It also generates the IABB box and the inertia axis, you just need to do "show cgo" to display them.

You could also try:

draw_BB selection

This will draw the AABB and IABB boxes with their cell dimensions and show up their volumes, you can compare them.


Examples

<source lang="python">

  1. download the source and save as Draw_Protein_Dimensions.py

run Draw_Protein_Dimensions.py fetch 2vak

  1. calculate the dimensions of the full ASU

draw_Protein_Dimensions.py