11#ifndef RD_FILEPARSERS_H
12#define RD_FILEPARSERS_H
23#include <boost/shared_ptr.hpp>
32 :
public std::exception {
40 const char *
what() const noexcept
override {
return _msg.c_str(); }
88 std::istream &inStream,
unsigned int &line,
91 const std::string &molBlock,
94 const std::string &fName,
98 std::istream &inStream,
unsigned int &line,
102 const std::string &molBlock,
106 const std::string &fName,
132 bool sanitize =
true,
bool removeHs =
true,
133 bool strictParsing =
true) {
142 bool sanitize =
true,
bool removeHs =
true,
143 bool strictParsing =
true) {
157 bool removeHs =
true,
bool strictParsing =
true) {
176 bool removeHs =
true,
bool strictParsing =
true) {
190namespace FileParsers {
197 std::istream &inStream,
unsigned int &line,
200 const std::string &fName,
224 bool sanitize =
true,
225 bool skipFirstConf =
false) {
248 bool skipFirstConf =
false) {
257namespace FileParsers {
276 std::istream &inStream,
279 const std::string &molBlock,
282 const std::string &fName,
303 bool removeHs =
true,
304 Mol2Type variant = Mol2Type::CORINA,
305 bool cleanupSubstructures =
true) {
325 bool removeHs =
true,
326 Mol2Type variant = Mol2Type::CORINA,
327 bool cleanupSubstructures =
true) {
337 bool removeHs =
true,
338 Mol2Type variant = Mol2Type::CORINA,
339 bool cleanupSubstructures =
true) {
341 cleanupSubstructures);
355 bool removeHs =
true,
356 Mol2Type variant = Mol2Type::CORINA,
357 bool cleanupSubstructures =
true) {
368namespace FileParsers {
371 std::istream &inStream);
377 const std::string &xyzBlock);
383 const std::string &fName);
408namespace FileParsers {
420 const std::string &fname,
430 bool removeHs =
true,
unsigned int flavor = 0,
431 bool proximityBonding =
true) {
440 bool removeHs =
true,
unsigned int flavor = 0,
441 bool proximityBonding =
true) {
442 return PDBBlockToMol(std::string(str), sanitize, removeHs, flavor,
446 bool removeHs =
true,
unsigned int flavor = 0,
447 bool proximityBonding =
true) {
456 bool removeHs =
true,
unsigned int flavor = 0,
457 bool proximityBonding =
true) {
466 bool removeHs =
true,
unsigned int flavor = 0,
467 bool proximityBonding =
true) {
483 bool sanitize =
true,
484 bool removeHs =
true);
488 bool sanitize =
true,
489 bool removeHs =
true);
491inline std::unique_ptr<RDKit::RWMol>
operator""_ctab(
const char *text,
493 std::string data(text, len);
500inline std::unique_ptr<RDKit::RWMol>
operator""_mol2(
const char *text,
502 std::string data(text, len);
510inline std::unique_ptr<RDKit::RWMol>
operator""_pdb(
const char *text,
512 std::string data(text, len);
pulls in the core RDKit functionality
class for flagging sanitization errors
RWMol is a molecule class that is intended to be edited.
MolFileUnhandledFeatureException(const char *msg)
construct with an error message
const char * what() const noexcept override
get the error message
MolFileUnhandledFeatureException(const std::string msg)
construct with an error message
~MolFileUnhandledFeatureException() noexcept override=default
MolFileUnhandledFeatureException(const char *msg)
construct with an error message
#define RDKIT_FILEPARSERS_EXPORT
RWMol * Mol2BlockToMol(const std::string &molBlock, bool sanitize=true, bool removeHs=true, Mol2Type variant=Mol2Type::CORINA, bool cleanupSubstructures=true)
RWMol * XYZFileToMol(const std::string &fName)
RWMol * Mol2FileToMol(const std::string &fName, bool sanitize=true, bool removeHs=true, Mol2Type variant=Mol2Type::CORINA, bool cleanupSubstructures=true)
RWMol * MolFileToMol(const std::string &fName, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
RWMol * Mol2DataStreamToMol(std::istream &inStream, bool sanitize=true, bool removeHs=true, Mol2Type variant=Mol2Type::CORINA, bool cleanupSubstructures=true)
RWMol * MolBlockToMol(const std::string &molBlock, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
RWMol * PDBDataStreamToMol(std::istream &inStream, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
RWMol * MolDataStreamToMol(std::istream *inStream, unsigned int &line, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
RWMol * TPLFileToMol(const std::string &fName, bool sanitize=true, bool skipFirstConf=false)
construct a multi-conf molecule from a TPL (BioCad format) file
RWMol * PDBFileToMol(const std::string &fname, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
RWMol * XYZDataStreamToMol(std::istream &inStream)
RWMol * TPLDataStreamToMol(std::istream *inStream, unsigned int &line, bool sanitize=true, bool skipFirstConf=false)
translate TPL data (BioCad format) into a multi-conf molecule
RWMol * XYZBlockToMol(const std::string &xyzBlock)
RWMol * PDBBlockToMol(const std::string &str, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromTPLFile(const std::string &fName, const TPLParserParams ¶ms=TPLParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromPDBFile(const std::string &fname, const PDBParserParams ¶ms=PDBParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromPDBDataStream(std::istream &inStream, const PDBParserParams ¶ms=PDBParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RDKit::RWMol > MolFromSCSRDataStream(std::istream &inStream, unsigned int &line, const MolFileParserParams &molFileParserParams=MolFileParserParams(), const MolFromSCSRParams &molFromSCSRParams=MolFromSCSRParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromXYZFile(const std::string &fName)
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromXYZBlock(const std::string &xyzBlock)
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromMolFile(const std::string &fName, const MolFileParserParams ¶ms=MolFileParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromMol2DataStream(std::istream &inStream, const Mol2ParserParams ¶ms=Mol2ParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromPDBBlock(const std::string &str, const PDBParserParams ¶ms=PDBParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromMol2File(const std::string &fName, const Mol2ParserParams ¶ms=Mol2ParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromXYZDataStream(std::istream &inStream)
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RDKit::RWMol > MolFromSCSRFile(const std::string &fName, const MolFileParserParams &molFileParserParams=MolFileParserParams(), const MolFromSCSRParams &molFromSCSRParams=MolFromSCSRParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RDKit::RWMol > MolFromSCSRBlock(const std::string &molBlock, const MolFileParserParams &molFileParserParams=MolFileParserParams(), const MolFromSCSRParams &molFromSCSRParams=MolFromSCSRParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromMolBlock(const std::string &molBlock, const MolFileParserParams ¶ms=MolFileParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromMol2Block(const std::string &molBlock, const Mol2ParserParams ¶ms=Mol2ParserParams())
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromMolDataStream(std::istream &inStream, unsigned int &line, const MolFileParserParams ¶ms=MolFileParserParams())
@ CORINA
supports output from Corina and some dbtranslate output
RDKIT_FILEPARSERS_EXPORT std::unique_ptr< RWMol > MolFromTPLDataStream(std::istream &inStream, unsigned int &line, const TPLParserParams ¶ms=TPLParserParams())
RDKIT_FILEPARSERS_EXPORT std::string strip(const std::string &orig)
RDKIT_FILEPARSERS_EXPORT RWMol * RDKitSVGToMol(const std::string &svg, bool sanitize=true, bool removeHs=true)
bool cleanupSubstructures
bool expandAttachmentPoints
bool includeLeavingGroups
SCSRBaseHbondOptions scsrBaseHbondOptions
SCSRTemplateNames scsrTemplateNames