$darkmode
DENOPTIM
denoptim.utils.FormulaUtils Class Reference

Utilities for manipulating molecular formulas. More...

Static Public Member Functions

static Map< String, Double > parseFormula (String formula)
 Reads a molecular formula written as "H2 O" or "C6 H12 O6". More...
 
static Map< String, ArrayList< Double > > parseCSDFormula (String formula) throws DENOPTIMException
 Reads a molecular formula formatted as from the Cambridge Structural Database and produces a profile of elemental analysis for possible chemical representations that may include all, some, or a minimum number of all molecular objects in the system being represented. More...
 
static boolean compareFormulaAndElementalAnalysis (String formula, IAtomContainer mol) throws DENOPTIMException
 Compares the molecular formula formatted as from the Cambridge Structural Database (CSD) against the elemental analysis of the given atom container. More...
 
static boolean compareFormulaAndElementalAnalysis (String formula, IAtomContainer mol, Logger logger) throws DENOPTIMException
 Compares the molecular formula formatted as from the Cambridge Structural Database (CSD) against the elemental analysis of the given atom container. More...
 
static Map< String, Double > getElementalanalysis (IAtomContainer mol)
 Threads Deuterium as a different element than Hydrogen. More...
 

Detailed Description

Utilities for manipulating molecular formulas.

Author
Marco Foscato

Definition at line 28 of file FormulaUtils.java.

Member Function Documentation

◆ compareFormulaAndElementalAnalysis() [1/2]

static boolean denoptim.utils.FormulaUtils.compareFormulaAndElementalAnalysis ( String  formula,
IAtomContainer  mol 
) throws DENOPTIMException
static

Compares the molecular formula formatted as from the Cambridge Structural Database (CSD) against the elemental analysis of the given atom container.

Parameters
formulathe molecular formula in CSD format. Since this format can include one or more molecular items that may or may not be present in the chemical representation of the atom container, and it can include tunable stoichiometric factors (e.g., 2n(H2O),n(Cl2)), a number of alternative elemental analysis are generated from the formula. If any of these alternatives matches the elemental analysis of the container, then we return true.
molthe atom container on which to perform elemental analysis.
Returns
true is any match is found between the molecular formula and the atom container.

Definition at line 363 of file FormulaUtils.java.

References denoptim.utils.FormulaUtils.compareFormulaAndElementalAnalysis().

Referenced by denoptim.fragmenter.FragmenterTools.checkElementalAnalysisAgainstFormula(), denoptim.utils.FormulaUtils.compareFormulaAndElementalAnalysis(), and denoptim.utils.FormulaUtilsTest.testCompareFormulaAndElementalAnalysis().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compareFormulaAndElementalAnalysis() [2/2]

static boolean denoptim.utils.FormulaUtils.compareFormulaAndElementalAnalysis ( String  formula,
IAtomContainer  mol,
Logger  logger 
) throws DENOPTIMException
static

Compares the molecular formula formatted as from the Cambridge Structural Database (CSD) against the elemental analysis of the given atom container.

Parameters
formulathe molecular formula in CSD format. Since this format can include one or more molecular items that may or may not be present in the chemical representation of the atom container, and it can include tunable stoichiometric factors (e.g., 2n(H2O),n(Cl2)), a number of alternative elemental analysis are generated from the formula. If any of these alternatives matches the elemental analysis of the container, then we return true.
molthe atom container on which to perform elemental analysis.
loggerwhere to log messages.
Returns
true is any match is found between the molecular formula and the atom container.

Definition at line 385 of file FormulaUtils.java.

References denoptim.utils.FormulaUtils.getElementalanalysis(), denoptim.io.DenoptimIO.NL, and denoptim.utils.FormulaUtils.parseCSDFormula().

Here is the call graph for this function:

◆ getElementalanalysis()

static Map< String, Double > denoptim.utils.FormulaUtils.getElementalanalysis ( IAtomContainer  mol)
static

Threads Deuterium as a different element than Hydrogen.

Parameters
molthe system to analyze.
Returns
a map with the amount of each element.

Definition at line 465 of file FormulaUtils.java.

Referenced by denoptim.utils.FormulaUtils.compareFormulaAndElementalAnalysis(), and denoptim.fragmenter.FragmenterTools.filterFragment().

Here is the caller graph for this function:

◆ parseCSDFormula()

static Map< String, ArrayList< Double > > denoptim.utils.FormulaUtils.parseCSDFormula ( String  formula) throws DENOPTIMException
static

Reads a molecular formula formatted as from the Cambridge Structural Database and produces a profile of elemental analysis for possible chemical representations that may include all, some, or a minimum number of all molecular objects in the system being represented.

For example for the formula (H2 O)n,2n(Cl2) it may include one molecule of water or one of chlorine, or both, or one molecule of water and two of chlorine, or two of water and four of chlorine, etc.

Parameters
formula
Returns
a map of the elemental analysis for each element that may be present in the system. For each element, a list of possible values is provided and, the n-th entry for one element is to be combined with the n-th entry of all other elements.
Exceptions
DENOPTIMException

Definition at line 81 of file FormulaUtils.java.

Referenced by denoptim.utils.FormulaUtils.compareFormulaAndElementalAnalysis(), and denoptim.utils.FormulaUtilsTest.testParsingOfCSDFormula().

Here is the caller graph for this function:

◆ parseFormula()

static Map< String, Double > denoptim.utils.FormulaUtils.parseFormula ( String  formula)
static

Reads a molecular formula written as "H2 O" or "C6 H12 O6".

Stochiometric coefficients can be non-integer

Parameters
formula

Definition at line 38 of file FormulaUtils.java.

Referenced by denoptim.programs.fragmenter.FragmenterParameters.interpretKeyword(), and denoptim.utils.FormulaUtilsTest.testParseFormula().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: