Class ConformerPlugin

  • All Implemented Interfaces:
    chemaxon.license.Licensable

    @PublicAPI
    public class ConformerPlugin
    extends CalculatorPlugin
    Plugin class for conformer calculation. Data types:
    • "structure"
    • "structures"
    • "count"
    • "hasvalidconformer"

    API usage example:

        // read input molecule
        MolImporter mi = new MolImporter("test.mol");
        Molecule mol = mi.read();
        mi.close();
    
        // create plugin
        ConformerPlugin plugin = new ConformerPlugin();
    
        // set target molecule
        plugin.setMolecule(mol);
        
        // set parameters for calculation
        plugin.setMaxNumberOfConformers(400);
        plugin.setTimelimit(900);
    
        // run the calculation
        plugin.run();
    
        // get results
        Molecule[] conformers = plugin.getConformers();
        int conformerCount = plugin.getConformerCount();
        Molecule m;
        for (int i = 0; i < conformerCount; ++i) {
            m = conformers[i];   // same as m = plugin.getConformer(i);
            // do something with molecule ...
        }
    
        // do something with the results ...
     

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

    Since:
    Marvin 4.1, 02/07/2006
    • Constructor Detail

      • ConformerPlugin

        public ConformerPlugin()
        Constructor.
    • Method Detail

      • handlesMultiFragmentMolecules

        public boolean handlesMultiFragmentMolecules()
        Returns true if the plugin handles multifragment molecules, false otherwise. In the latter case the plugin takes the fragment with more atoms if a multifragment molecule is given as input.
        Overrides:
        handlesMultiFragmentMolecules in class CalculatorPlugin
        Returns:
        true if the plugin handles multifragment molecules, false otherwise
      • setProgressMonitor

        public void setProgressMonitor​(MProgressMonitor pmon)
        Sets a progress observer to be used in run() to display progress status. Short calculations may ignore the observer object. The default implementation does nothing.
        Overrides:
        setProgressMonitor in class CalculatorPlugin
        Parameters:
        pmon - is the progress observer object, may be null
      • setParameters

        public void setParameters​(Properties params)
                           throws PluginException
        Sets the input parameters for the plugin. Parameters and value ranges:
        • type: structure, structures, count, hasvalidconformer
        • optimization: optimization criteria for the calculation (default: 1 (=Normal))
        • maxconformers: maximum naumber of conformers to be calculated (default: 100)
        • timelimit: timelimit in sec for the calculation (default: 900)
        • prehydrogenize: true if prehydrogenize is needed before calculation (default: false)
        Overrides:
        setParameters in class CalculatorPlugin
        Parameters:
        params - is the parameter table
        Throws:
        PluginException - on error
      • setMMFF94

        public void setMMFF94​(boolean mmff)
        Sets the forcefield to MMFF94.
        Parameters:
        mmff - if true, sets MMFF94
      • setLowestEnergyConformerCalculation

        public void setLowestEnergyConformerCalculation​(boolean le)
        Switchs the lowest energy conformer calculation on/off. If true lowest energy conformer calculation is done, if false conformers of the molecule are calculated.
        Parameters:
        le - switchs the lowest energy conformer calculation on/off
      • setMaxNumberOfConformers

        public void setMaxNumberOfConformers​(int n)
        Sets the maximum number of conformers to be calculated. The number of calculated conformers is equal or lower then this number, and can be readed with method getConformerCount().
        Parameters:
        n - is the max number of conformers to be calculated
        See Also:
        getConformerCount()
      • setTimelimit

        public void setTimelimit​(int sec)
        Sets the timelimit for the calculation.
        Parameters:
        sec - is the timelimit for the calculation
      • setDiversity

        public void setDiversity​(double limit)
        Sets the diversity limit for the calculation. Diversity limit should be at least 0.1 (no upper limit).
        Parameters:
        limit - is the diversity limit for the calculation
        Since:
        Marvin 4.1.3
      • setPrehydrogenize

        public void setPrehydrogenize​(boolean preH)
        Turns the prehydrogenization on/off. If true prehydrogenization is done before calculation, if false no prehydrogenization is done before calculation.
        Parameters:
        preH - turns the prehydrogenization on/off
      • setHyperfine

        public void setHyperfine​(boolean hyp)
        Sets the hyperfine option for calculation.
        Parameters:
        hyp - sets/unsets the hyperfine option for calculation
      • hasValidConformer

        public boolean hasValidConformer()
                                  throws PluginException
        Returns true if the input molecule has a valid conformer (has a valid structure in 3D space). Otherwise returns false.
        Returns:
        true if the input molecule has a valid conformer
        Throws:
        PluginException
      • getLowestEnergyConformer

        public Molecule getLowestEnergyConformer()
        Returns the calculated lowest energy conformer.
        Returns:
        the lowest energy conformer
      • getEnergy

        public double getEnergy()
        Returns the energy of the lowest energy conformer in kcal/mol.
        Returns:
        the energy of the lowest energy conformer
        Since:
        Marvin 4.1.4 12/04/2006
        See Also:
        setLowestEnergyConformerCalculation(boolean)
      • getEnergy

        public double getEnergy​(int i)
        Returns the energy of the i-th conformer in kcal/mol.
        Returns:
        the energy of the i-th conformer
        Since:
        Marvin 4.1.4 12/04/2006
        See Also:
        getConformerCount()
      • getResultSource

        public chemaxon.marvin.plugin.PluginMDocSource getResultSource()
                                                                throws PluginException
        Returns the result as a document source object. This is useful for displaying the molecules in a viewer dynamically as they become available instead of collecting all results before display.
        Overrides:
        getResultSource in class CalculatorPlugin
        Returns:
        the document source interface
        Throws:
        PluginException - on error
        Since:
        Marvin 5.0
      • getConformerCount

        public int getConformerCount()
        Returns the number of different conformers.
        Returns:
        the number of different conformers
      • getConformer

        public Molecule getConformer​(int index)
        Returns a conformer.
        Parameters:
        index - is the conformer index
        Returns:
        the conformer
      • getConformers

        public Molecule[] getConformers()
        Returns all conformers in a Molecule[] array.
        Returns:
        all conformers
      • 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
      • getResultCount

        public int getResultCount​(Object type)
        Returns the number of result items for the given result key.
        Overrides:
        getResultCount in class CalculatorPlugin
        Parameters:
        type - is the result type
        Returns:
        the number of result items
        See Also:
        getResultTypes()
      • 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
      • getWarningMessage

        public String getWarningMessage()
        Returns a warning message if there are no conformers, null otherwise.
        Overrides:
        getWarningMessage in class CalculatorPlugin
        Returns:
        a warning message if conformercalculation aborted
      • standardize

        public void standardize​(Molecule mol)
        Expands sgroups.
        Overrides:
        standardize in class CalculatorPlugin
        Parameters:
        mol - is the molecule to be standardized