Package org.biojava.nbio.structure.asa
Class AsaCalculator
java.lang.Object
org.biojava.nbio.structure.asa.AsaCalculator
Class to calculate Accessible Surface Areas based on
the rolling ball algorithm by Shrake and Rupley.
The code is adapted from a python implementation at http://boscoh.com/protein/asapy
(now source is available at https://github.com/boscoh/asa).
Thanks to Bosco K. Ho for a great piece of code and for his fantastic blog.
See
Shrake, A., and J. A. Rupley. "Environment and Exposure to Solvent of Protein Atoms.
Lysozyme and Insulin." JMB (1973) 79:351-371.
Lee, B., and Richards, F.M. "The interpretation of Protein Structures: Estimation of
Static Accessibility" JMB (1971) 55:379-400
- Author:
- duarte_j
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final double
static final double
static final double
static final double
static final double
static final double
static final double
static final double
static final double
static final double
-
Constructor Summary
ConstructorDescriptionAsaCalculator
(Atom[] atoms, double probe, int nSpherePoints, int nThreads) Constructs a new AsaCalculator.AsaCalculator
(Structure structure, double probe, int nSpherePoints, int nThreads, boolean hetAtoms) Constructs a new AsaCalculator. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Calculates the Accessible Surface Areas for the atoms given in constructor and with parameters given.GroupAsa[]
Calculates ASA for all atoms and return them as a GroupAsa array (one element per residue in structure) containing ASAs per residue and per atom.static double
Gets the van der Waals radius of the given atom following the values defined by Chothia (1976) J.Mol.Biol.105,1-14 NOTE: the vdw values defined by the paper assume no Hydrogens and thus "inflates" slightly the heavy atoms to account for Hydrogens.
-
Field Details
-
DEFAULT_N_SPHERE_POINTS
public static final int DEFAULT_N_SPHERE_POINTS- See Also:
-
DEFAULT_PROBE_SIZE
public static final double DEFAULT_PROBE_SIZE- See Also:
-
DEFAULT_NTHREADS
public static final int DEFAULT_NTHREADS- See Also:
-
TRIGONAL_CARBON_VDW
public static final double TRIGONAL_CARBON_VDW- See Also:
-
TETRAHEDRAL_CARBON_VDW
public static final double TETRAHEDRAL_CARBON_VDW- See Also:
-
TRIGONAL_NITROGEN_VDW
public static final double TRIGONAL_NITROGEN_VDW- See Also:
-
TETRAHEDRAL_NITROGEN_VDW
public static final double TETRAHEDRAL_NITROGEN_VDW- See Also:
-
SULFUR_VDW
public static final double SULFUR_VDW- See Also:
-
OXIGEN_VDW
public static final double OXIGEN_VDW- See Also:
-
NUC_CARBON_VDW
public static final double NUC_CARBON_VDW- See Also:
-
NUC_NITROGEN_VDW
public static final double NUC_NITROGEN_VDW- See Also:
-
PHOSPHOROUS_VDW
public static final double PHOSPHOROUS_VDW- See Also:
-
-
Constructor Details
-
AsaCalculator
public AsaCalculator(Structure structure, double probe, int nSpherePoints, int nThreads, boolean hetAtoms) Constructs a new AsaCalculator. Subsequently callcalculateAsas()
orgetGroupAsas()
to calculate the ASAs Only non-Hydrogen atoms are considered in the calculation.- Parameters:
structure
-probe
-nSpherePoints
-nThreads
-hetAtoms
- if true HET residues are considered, if false they aren't, equivalent to NACCESS' -h option- See Also:
-
StructureTools.getAllNonHAtomArray
-
AsaCalculator
Constructs a new AsaCalculator. Subsequently callcalculateAsas()
orgetGroupAsas()
to calculate the ASAs.- Parameters:
atoms
- an array of atoms not containing Hydrogen atomsprobe
- the probe sizenSpherePoints
- the number of points to be used in generating the spherical dot-density, the more points the more accurate (and slower) calculationnThreads
- the number of parallel threads to use for the calculation- Throws:
IllegalArgumentException
- if any atom in the array is a Hydrogen atom
-
-
Method Details
-
getGroupAsas
Calculates ASA for all atoms and return them as a GroupAsa array (one element per residue in structure) containing ASAs per residue and per atom. The sorting of Groups in returned array is as specified byResidueNumber
- Returns:
-
calculateAsas
public double[] calculateAsas()Calculates the Accessible Surface Areas for the atoms given in constructor and with parameters given. Beware that the parallel implementation is quite memory hungry. It scales well as long as there is enough memory available.- Returns:
- an array with asa values corresponding to each atom of the input array
-
getRadius
Gets the van der Waals radius of the given atom following the values defined by Chothia (1976) J.Mol.Biol.105,1-14 NOTE: the vdw values defined by the paper assume no Hydrogens and thus "inflates" slightly the heavy atoms to account for Hydrogens. Thus this method cannot be used in a structure that contains Hydrogens! If atom is neither part of a nucleotide nor of a standard aminoacid, the default vdw radius for the element is returned. If atom is of unknown type (element) the vdw radius of {@link #Element().N} is returned- Parameters:
atom
-- Returns:
-