Class 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.

    A few optimizations come from Eisenhaber et al, J Comp Chemistry 1994 (https://onlinelibrary.wiley.com/doi/epdf/10.1002/jcc.540160303)

    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
    • Constructor Detail

      • AsaCalculator

        public AsaCalculator​(Structure structure,
                             double probe,
                             int nSpherePoints,
                             int nThreads,
                             boolean hetAtoms)
        Constructs a new AsaCalculator. Subsequently call calculateAsas() or getGroupAsas() to calculate the ASAs Only non-Hydrogen atoms are considered in the calculation.
        Parameters:
        structure - the structure, all non-H atoms will be used
        probe - the probe size
        nSpherePoints - the number of points to be used in generating the spherical dot-density, the more points the more accurate (and slower) calculation
        nThreads - the number of parallel threads to use for the calculation
        hetAtoms - if true HET residues are considered, if false they aren't, equivalent to NACCESS' -h option
      • AsaCalculator

        public AsaCalculator​(Atom[] atoms,
                             double probe,
                             int nSpherePoints,
                             int nThreads)
        Constructs a new AsaCalculator. Subsequently call calculateAsas() or getGroupAsas() to calculate the ASAs.
        Parameters:
        atoms - an array of atoms not containing Hydrogen atoms
        probe - the probe size
        nSpherePoints - the number of points to be used in generating the spherical dot-density, the more points the more accurate (and slower) calculation
        nThreads - 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 call calcSingleAsa(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 of getGroupAsas() will result in a NullPointerException.
        Parameters:
        atomCoords - the coordinates representing the center of atoms
        probe - the probe size
        nSpherePoints - the number of points to be used in generating the spherical dot-density, the more points the more accurate (and slower) calculation
        nThreads - the number of parallel threads to use for the calculation
        radius - 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 by ResidueNumber
        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: