Draw Protein Dimensions: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 39: Line 39:
# calculate the dimensions of the full ASU
# calculate the dimensions of the full ASU
draw_Protein_Dimensions 2vak
draw_Protein_Dimensions 2vak
[[File:2vak_ASU.png]]


# you can extract only one chain and calculates the dimensions
# you can extract only one chain and calculates the dimensions
draw_Protein_Dimensions obj01
draw_Protein_Dimensions obj01
[[File:2vak_A.png]]


# You can also draw the Bounding boxes (AABB and IABB) to compare them.
# You can also draw the Bounding boxes (AABB and IABB) to compare them.
Line 48: Line 52:


draw_BB 2vak
draw_BB 2vak
[[File:2vak_AABB.png]]
[[File:2vak_IABB.png]]





Revision as of 08:05, 14 October 2015

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, which is called Inertia Axis Aligned Bounding Box (IABB), with a volume always lower than the AABB volume, and in many cases may correspond with the MBB.

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 2vak

2vak ASU.png

  1. you can extract only one chain and calculates the dimensions

draw_Protein_Dimensions obj01

2vak A.png

  1. You can also draw the Bounding boxes (AABB and IABB) to compare them.

fetch 2vak

draw_BB 2vak

2vak AABB.png 2vak IABB.png