SMILES molecule parser.
More...
#include <SMILESparser.hh>
This class is a wrapper for the ggl::chem::SMILESparser that
parses SMILES via their BNF grammar. See there for further details.
- Author
- Martin Mann (c) 2012 http://www.bioinf.uni-freiburg.de/~mmann/
Definition at line 23 of file SMILESparser.hh.
static std::vector< Molecule * > ggl::chem::SMILESparser::parseMultiSMILES |
( |
const std::string & |
SMILES_string | ) |
throw (std::invalid_argument) |
|
static |
Parses a SMILES string of multiple molecules separated by '.' and generates a graph representation of the molecules
- Parameters
-
SMILES_string | the string to parse |
- Returns
- vector of according molecule graphs
- Exceptions
-
std::invalid_argument | in case a parsing fails |
static std::vector< Molecule * > ggl::chem::SMILESparser::parseMultiSMILES |
( |
const std::string & |
SMILES_string, |
|
|
const GroupMap & |
groups |
|
) |
| throw (std::invalid_argument) |
|
static |
Parses a SMILES string of multiple molecules separated by '.' and generates a graph representation of the molecules
- Parameters
-
SMILES_string | the string to parse |
groups | a container that holds group IDs where each matching node has to be replaced by the according mapped subgraph |
- Returns
- vector of according molecule graphs
- Exceptions
-
std::invalid_argument | in case a parsing fails |
static ChemRule::CoreGraph ggl::chem::SMILESparser::parseReactionSMILES |
( |
const std::string & |
SMILES_string, |
|
|
const bool |
pruneClassID = true |
|
) |
| throw (std::invalid_argument) |
|
static |
Parses a reaction SMILES string and uses the atom mapping encoded in the atom label class information to generate a graph grammar rule core graph, thus, each atom in the educts has to have a unique class ID and a corresponding atom (with same ID) in the products.
An example '[C:13][C-2:2].[O:3]>>[O:3]=[C:2][C:13]'
For protons part of complex labels like [CH3:1] are automatically given class IDs while it is expected that the adjacent atom (with given class ID) is present both in educt and product and features in both the same number of adjacent protons given without class ID within the complex atom label. Otherwise, an exception is raised.
NOTE: the reaction is not checked for sanity or chemical correctness. Furthermore, no constraints etc. are generated.
- Parameters
-
SMILES_string | the string to parse |
pruneClassID | whether or not the classID information is to be pruned from the atom labels |
- Returns
- the parsed rule core graph
- Exceptions
-
std::invalid_argument | with according description in case a check fails |
static std::pair< Molecule, int > ggl::chem::SMILESparser::parseSMILES |
( |
const std::string & |
SMILES_string | ) |
throw (std::invalid_argument) |
|
static |
Parses a SMILES string and generates a graph representation of the molecule
- Parameters
-
SMILES_string | the string to parse |
- Returns
- pair.first = the graph encoding of the molecule pair.second = -1 if parsing was successful, in error case it returns the string position that caused the parsing error
- Exceptions
-
std::invalid_argument | in case a check fails |
static std::pair< Molecule, int > ggl::chem::SMILESparser::parseSMILES |
( |
const std::string & |
SMILES_string, |
|
|
const GroupMap & |
groups |
|
) |
| throw (std::invalid_argument) |
|
static |
Parses a SMILES string and generates a graph representation of the molecule
- Parameters
-
SMILES_string | the string to parse |
groups | a container that holds group IDs where each matching node has to be replaced by the according mapped subgraph |
- Returns
- pair.first = the graph encoding of the molecule pair.second = -1 if parsing was successfull, in error case it returns the string position that caused the parsing error
- Exceptions
-
std::invalid_argument | in case a check fails |
static void ggl::chem::SMILESparser::pruneAromaticNonRingBonds |
( |
Molecule & |
mol | ) |
|
|
staticprotected |
Prunes all aromatic bonds that are not part of a ring.
- Parameters
-
mol | the molecule to correct |
The documentation for this class was generated from the following file: