11 #ifndef _RD_FILEPARSERS_H
12 #define _RD_FILEPARSERS_H
22 #include <boost/shared_ptr.hpp>
29 :
public std::exception {
37 const char *
what() const noexcept
override {
return _msg.c_str(); }
65 bool strictParsing = true);
71 bool strictParsing = true);
85 bool strictParsing = true);
100 bool strictParsing = true);
114 bool includeStereo = true,
116 bool kekulize = true,
117 bool forceV3000 = false);
128 int confId = -1,
bool kekulize = true) {
129 return MolToMolBlock(mol, includeStereo, confId, kekulize,
true);
145 const ROMol &mol,
const std::string &fName,
bool includeStereo =
true,
146 int confId = -1,
bool kekulize =
true,
bool forceV3000 =
false);
158 bool includeStereo =
true,
int confId = -1,
159 bool kekulize =
true) {
160 MolToMolFile(mol, fName, includeStereo, confId, kekulize,
true);
165 bool kekulize =
true);
168 const std::string &fName,
170 bool kekulize =
true);
176 const std::string &fName,
201 bool sanitize =
true,
202 bool skipFirstConf =
false);
220 bool sanitize =
true,
221 bool skipFirstConf =
false);
224 const ROMol &mol,
const std::string &partialChargeProp =
"_GasteigerCharge",
225 bool writeFirstConfTwice =
false);
227 const ROMol &mol,
const std::string &fName,
228 const std::string &partialChargeProp =
"_GasteigerCharge",
229 bool writeFirstConfTwice =
false);
251 bool sanitize =
true,
254 bool cleanupSubstructures =
true);
267 std::istream *inStream,
bool sanitize =
true,
bool removeHs =
true,
271 std::istream &inStream,
bool sanitize =
true,
bool removeHs =
true,
285 const std::string &molBlock,
bool sanitize =
true,
bool removeHs =
true,
289 bool sanitize =
true,
291 unsigned int flavor = 0,
292 bool proximityBonding =
true);
295 bool sanitize =
true,
297 unsigned int flavor = 0,
298 bool proximityBonding =
true);
300 std::istream *inStream,
bool sanitize =
true,
bool removeHs =
true,
301 unsigned int flavor = 0,
bool proximityBonding =
true);
303 std::istream &inStream,
bool sanitize =
true,
bool removeHs =
true,
304 unsigned int flavor = 0,
bool proximityBonding =
true);
306 bool sanitize =
true,
308 unsigned int flavor = 0,
309 bool proximityBonding =
true);
325 unsigned int flavor = 0);
340 const std::string &fname,
342 unsigned int flavor = 0);
354 bool sanitize =
true,
359 bool sanitize =
true,
362 inline std::unique_ptr<RDKit::RWMol>
operator"" _ctab(
const char *text,
364 std::string data(text, len);
365 RWMol *ptr =
nullptr;
371 return std::unique_ptr<RWMol>(ptr);
373 inline std::unique_ptr<RDKit::RWMol>
operator"" _mol2(
const char *text,
375 std::string data(text, len);
376 RWMol *ptr =
nullptr;
382 return std::unique_ptr<RWMol>(ptr);
385 inline std::unique_ptr<RDKit::RWMol>
operator"" _pdb(
const char *text,
387 std::string data(text, len);
388 RWMol *ptr =
nullptr;
394 return std::unique_ptr<RWMol>(ptr);
pulls in the core RDKit functionality
MolFileUnhandledFeatureException(const char *msg)
construct with an error message
MolFileUnhandledFeatureException(const std::string msg)
construct with an error message
~MolFileUnhandledFeatureException() noexcept override=default
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 void MolToCMLFile(const ROMol &mol, const std::string &fName, int confId=-1, bool kekulize=true)
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 std::string MolToCMLBlock(const ROMol &mol, int confId=-1, bool kekulize=true)
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
boost::shared_ptr< RWMol > RWMOL_SPTR