RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
ReactionParser.h File Reference
#include <RDGeneral/export.h>
#include <string>
#include <iostream>
#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...
 

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::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::unique_ptr< ChemicalReactionRDKit::v2::ReactionParser::ReactionFromRxnBlock (const std::string &rxnBlock, const FileParsers::MolFileParserParams &params=FileParsers::MolFileParserParams())
 
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReactionRDKit::v2::ReactionParser::ReactionFromRxnFile (const std::string &fileName, const FileParsers::MolFileParserParams &params=FileParsers::MolFileParserParams())
 
RDKIT_CHEMREACTIONS_EXPORT std::unique_ptr< ChemicalReactionRDKit::v2::ReactionParser::ReactionFromRxnDataStream (std::istream &rxnStream, unsigned int &line, const FileParsers::MolFileParserParams &params=FileParsers::MolFileParserParams())
 
ChemicalReactionRDKit::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.
 
ChemicalReactionRDKit::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.
 
ChemicalReactionRDKit::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< ChemicalReactionRDKit::v2::ReactionParser::ReactionFromPNGStream (std::istream &pngStream)
 constructs a ChemicalReaction from the metadata in a PNG stream
 
std::unique_ptr< ChemicalReactionRDKit::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< ChemicalReactionRDKit::v2::ReactionParser::ReactionFromPNGFile (const std::string &fname)
 constructs a ChemicalReaction from the metadata in a PNG file See PNGStreamToChemicalReaction() for more details
 
ChemicalReactionRDKit::v1::PNGStreamToChemicalReaction (std::istream &pngStream)
 constructs a ChemicalReaction from the metadata in a PNG stream
 
ChemicalReactionRDKit::v1::PNGStringToChemicalReaction (const std::string &data)
 constructs a ChemicalReaction from the metadata in a PNG string See PNGStreamToChemicalReaction() for more details
 
ChemicalReactionRDKit::v1::PNGFileToChemicalReaction (const std::string &fname)
 constructs a ChemicalReaction from the metadata in a PNG file See PNGStreamToChemicalReaction() for more details
 
std::unique_ptr< ChemicalReactionRDKit::operator""_rxnsmarts (const char *text, size_t len)
 
std::unique_ptr< ChemicalReactionRDKit::operator""_rxnsmiles (const char *text, size_t len)
 
Reaction SMARTS/SMILES Support
ChemicalReactionRDKit::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 ChemicalReactionRDKit::RxnMolToChemicalReaction (const ROMol &mol)
 Parse a ROMol into a ChemicalReaction, RXN role must be set before.
 
RDKIT_CHEMREACTIONS_EXPORT ROMolRDKit::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