Class ConformerPlugin

java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.ConformerPlugin
All Implemented Interfaces:
TaggedCalculator, 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
  • Field Details

  • Constructor Details

    • ConformerPlugin

      public ConformerPlugin()
      Constructor.
  • Method Details

    • getProductName

      public String getProductName()
      Returns the product identifier of the plugin as given by LicenseManager.
      Specified by:
      getProductName in class CalculatorPlugin
      Returns:
      The identifier LicenseManager.CONFORMATION_PLUGIN_GROUP
    • 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
    • checkMolecule

      public void checkMolecule(Molecule mol) throws PluginException
      Checks the input molecule. Throws exception if the molecule is RxnMolecule or if the molecule contains R-groups.
      Overrides:
      checkMolecule in class CalculatorPlugin
      Parameters:
      mol - is the input molecule
      Throws:
      PluginException - with error message for the user if the molecule is refused
    • setInputMolecule

      protected void setInputMolecule(Molecule mol) throws PluginException
      Sets the input molecule.
      Specified by:
      setInputMolecule in class CalculatorPlugin
      Parameters:
      mol - is the input molecule
      Throws:
      PluginException - on error
    • run

      public boolean run() throws PluginException
      Runs the conformer calculation.
      Specified by:
      run in class CalculatorPlugin
      Returns:
      true if the calculation was successful, false if unsuccessful
      Throws:
      PluginException - on error
      See Also:
    • 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:
    • 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
    • setOptimization

      public void setOptimization(int optimization) throws PluginException
      Sets the optimization criteria for the calculation. Possible optimization values are:
      Parameters:
      optimization - is the optimization method for the calculation
      Throws:
      PluginException
    • 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:
    • 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:
    • 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
    • getConformerWithConformerInfoProperty

      @Deprecated public Molecule getConformerWithConformerInfoProperty(int index)
      Deprecated.
      Only intended for internal use.
      Returns a conformer with additional information stored as a molecule property. For internal use only.
      Parameters:
      index - is the conformer index
      Returns:
      the conformer
    • getConformers

      public Molecule[] getConformers()
      Returns all conformers in a Molecule[] array.
      Returns:
      all conformers
    • getResultTypes

      public Object[] getResultTypes()
      Returns the result types.
      Overrides:
      getResultTypes in class CalculatorPlugin
      Returns:
      the result types
    • 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
    • getResultDomain

      public int getResultDomain(Object type)
      Returns the calculation domain.
      Overrides:
      getResultDomain in class CalculatorPlugin
      Parameters:
      type - is the result type
      Returns:
      the calculation domain
      See Also:
    • 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:
    • getResult

      public Object getResult(Object type, int index) throws PluginException
      Returns the result item for the specified key and index.
      Overrides:
      getResult in class CalculatorPlugin
      Parameters:
      type - is the result type
      index - is the result index
      Returns:
      the result item for the specified key and index
      Throws:
      PluginException - if the result cannot be returned
      See Also:
    • 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
    • tags

      public Set<CalculatorTag> tags()
      Description copied from interface: TaggedCalculator
      Returns the set of tags reported by this calculator. The same tags should be returned unless the calculator is modified using a mutator method, e.g. if some settings are changed.

      New tags can be introduced and reported in the future by existing calculators, so do not depend on the exact set of reported tags, only check for the presence of certain tags.

      Returns:
      the tags