Generated on Wed Apr 29 2015 11:51:41 for GGL-4.1.2 by doxygen 1.8.3.1
Static Public Member Functions | Static Protected Member Functions
ggl::chem::SMILESparser Class Reference

SMILES molecule parser. More...

#include <SMILESparser.hh>

Static Public Member Functions

static std::vector< Molecule * > parseMultiSMILES (const std::string &SMILES_string) throw (std::invalid_argument)
 
static std::vector< Molecule * > parseMultiSMILES (const std::string &SMILES_string, const GroupMap &groups) throw (std::invalid_argument)
 
static ChemRule::CoreGraph parseReactionSMILES (const std::string &SMILES_string, const bool pruneClassID=true) throw (std::invalid_argument)
 
static std::pair< Molecule, int > parseSMILES (const std::string &SMILES_string) throw (std::invalid_argument)
 
static std::pair< Molecule, int > parseSMILES (const std::string &SMILES_string, const GroupMap &groups) throw (std::invalid_argument)
 

Static Protected Member Functions

static void pruneAromaticNonRingBonds (Molecule &mol)
 

Detailed Description

     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.

Member Function Documentation

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_stringthe string to parse
Returns
vector of according molecule graphs
Exceptions
std::invalid_argumentin 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_stringthe string to parse
groupsa 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_argumentin 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_stringthe string to parse
pruneClassIDwhether or not the classID information is to be pruned from the atom labels
Returns
the parsed rule core graph
Exceptions
std::invalid_argumentwith 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_stringthe 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_argumentin 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_stringthe string to parse
groupsa 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_argumentin 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
molthe molecule to correct

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