11 #ifndef _RD_FILEPARSERS_H
12 #define _RD_FILEPARSERS_H
22 #include <boost/shared_ptr.hpp>
36 const char *
what() const noexcept
override {
return _msg.c_str(); };
64 bool strictParsing =
true);
70 bool strictParsing =
true);
84 bool strictParsing =
true);
99 bool strictParsing =
true);
113 bool includeStereo =
true,
115 bool kekulize =
true,
116 bool forceV3000 =
false);
127 int confId = -1,
bool kekulize =
true) {
128 return MolToMolBlock(mol, includeStereo, confId, kekulize,
true);
144 const ROMol &mol,
const std::string &fName,
bool includeStereo =
true,
145 int confId = -1,
bool kekulize =
true,
bool forceV3000 =
false);
157 bool includeStereo =
true,
int confId = -1,
158 bool kekulize =
true) {
159 MolToMolFile(mol, fName, includeStereo, confId, kekulize,
true);
166 const std::string &fName,
191 bool sanitize =
true,
192 bool skipFirstConf =
false);
210 bool sanitize =
true,
211 bool skipFirstConf =
false);
214 const ROMol &mol,
const std::string &partialChargeProp =
"_GasteigerCharge",
215 bool writeFirstConfTwice =
false);
217 const ROMol &mol,
const std::string &fName,
218 const std::string &partialChargeProp =
"_GasteigerCharge",
219 bool writeFirstConfTwice =
false);
241 bool sanitize =
true,
244 bool cleanupSubstructures =
true);
257 std::istream *inStream,
bool sanitize =
true,
bool removeHs =
true,
261 std::istream &inStream,
bool sanitize =
true,
bool removeHs =
true,
275 const std::string &molBlock,
bool sanitize =
true,
bool removeHs =
true,
279 bool sanitize =
true,
281 unsigned int flavor = 0,
282 bool proximityBonding =
true);
285 bool sanitize =
true,
287 unsigned int flavor = 0,
288 bool proximityBonding =
true);
290 std::istream *inStream,
bool sanitize =
true,
bool removeHs =
true,
291 unsigned int flavor = 0,
bool proximityBonding =
true);
293 std::istream &inStream,
bool sanitize =
true,
bool removeHs =
true,
294 unsigned int flavor = 0,
bool proximityBonding =
true);
296 bool sanitize =
true,
298 unsigned int flavor = 0,
299 bool proximityBonding =
true);
315 unsigned int flavor = 0);
330 const std::string &fname,
332 unsigned int flavor = 0);
344 bool sanitize =
true,
349 bool sanitize =
true,
352 inline std::unique_ptr<RDKit::RWMol>
operator"" _ctab(
const char *text,
354 std::string data(text, len);
355 RWMol *ptr =
nullptr;
361 return std::unique_ptr<RWMol>(ptr);
363 inline std::unique_ptr<RDKit::RWMol>
operator"" _mol2(
const char *text,
365 std::string data(text, len);
366 RWMol *ptr =
nullptr;
372 return std::unique_ptr<RWMol>(ptr);
375 inline std::unique_ptr<RDKit::RWMol>
operator"" _pdb(
const char *text,
377 std::string data(text, len);
378 RWMol *ptr =
nullptr;
384 return std::unique_ptr<RWMol>(ptr);
pulls in the core RDKit functionality
MolFileUnhandledFeatureException(const char *msg)
construct with an error message
~MolFileUnhandledFeatureException() noexcept override
MolFileUnhandledFeatureException(const std::string msg)
construct with an error message
const char * what() const noexcept override
get the error message
class for flagging sanitization errors
RWMol is a molecule class that is intended to be edited.
#define RDKIT_FILEPARSERS_EXPORT
RDKIT_GRAPHMOL_EXPORT ROMol * removeHs(const ROMol &mol, bool implicitOnly=false, bool updateExplicitCount=false, bool sanitize=true)
returns a copy of a molecule with hydrogens removed
std::string MolToV3KMolBlock(const ROMol &mol, bool includeStereo=true, int confId=-1, bool kekulize=true)
RDKIT_FILEPARSERS_EXPORT std::string strip(const std::string &orig)
RDKIT_FILEPARSERS_EXPORT void MolToMolFile(const ROMol &mol, const std::string &fName, bool includeStereo=true, int confId=-1, bool kekulize=true, bool forceV3000=false)
RDKIT_FILEPARSERS_EXPORT std::string MolToPDBBlock(const ROMol &mol, int confId=-1, unsigned int flavor=0)
RDKIT_FILEPARSERS_EXPORT RWMol * MolBlockToMol(const std::string &molBlock, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
RDKIT_FILEPARSERS_EXPORT std::string MolToXYZBlock(const ROMol &mol, int confId=-1)
RDKIT_FILEPARSERS_EXPORT void MolToXYZFile(const ROMol &mol, const std::string &fName, int confId=-1)
RDKIT_FILEPARSERS_EXPORT std::string MolToTPLText(const ROMol &mol, const std::string &partialChargeProp="_GasteigerCharge", bool writeFirstConfTwice=false)
RDKIT_FILEPARSERS_EXPORT void MolToPDBFile(const ROMol &mol, const std::string &fname, int confId=-1, unsigned int flavor=0)
RDKIT_FILEPARSERS_EXPORT RWMol * PDBFileToMol(const std::string &fname, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
void MolToV3KMolFile(const ROMol &mol, const std::string &fName, bool includeStereo=true, int confId=-1, bool kekulize=true)
RDKIT_FILEPARSERS_EXPORT RWMol * TPLDataStreamToMol(std::istream *inStream, unsigned int &line, bool sanitize=true, bool skipFirstConf=false)
translate TPL data (BioCad format) into a multi-conf molecule
RDKIT_FILEPARSERS_EXPORT std::string MolToMolBlock(const ROMol &mol, bool includeStereo=true, int confId=-1, bool kekulize=true, bool forceV3000=false)
RDKIT_FILEPARSERS_EXPORT RWMol * PDBDataStreamToMol(std::istream *inStream, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
RDKIT_FILEPARSERS_EXPORT RWMol * Mol2FileToMol(const std::string &fName, bool sanitize=true, bool removeHs=true, Mol2Type variant=CORINA, bool cleanupSubstructures=true)
RDKIT_FILEPARSERS_EXPORT RWMol * RDKitSVGToMol(const std::string &svg, bool sanitize=true, bool removeHs=true)
RDKIT_FILEPARSERS_EXPORT void MolToTPLFile(const ROMol &mol, const std::string &fName, const std::string &partialChargeProp="_GasteigerCharge", bool writeFirstConfTwice=false)
RDKIT_FILEPARSERS_EXPORT RWMol * Mol2DataStreamToMol(std::istream *inStream, bool sanitize=true, bool removeHs=true, Mol2Type variant=CORINA, bool cleanupSubstructures=true)
RDKIT_FILEPARSERS_EXPORT RWMol * PDBBlockToMol(const char *str, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
RDKIT_FILEPARSERS_EXPORT RWMol * Mol2BlockToMol(const std::string &molBlock, bool sanitize=true, bool removeHs=true, Mol2Type variant=CORINA, bool cleanupSubstructures=true)
RDKIT_FILEPARSERS_EXPORT RWMol * TPLFileToMol(const std::string &fName, bool sanitize=true, bool skipFirstConf=false)
construct a multi-conf molecule from a TPL (BioCad format) file
RDKIT_FILEPARSERS_EXPORT RWMol * MolDataStreamToMol(std::istream *inStream, unsigned int &line, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
RDKIT_FILEPARSERS_EXPORT RWMol * MolFileToMol(const std::string &fName, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
const int MOLFILE_MAXLINE
std::vector< RWMOL_SPTR > RWMOL_SPTR_VECT