11#ifndef RD_SMILESWRITE_H_012020
12#define RD_SMILESWRITE_H_012020
21#include <boost/shared_ptr.hpp>
31 bool doIsomericSmiles =
33 bool doKekule =
false;
37 bool canonical =
true;
38 bool cleanStereo =
true;
39 bool allBondsExplicit =
false;
40 bool allHsExplicit =
false;
41 bool doRandom =
false;
44 int rootedAtAtom = -1;
48 bool includeDativeBonds =
51 bool ignoreAtomMapNumbers =
false;
55namespace SmilesWrite {
77 const ROMol &mol, std::uint32_t flags = CXSmilesFields::CX_ALL);
81 const std::vector<ROMol *> &mols, std::uint32_t flags);
105 const Bond * =
nullptr,
106 bool allHsExplicit =
false,
111 ps.doKekule = doKekule;
112 ps.allHsExplicit = allHsExplicit;
136 bool doKekule =
false,
137 bool allBondsExplicit =
false) {
140 ps.allBondsExplicit = allBondsExplicit;
141 ps.doIsomericSmiles =
false;
178 bool doKekule =
false,
int rootedAtAtom = -1,
179 bool canonical =
true,
180 bool allBondsExplicit =
false,
181 bool allHsExplicit =
false,
182 bool doRandom =
false,
183 bool ignoreAtomMapNumbers =
false) {
186 ps.doKekule = doKekule;
187 ps.rootedAtAtom = rootedAtAtom;
188 ps.canonical = canonical;
189 ps.allBondsExplicit = allBondsExplicit;
190 ps.allHsExplicit = allHsExplicit;
191 ps.doRandom = doRandom;
192 ps.ignoreAtomMapNumbers = ignoreAtomMapNumbers;
210 const ROMol &mol,
unsigned int numSmiles,
unsigned int randomSeed = 0,
211 bool doIsomericSmiles =
true,
bool doKekule =
false,
212 bool allBondsExplicit =
false,
bool allHsExplicit =
false);
219 const std::vector<std::string> *atomSymbols =
nullptr,
220 const std::vector<std::string> *
bondSymbols =
nullptr);
250 const std::vector<std::string> *atomSymbols =
nullptr,
251 const std::vector<std::string> *
bondSymbols =
nullptr,
252 bool doIsomericSmiles =
true,
bool doKekule =
false,
int rootedAtAtom = -1,
253 bool canonical =
true,
bool allBondsExplicit =
false,
254 bool allHsExplicit =
false) {
257 ps.doKekule = doKekule;
258 ps.rootedAtAtom = rootedAtAtom;
259 ps.canonical = canonical;
260 ps.allBondsExplicit = allBondsExplicit;
261 ps.allHsExplicit = allHsExplicit;
274 std::uint32_t flags = SmilesWrite::CXSmilesFields::CX_ALL,
276 RestoreBondDirOption::RestoreBondDirOptionClear);
295 bool doKekule =
false,
int rootedAtAtom = -1,
296 bool canonical =
true,
297 bool allBondsExplicit =
false,
298 bool allHsExplicit =
false,
299 bool doRandom =
false) {
302 ps.doKekule = doKekule;
303 ps.rootedAtAtom = rootedAtAtom;
304 ps.canonical = canonical;
305 ps.allBondsExplicit = allBondsExplicit;
306 ps.allHsExplicit = allHsExplicit;
307 ps.doRandom = doRandom;
316 const std::vector<std::string> *atomSymbols =
nullptr,
317 const std::vector<std::string> *
bondSymbols =
nullptr);
345 const std::vector<std::string> *atomSymbols =
nullptr,
346 const std::vector<std::string> *
bondSymbols =
nullptr,
347 bool doIsomericSmiles =
true,
bool doKekule =
false,
int rootedAtAtom = -1,
348 bool canonical =
true,
bool allBondsExplicit =
false,
349 bool allHsExplicit =
false) {
352 ps.doKekule = doKekule;
353 ps.rootedAtAtom = rootedAtAtom;
354 ps.canonical = canonical;
355 ps.allBondsExplicit = allBondsExplicit;
356 ps.allHsExplicit = allHsExplicit;
#define BETTER_ENUM(Enum, Underlying,...)
The class for representing atoms.
class for representing a bond
#define RDKIT_SMILESPARSE_EXPORT
RDKIT_SMILESPARSE_EXPORT std::string MolToSmiles(const ROMol &mol, const SmilesWriteParams ¶ms, bool doingCXSmiles)
RDKIT_SMILESPARSE_EXPORT std::string GetAtomSmiles(const Atom *atom, const SmilesWriteParams &ps)
returns the SMILES for an atom
RDKIT_SMILESPARSE_EXPORT bool inOrganicSubset(int atomicNumber)
returns true if the atom number is in the SMILES organic subset
RDKIT_SMILESPARSE_EXPORT std::string GetBondSmiles(const Bond *bond, const SmilesWriteParams &ps, int atomToLeftIdx=-1)
returns the SMILES for a bond
RDKIT_SMILESPARSE_EXPORT std::string getCXExtensions(const ROMol &mol, std::uint32_t flags=CXSmilesFields::CX_ALL)
returns the cxsmiles data for a molecule
RDKIT_SMILESPARSE_EXPORT std::vector< std::string > MolToRandomSmilesVect(const ROMol &mol, unsigned int numSmiles, unsigned int randomSeed=0, bool doIsomericSmiles=true, bool doKekule=false, bool allBondsExplicit=false, bool allHsExplicit=false)
returns a vector of random SMILES for a molecule (may contain duplicates)
bool rdvalue_is(const RDValue_cast_t)
RDKIT_SMILESPARSE_EXPORT std::string MolToCXSmiles(const ROMol &mol, const SmilesWriteParams &ps, std::uint32_t flags=SmilesWrite::CXSmilesFields::CX_ALL, RestoreBondDirOption restoreBondDirs=RestoreBondDirOption::RestoreBondDirOptionClear)
returns canonical CXSMILES for a molecule
RDKIT_SMILESPARSE_EXPORT std::string MolFragmentToSmiles(const ROMol &mol, const SmilesWriteParams ¶ms, const std::vector< int > &atomsToUse, const std::vector< int > *bondsToUse=nullptr, const std::vector< std::string > *atomSymbols=nullptr, const std::vector< std::string > *bondSymbols=nullptr)
returns canonical SMILES for part of a molecule
RDKIT_SMILESPARSE_EXPORT std::string MolToSmiles(const ROMol &mol, const SmilesWriteParams ¶ms)
returns canonical SMILES for a molecule
RDKIT_SMILESPARSE_EXPORT std::string MolFragmentToCXSmiles(const ROMol &mol, const SmilesWriteParams ¶ms, const std::vector< int > &atomsToUse, const std::vector< int > *bondsToUse=nullptr, const std::vector< std::string > *atomSymbols=nullptr, const std::vector< std::string > *bondSymbols=nullptr)
returns canonical CXSMILES for part of a molecule
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT