Package org.biojava.nbio.structure.asa
Class AsaCalculator
- java.lang.Object
-
- org.biojava.nbio.structure.asa.AsaCalculator
-
public class AsaCalculator extends Object
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:
- Jose Duarte
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_N_SPHERE_POINTS
The default value for number of sphere points to sample.static int
DEFAULT_NTHREADS
static double
DEFAULT_PROBE_SIZE
static double
NUC_CARBON_VDW
static double
NUC_NITROGEN_VDW
static double
OXIGEN_VDW
static double
PHOSPHOROUS_VDW
static double
SULFUR_VDW
static double
TETRAHEDRAL_CARBON_VDW
static double
TETRAHEDRAL_NITROGEN_VDW
static double
TRIGONAL_CARBON_VDW
static double
TRIGONAL_NITROGEN_VDW
-
Constructor Summary
Constructors Constructor Description AsaCalculator(javax.vecmath.Point3d[] atomCoords, double probe, int nSpherePoints, int nThreads, double radius)
Constructs a new AsaCalculator.AsaCalculator(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
calculateAsas()
Calculates the Accessible Surface Areas for the atoms given in constructor and with parameters given.GroupAsa[]
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.static double
getRadius(Atom atom)
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 Detail
-
DEFAULT_N_SPHERE_POINTS
public static final int DEFAULT_N_SPHERE_POINTS
The default value for number of sphere points to sample. See this paper for a nice study on the effect of this parameter: https://f1000research.com/articles/5-189/v1- See Also:
- Constant Field Values
-
DEFAULT_PROBE_SIZE
public static final double DEFAULT_PROBE_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_NTHREADS
public static final int DEFAULT_NTHREADS
- See Also:
- Constant Field Values
-
TRIGONAL_CARBON_VDW
public static final double TRIGONAL_CARBON_VDW
- See Also:
- Constant Field Values
-
TETRAHEDRAL_CARBON_VDW
public static final double TETRAHEDRAL_CARBON_VDW
- See Also:
- Constant Field Values
-
TRIGONAL_NITROGEN_VDW
public static final double TRIGONAL_NITROGEN_VDW
- See Also:
- Constant Field Values
-
TETRAHEDRAL_NITROGEN_VDW
public static final double TETRAHEDRAL_NITROGEN_VDW
- See Also:
- Constant Field Values
-
SULFUR_VDW
public static final double SULFUR_VDW
- See Also:
- Constant Field Values
-
OXIGEN_VDW
public static final double OXIGEN_VDW
- See Also:
- Constant Field Values
-
NUC_CARBON_VDW
public static final double NUC_CARBON_VDW
- See Also:
- Constant Field Values
-
NUC_NITROGEN_VDW
public static final double NUC_NITROGEN_VDW
- See Also:
- Constant Field Values
-
PHOSPHOROUS_VDW
public static final double PHOSPHOROUS_VDW
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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
- the structure, all non-H atoms will be usedprobe
- 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 calculationhetAtoms
- if true HET residues are considered, if false they aren't, equivalent to NACCESS' -h option- See Also:
StructureTools.getAllNonHAtomArray(org.biojava.nbio.structure.Structure, boolean)
-
AsaCalculator
public AsaCalculator(Atom[] atoms, double probe, int nSpherePoints, int nThreads)
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
-
AsaCalculator
public AsaCalculator(javax.vecmath.Point3d[] atomCoords, double probe, int nSpherePoints, int nThreads, double radius)
Constructs a new AsaCalculator. Subsequently callcalcSingleAsa(int)
to calculate the atom ASAs. The given radius parameter will be taken as the radius for all points given. No ASA calculation per group will be possible with this constructor, so usage ofgetGroupAsas()
will result in a NullPointerException.- Parameters:
atomCoords
- the coordinates representing the center of 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 calculationradius
- the radius that will be assign to all given coordinates
-
-
Method Detail
-
getGroupAsas
public GroupAsa[] 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
public static double getRadius(Atom atom)
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:
-
-