 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
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(); };
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);
167 const std::string &fName,
192 bool sanitize =
true,
193 bool skipFirstConf =
false);
211 bool sanitize =
true,
212 bool skipFirstConf =
false);
215 const ROMol &mol,
const std::string &partialChargeProp =
"_GasteigerCharge",
216 bool writeFirstConfTwice =
false);
218 const ROMol &mol,
const std::string &fName,
219 const std::string &partialChargeProp =
"_GasteigerCharge",
220 bool writeFirstConfTwice =
false);
242 bool sanitize =
true,
245 bool cleanupSubstructures =
true);
258 std::istream *inStream,
bool sanitize =
true,
bool removeHs =
true,
262 std::istream &inStream,
bool sanitize =
true,
bool removeHs =
true,
276 const std::string &molBlock,
bool sanitize =
true,
bool removeHs =
true,
280 bool sanitize =
true,
282 unsigned int flavor = 0,
283 bool proximityBonding =
true);
286 bool sanitize =
true,
288 unsigned int flavor = 0,
289 bool proximityBonding =
true);
291 std::istream *inStream,
bool sanitize =
true,
bool removeHs =
true,
292 unsigned int flavor = 0,
bool proximityBonding =
true);
294 std::istream &inStream,
bool sanitize =
true,
bool removeHs =
true,
295 unsigned int flavor = 0,
bool proximityBonding =
true);
297 bool sanitize =
true,
299 unsigned int flavor = 0,
300 bool proximityBonding =
true);
316 unsigned int flavor = 0);
331 const std::string &fname,
333 unsigned int flavor = 0);
345 bool sanitize =
true,
350 bool sanitize =
true,
353 inline std::unique_ptr<RDKit::RWMol>
operator"" _ctab(
const char *text,
355 std::string data(text, len);
356 RWMol *ptr =
nullptr;
362 return std::unique_ptr<RWMol>(ptr);
364 inline std::unique_ptr<RDKit::RWMol>
operator"" _mol2(
const char *text,
366 std::string data(text, len);
367 RWMol *ptr =
nullptr;
373 return std::unique_ptr<RWMol>(ptr);
376 inline std::unique_ptr<RDKit::RWMol>
operator"" _pdb(
const char *text,
378 std::string data(text, len);
379 RWMol *ptr =
nullptr;
385 return std::unique_ptr<RWMol>(ptr);
RDKIT_FILEPARSERS_EXPORT void MolToPDBFile(const ROMol &mol, const std::string &fname, int confId=-1, unsigned int flavor=0)
RDKIT_FILEPARSERS_EXPORT std::string MolToTPLText(const ROMol &mol, const std::string &partialChargeProp="_GasteigerCharge", bool writeFirstConfTwice=false)
const int MOLFILE_MAXLINE
MolFileUnhandledFeatureException(const char *msg)
construct with an error message
const char * message() const noexcept
RDKIT_FILEPARSERS_EXPORT void MolToTPLFile(const ROMol &mol, const std::string &fName, const std::string &partialChargeProp="_GasteigerCharge", bool writeFirstConfTwice=false)
#define RDKIT_FILEPARSERS_EXPORT
RWMol is a molecule class that is intended to be edited.
RDKIT_FILEPARSERS_EXPORT RWMol * Mol2DataStreamToMol(std::istream *inStream, bool sanitize=true, bool removeHs=true, Mol2Type variant=CORINA, bool cleanupSubstructures=true)
void MolToV3KMolFile(const ROMol &mol, const std::string &fName, bool includeStereo=true, int confId=-1, bool kekulize=true)
RDKIT_FILEPARSERS_EXPORT std::string strip(const std::string &orig)
RDKIT_FILEPARSERS_EXPORT std::string MolToXYZBlock(const ROMol &mol, int confId=-1)
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
~MolFileUnhandledFeatureException() noexcept override
pulls in the core RDKit functionality
class for flagging sanitization errors
RDKIT_FILEPARSERS_EXPORT void MolToXYZFile(const ROMol &mol, const std::string &fName, int confId=-1)
RDKIT_FILEPARSERS_EXPORT RWMol * MolBlockToMol(const std::string &molBlock, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
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 RWMol * MolDataStreamToMol(std::istream *inStream, unsigned int &line, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
std::string MolToV3KMolBlock(const ROMol &mol, 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 RWMol * Mol2FileToMol(const std::string &fName, bool sanitize=true, bool removeHs=true, Mol2Type variant=CORINA, bool cleanupSubstructures=true)
const char * what() const noexcept override
get the error message
RDKIT_FILEPARSERS_EXPORT RWMol * RDKitSVGToMol(const std::string &svg, bool sanitize=true, bool removeHs=true)
std::vector< RWMOL_SPTR > RWMOL_SPTR_VECT
RDKIT_FILEPARSERS_EXPORT RWMol * PDBBlockToMol(const char *str, bool sanitize=true, bool removeHs=true, unsigned int flavor=0, bool proximityBonding=true)
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
MolFileUnhandledFeatureException(const std::string msg)
construct with an error message
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 * PDBFileToMol(const std::string &fname, 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 * MolFileToMol(const std::string &fName, bool sanitize=true, bool removeHs=true, bool strictParsing=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 std::string MolToPDBBlock(const ROMol &mol, int confId=-1, unsigned int flavor=0)