Class MSAPlugin

  • All Implemented Interfaces:
    chemaxon.license.Licensable

    @PublicAPI
    public class MSAPlugin
    extends MajorMicrospeciesAccessorPlugin
    Plugin class for molecular surface area calculation. Both the incremental values for atoms and the overal surface area for the molecule can be calculated by this plugin.

    Reference:

    1. Ferrara, P,. Apostolakis J., Caflisch A., Proteins 2002, 46, 24-33

    API usage example:

        // read input molecule
        MolImporter mi = new MolImporter("test.mol");
        Molecule mol = mi.read();
        mi.close();
    
        // create plugin
        MSAPlugin plugin = new MSAPlugin();
    
        // optional: take major microspecies at pH=7.4
        plugin.setpH(7.4);
    
        // set surface area type (default: VAN_DER_WAALS)
        plugin.setSurfaceAreaType(SOLVENT);
    
        // set target molecule
        plugin.setMolecule(mol);
            
        // run the calculation
        plugin.run();
    
        // get result
        double area = plugin.getSurfaceArea();
    
        // print result
        System.out.println("Solvent accessible surface area (pH=7.4): "+area);
     

    For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.

    Since:
    Marvin 4.1
    • Field Detail

      • VAN_DER_WAALS

        public static final int VAN_DER_WAALS
        Surface area type: 3D van der Waals surface area.
        See Also:
        Constant Field Values
      • SOLVENT

        public static final int SOLVENT
        Surface area type: 3D solvent accessible surface area.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MSAPlugin

        public MSAPlugin()
        Constructor. Creates the MSA calculator object.
    • Method Detail

      • isLicensed

        public boolean isLicensed()
        Returns true if the plugin is licensed. The license checking is based on the product name, returned by getProductName().
        Specified by:
        isLicensed in interface chemaxon.license.Licensable
        Overrides:
        isLicensed in class MajorMicrospeciesAccessorPlugin
        Returns:
        true if the plugin is licensed
      • setParameters

        public void setParameters​(Properties params)
                           throws PluginException
        Sets the input parameters for the plugin. MSA parameters and value ranges:
        • precision: 0-8 or inf (number of displayed fractional digits, inf for unrounded value)
        • type: "vanderwaals", "solvent" (default: "vanderwaals")
        • increments: "true" if surface increments should be returned (for 3D surface ("vanderwaals", "solvent") only)
        • pH: major microspecies on given pH is taken as input molecule if omitted then the input molecule is taken as it is
        Overrides:
        setParameters in class MajorMicrospeciesAccessorPlugin
        Parameters:
        params - is the parameter table
        Throws:
        PluginException - on error
      • getErrorMessage

        public String getErrorMessage()
        Returns the calculation error information message if run() returned false (calculation error). This implementation returns the empty string.
        Overrides:
        getErrorMessage in class MajorMicrospeciesAccessorPlugin
        Returns:
        the calculation error information message
      • getResultTypes

        public Object[] getResultTypes()
        Returns the result types. Possible result types: "vanderwaals", "solvent", "increments".
        Overrides:
        getResultTypes in class CalculatorPlugin
        Returns:
        the result types
      • getResultCount

        public int getResultCount​(Object type)
        Returns the number of result items for the given result key. TPSA returns 1 for surface area, the atom count for increments.
        Overrides:
        getResultCount in class CalculatorPlugin
        Parameters:
        type - is the result type
        Returns:
        the number of result items
        See Also:
        getResultTypes()
      • setSolventRadius

        public void setSolventRadius​(double r)
        Sets solvent radius. Default: 1.4 Angstrom.
      • getSurfaceArea

        public double getSurfaceArea()
        Returns the surface area, calculation type is previously set in setSurfaceAreaType(int). Default: VAN_DER_WAALS.
        Returns:
        the surface area
      • getVDWSA

        public double getVDWSA()
        Returns van der Waals surface area. Calculation type must be set to VAN_DER_WAALS using setSurfaceAreaType(int), and the alculation should be run beforehand by run()
        Returns:
        van der Waals surface area
        Since:
        Marvin 5.0
      • getASA

        public double getASA()
        Returns water accessible surface area calculated using a radius of 1.4 A for the water molecule. Calculation type must be set to SOLVENT using setSurfaceAreaType(int), and the calculation should be run beforehand by run()
        Returns:
        water accessible surface area
        Since:
        Marvin 5.0
      • getASAPlus

        public double getASAPlus()
        Returns water accessible surface area of all atoms with positive partial charge (strictly greater than 0). Calculation type must be set to SOLVENT using setSurfaceAreaType(int), and the calculation should be run beforehand by run()
        Returns:
        water accessible surface area of all atoms with positive partial charge
        Since:
        Marvin 5.0
      • getASANegative

        public double getASANegative()
        Returns water accessible surface area of all atoms with negative partial charge (strictly less than 0). Calculation type must be set to SOLVENT using setSurfaceAreaType(int), and the calculation should be run beforehand by run()
        Returns:
        water accessible surface area of all atoms with negative partial charge
        Since:
        Marvin 5.0
      • getASAHydrophobic

        public double getASAHydrophobic()
        Returns water accessible surface area of all hydrophobic (|qi|<0.125) atoms. Calculation type must be set to SOLVENT using setSurfaceAreaType(int), and the calculation should be run beforehand by run()
        Returns:
        water accessible surface area of all hydrophobic atoms
        Since:
        Marvin 5.0
      • getASAPolar

        public double getASAPolar()
        Returns water accessible surface area of all polar (|qi|>=0.125) atoms. Calculation type must be set to SOLVENT using setSurfaceAreaType(int), and the calculation should be run beforehand by run()
        Returns:
        water accessible surface area of all polar atoms
        Since:
        Marvin 5.0
      • getAtomicSurfaceAreaIncrement

        public double getAtomicSurfaceAreaIncrement​(int index)
        Returns the 3D surface area increments. Calculated only if surface area type is set to SOLVENT or VAN_DER_WAALS in setSurfaceAreaType(int).
        Parameters:
        index - is the atom index
        Returns:
        the surface area increment for the specified atom index
      • get3DMolecule

        public Molecule get3DMolecule()
        Returns the 3D molecule used in 3D surface area calculation. Can be called only if surface area type is set to SOLVENT or VAN_DER_WAALS in setSurfaceAreaType(int).
        Returns:
        the 3D molecule used in 3D surface area calculation
      • getResultAsString

        public String getResultAsString​(Object type,
                                        int index,
                                        Object result)
                                 throws PluginException
        Returns the specified result in String format.
        Overrides:
        getResultAsString in class CalculatorPlugin
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result item
        Returns:
        the specified result in String format
        Throws:
        PluginException - if an invalid result item is given
      • getDisplayMolecule

        protected Molecule getDisplayMolecule()
        Returns the molecule object to be used for GUI display. This is the 3D molecule returned by get3DMolecule().
        Overrides:
        getDisplayMolecule in class CalculatorPlugin
        Returns:
        the molecule object to be used for GUI display
      • getTypeString

        public String getTypeString​(Object type)
        Returns a string representation of the given type.
        Overrides:
        getTypeString in class CalculatorPlugin
        Parameters:
        type - is the type object
        Returns:
        the type string
      • isMultiThreadedRunEnabled

        public boolean isMultiThreadedRunEnabled()
        For internal use only.
        Overrides:
        isMultiThreadedRunEnabled in class CalculatorPlugin
        Returns:
        true if multi-threaded run is enabled