RDKit: ReactionParser.h File Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Classes | Namespaces | Functions | Variables
ReactionParser.h File Reference
`#include <RDGeneral/export.h>`
`#include <string>`
`#include <fstream>`
`#include <map>`
`#include <sstream>`
`#include <utility>`
`#include <boost/format.hpp>`
`#include <RDGeneral/BadFileException.h>`
`#include <RDGeneral/FileParseException.h>`
`#include <GraphMol/FileParsers/FileParsers.h>`
`#include <GraphMol/SmilesParse/SmilesWrite.h>`

Go to the source code of this file.

## Classes
class | RDKit::ChemicalReactionParserException
| used to indicate an error in parsing reaction data More...
struct | RDKit::v2::ReactionParser::ReactionSmartsParserParams

## Namespaces
namespace | RDKit
| Std stuff.
namespace | RDKit::v2
namespace | RDKit::v2::ReactionParser
namespace | RDKit::v1
namespace | RDKit::PNGData
| Tags used for PNG metadata.

## Functions
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromSmarts (const std::string &smarts, const ReactionSmartsParserParams &params=ReactionSmartsParserParams())
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromSmiles (const std::string &smarts, const ReactionSmartsParserParams &params=ReactionSmartsParserParams())
RDKIT_CHEMREACTIONS_EXPORT std::string | RDKit::ChemicalReactionToRxnSmarts (const ChemicalReaction &rxn, const SmilesWriteParams &params)
| returns the reaction SMARTS for a reaction
std::string | RDKit::ChemicalReactionToRxnSmarts (const ChemicalReaction &rxn)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
RDKIT_CHEMREACTIONS_EXPORT std::string | RDKit::ChemicalReactionToRxnSmiles (const ChemicalReaction &rxn, const SmilesWriteParams &params=SmilesWriteParams())
| returns the reaction SMILES for a reaction
std::string | RDKit::ChemicalReactionToRxnSmiles (const ChemicalReaction &rxn, bool canonical)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
RDKIT_CHEMREACTIONS_EXPORT std::string | RDKit::ChemicalReactionToCXRxnSmarts (const ChemicalReaction &rxn, const SmilesWriteParams &params, std::uint32_t flags=SmilesWrite::CXSmilesFields::CX_ALL)
| returns the reaction SMARTS for a reaction with CX extension
std::string | RDKit::ChemicalReactionToCXRxnSmarts (const ChemicalReaction &rxn)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
RDKIT_CHEMREACTIONS_EXPORT std::string | RDKit::ChemicalReactionToCXRxnSmiles (const ChemicalReaction &rxn, const SmilesWriteParams &params, std::uint32_t flags=SmilesWrite::CXSmilesFields::CX_ALL)
| returns the reaction SMILES for a reaction with CX extension
std::string | RDKit::ChemicalReactionToCXRxnSmiles (const ChemicalReaction &rxn, bool canonical=true)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromRxnBlock (const std::string &rxnBlock, const FileParsers::MolFileParserParams &params=FileParsers::MolFileParserParams())
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromRxnFile (const std::string &fileName, const FileParsers::MolFileParserParams &params=FileParsers::MolFileParserParams())
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromRxnDataStream (std::istream &rxnStream, unsigned int &line, const FileParsers::MolFileParserParams &params=FileParsers::MolFileParserParams())
ChemicalReaction * | RDKit::v1::RxnBlockToChemicalReaction (const std::string &rxnBlock, bool sanitize=false, bool removeHs=false, bool strictParsing=true)
| Parse a text block in MDL rxn format into a ChemicalReaction.
ChemicalReaction * | RDKit::v1::RxnFileToChemicalReaction (const std::string &fileName, bool sanitize=false, bool removeHs=false, bool strictParsing=true)
| Parse a file in MDL rxn format into a ChemicalReaction.
ChemicalReaction * | RDKit::v1::RxnDataStreamToChemicalReaction (std::istream &rxnStream, unsigned int &line, bool sanitize=false, bool removeHs=false, bool strictParsing=true)
| Parse a text stream in MDL rxn format into a ChemicalReaction.
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromPNGStream (std::istream &pngStream)
| constructs a ChemicalReaction from the metadata in a PNG stream
std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromPNGString (const std::string &data)
| constructs a ChemicalReaction from the metadata in a PNG string See `PNGStreamToChemicalReaction()` for more details
std::unique_ptr< ChemicalReaction > | RDKit::v2::ReactionParser::ReactionFromPNGFile (const std::string &fname)
| constructs a ChemicalReaction from the metadata in a PNG file See `PNGStreamToChemicalReaction()` for more details
ChemicalReaction * | RDKit::v1::PNGStreamToChemicalReaction (std::istream &pngStream)
| constructs a ChemicalReaction from the metadata in a PNG stream
ChemicalReaction * | RDKit::v1::PNGStringToChemicalReaction (const std::string &data)
| constructs a ChemicalReaction from the metadata in a PNG string See `PNGStreamToChemicalReaction()` for more details
ChemicalReaction * | RDKit::v1::PNGFileToChemicalReaction (const std::string &fname)
| constructs a ChemicalReaction from the metadata in a PNG file See `PNGStreamToChemicalReaction()` for more details
std::unique_ptr< ChemicalReaction > | RDKit::operator""_rxnsmarts (const char *text, size_t len)
std::unique_ptr< ChemicalReaction > | RDKit::operator""_rxnsmiles (const char *text, size_t len)
Reaction SMARTS/SMILES Support
ChemicalReaction * | RDKit::v1::RxnSmartsToChemicalReaction (const std::string &text, std::map< std::string, std::string > *replacements=nullptr, bool useSmiles=false, bool allowCXSMILES=true)
| Parse a string containing "Reaction SMARTS" into a ChemicalReaction.
Reaction Mol Support
RDKIT_CHEMREACTIONS_EXPORT ChemicalReaction * | RDKit::RxnMolToChemicalReaction (const ROMol &mol)
| Parse a ROMol into a ChemicalReaction, RXN role must be set before.
RDKIT_CHEMREACTIONS_EXPORT ROMol * | RDKit::ChemicalReactionToRxnMol (const ChemicalReaction &rxn)
| returns a ROMol with RXN roles used to describe the reaction
MDL rxn Support
RDKIT_CHEMREACTIONS_EXPORT std::string | RDKit::ChemicalReactionToRxnBlock (const ChemicalReaction &rxn, bool separateAgents=false, bool forceV3000=false)
| returns an rxn block for a reaction
RDKIT_CHEMREACTIONS_EXPORT std::string | RDKit::ChemicalReactionToV3KRxnBlock (const ChemicalReaction &rxn, bool separateAgents=false)
| returns an V3000 rxn block for a reaction
PNG Support
RDKIT_CHEMREACTIONS_EXPORT std::string | RDKit::addChemicalReactionToPNGStream (const ChemicalReaction &rxn, std::istream &iStream, bool includePkl=true, bool includeSmiles=true, bool includeSmarts=false, bool includeRxn=false)
| adds metadata for a ChemicalReaction to the data from a PNG stream. The modified PNG data is returned.
std::string | RDKit::addChemicalReactionToPNGString (const ChemicalReaction &rxn, const std::string &pngString, bool includePkl=true, bool includeSmiles=true, bool includeSmarts=false, bool includeRxn=false)
| adds metadata for a ChemicalReaction to the data from a PNG string. See addChemicalReactionToPNGStream() for more details.
std::string | RDKit::addChemicalReactionToPNGFile (const ChemicalReaction &rxn, const std::string &fname, bool includePkl=true, bool includeSmiles=true, bool includeSmarts=false, bool includeRxn=false)
| adds metadata for a ChemicalReaction to the data from a PNG string. See addChemicalReactionToPNGStream() for more details.
CDXML rxn Support
RDKIT_CHEMREACTIONS_EXPORT std::vector< std::unique_ptr< ChemicalReaction > > | RDKit::CDXMLToChemicalReactions (const std::string &rxnBlock, bool sanitize=false, bool removeHs=false)
| Parse text in CDXML rxn format into a vector of ChemicalReactions.
RDKIT_CHEMREACTIONS_EXPORT std::vector< std::unique_ptr< ChemicalReaction > > | RDKit::CDXMLFileToChemicalReactions (const std::string &fileName, bool sanitize=false, bool removeHs=false)
| Parse a file in CDXML rxn format into a vector of ChemicalReactions.
RDKIT_CHEMREACTIONS_EXPORT std::vector< std::unique_ptr< ChemicalReaction > > | RDKit::CDXMLDataStreamToChemicalReactions (std::istream &rxnStream, bool sanitize=false, bool removeHs=false)
| Parse a text stream in CDXML rxn format into a vector of ChemicalReactions.

## Variables
RDKIT_CHEMREACTIONS_EXPORT const std::string | RDKit::PNGData::rxnSmilesTag
RDKIT_CHEMREACTIONS_EXPORT const std::string | RDKit::PNGData::rxnSmartsTag
RDKIT_CHEMREACTIONS_EXPORT const std::string | RDKit::PNGData::rxnRxnTag
RDKIT_CHEMREACTIONS_EXPORT const std::string | RDKit::PNGData::rxnPklTag