Get area

From PyMOLWiki
Jump to navigation Jump to search

get_area calculates the surface area in square Angstroms of the selection given. Note that the accessibility is assessed in the context of the object(s) that the selection is part of. So, to get the surface areas of e.g. a component of a complex, you should make a new object containing a copy of just that component and calculate its area.

USAGE

get_area sele [,state[, load_b ]]

PYMOL API

cmd.get_area(string selection="(all)", load_b=0, state=0 )

Examples

Example 1 - starting with a complex in a single file

# load complex
# Haemoglobin in this example illustrates careful use of selection algebra
load 2HHB.pdb

# create objects for alpha1, beta1 and alpha1,beta1 pair of subunits
create alpha1, 2HHB and chain A
create beta1, 2HHB and chain B
create ab1, 2HHB and chain A+B

# get hydrogens onto everything (NOTE: must have valid valences on e.g. small organic molecules)
h_add

# make sure all atoms within an object occlude one another
flag ignore, none

# use solvent-accessible surface with high sampling density
set dot_solvent, 1
set dot_density, 3

# measure the components individually storing the results for later
alpha1_area=cmd.get_area("alpha1")
beta1_area=cmd.get_area("beta1")


# measure the alpha1,beta1 pair
ab1_area=cmd.get_area("ab1")

# now print results and do some maths to get the buried surface
print alpha1_area
print beta1_area
print ab1_area
print (alpha1_area + beta1_area) - ab1_area

Example 2 - starting with two components in separate files

# load components separately
load my_ligand.pdb
load my_target.pdb

# get hydrogens onto everything (NOTE: must have valid valences on the ligand...)
h_add

# make sure all atoms within an object occlude one another
flag ignore, none

# use solvent-accessible surface with high sampling density
set dot_solvent, 1
set dot_density, 3

# measure the components individually
ligand_area=cmd.get_area("my_ligand")
target_area=cmd.get_area("my_target")

# create the complex
create my_complex, my_ligand my_target

# measure the complex
complex_area=cmd.get_area("my_complex")

# now print results
print ligand_area
print target_area
print complex_area
print (ligand_area + target_area) - complex_area

Example 3 - using load_b to get surface area per atom

# example usage of load_b
# select some organic small molecule
select ligand, br. first organic
# get its area and load it into it's b-factor column
get_area ligand, load_b=1
# print out the b-factor/areas per atom
iterate ligand, print b

See Also