-
Notifications
You must be signed in to change notification settings - Fork 32
ComputeSAS
dstoeckel edited this page Mar 16, 2015
·
3 revisions
BALL offers a class NumericalSAS() to compute a numerical surface.
#include <BALL/STRUCTURE/numericalSAS.h>
#include <BALL/STRUCTURE/defaultProcessors.h>
// Add other includes here
using namespace BALL;
//Load a structure from e.g. a PDBFile
Protein* protein = S.getProtein(0);
//Assign atom radii obtained from PARSE
AssignRadiusProcessor arp("radii/PARSE.siz");
protein->apply(arp);
//Create a NumericalSAS object and set some options
NumericalSAS sas_computer;
sas_computer.options.setBool(NumericalSAS::Option::COMPUTE_AREA, true);
sas_computer.options.setBool(NumericalSAS::Option::COMPUTE_VOLUME, false);
sas_computer.options.setBool(NumericalSAS::Option::COMPUTE_SURFACE, false);
sas_computer.options.setBool(NumericalSAS::Option::COMPUTE_SURFACE_PER_ATOM, false);
sas_computer.options.setBool(NumericalSAS::Option::COMPUTE_SURFACE_MAP, false);
sas_computer.options.setReal(NumericalSAS::Option::PROBE_RADIUS, 1.5);
sas_computer.options.setInteger(NumericalSAS::Option::NUMBER_OF_POINTS, 400); //Increase this number to obtain better results
//Compute a numerical approximation of the SAS
sas_computer(*protein);
std::cout << "Total surface area: " << sas_computer.getTotalArea() << std::endl;
//Print the area of every atom on the surface
HashMap<const Atom*, float> atom_areas = sas_computer.getAtomAreas();
for(AtomIterator it = protein->beginAtom(); +it; ++it)
{
std::cout << "Area for atom " << it->getFullName() << ": " << atom_areas[&*it] << std::endl;
}
from BALL import *
S = System()
sas = NumericalSAS()
# speed up the sas a little...
sas_options = Options()
sas_options.setBool(sas.Option.COMPUTE_AREA, True)
sas_options.setBool(sas.Option.COMPUTE_VOLUME, False)
sas_options.setBool(sas.Option.COMPUTE_SURFACE, False)
sas_options.setBool(sas.Option.COMPUTE_SURFACE_PER_ATOM, False)
sas_options.setBool(sas.Option.COMPUTE_SURFACE_MAP, False)
sas_options.setReal(sas.Option.PROBE_RADIUS, 1.5)
sas_options.setInteger(sas.Option.NUMBER_OF_POINTS, 400) #Increase this number to obtain better results
# set the options
sas.setOptions(sas_options)
# make sure to have correct radii
arp = AssignRadiusProcessor("radii/PARSE.siz")
S.apply(arp)
# compute the surface
sas(S)
# get the atom areas
protein_areas = {}
protein_areas = sas.getAtomAreas()
# print
for a in atoms(S):
print a.getName(), protein_areas[a]