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 {
79 const ROMol &mol, std::uint32_t flags = CXSmilesFields::CX_ALL);
83 const std::vector<ROMol *> &mols, std::uint32_t flags);
107 const Bond * =
nullptr,
108 bool allHsExplicit =
false,
113 ps.doKekule = doKekule;
114 ps.allHsExplicit = allHsExplicit;
138 bool doKekule =
false,
139 bool allBondsExplicit =
false) {
142 ps.allBondsExplicit = allBondsExplicit;
143 ps.doIsomericSmiles =
false;
180 bool doKekule =
false,
int rootedAtAtom = -1,
181 bool canonical =
true,
182 bool allBondsExplicit =
false,
183 bool allHsExplicit =
false,
184 bool doRandom =
false,
185 bool ignoreAtomMapNumbers =
false) {
188 ps.doKekule = doKekule;
189 ps.rootedAtAtom = rootedAtAtom;
190 ps.canonical = canonical;
191 ps.allBondsExplicit = allBondsExplicit;
192 ps.allHsExplicit = allHsExplicit;
193 ps.doRandom = doRandom;
194 ps.ignoreAtomMapNumbers = ignoreAtomMapNumbers;
212 const ROMol &mol,
unsigned int numSmiles,
unsigned int randomSeed = 0,
213 bool doIsomericSmiles =
true,
bool doKekule =
false,
214 bool allBondsExplicit =
false,
bool allHsExplicit =
false);
221 const std::vector<std::string> *atomSymbols =
nullptr,
222 const std::vector<std::string> *
bondSymbols =
nullptr);
252 const std::vector<std::string> *atomSymbols =
nullptr,
253 const std::vector<std::string> *
bondSymbols =
nullptr,
254 bool doIsomericSmiles =
true,
bool doKekule =
false,
int rootedAtAtom = -1,
255 bool canonical =
true,
bool allBondsExplicit =
false,
256 bool allHsExplicit =
false) {
259 ps.doKekule = doKekule;
260 ps.rootedAtAtom = rootedAtAtom;
261 ps.canonical = canonical;
262 ps.allBondsExplicit = allBondsExplicit;
263 ps.allHsExplicit = allHsExplicit;
276 std::uint32_t flags = SmilesWrite::CXSmilesFields::CX_ALL,
278 RestoreBondDirOption::RestoreBondDirOptionClear);
297 bool doKekule =
false,
int rootedAtAtom = -1,
298 bool canonical =
true,
299 bool allBondsExplicit =
false,
300 bool allHsExplicit =
false,
301 bool doRandom =
false) {
304 ps.doKekule = doKekule;
305 ps.rootedAtAtom = rootedAtAtom;
306 ps.canonical = canonical;
307 ps.allBondsExplicit = allBondsExplicit;
308 ps.allHsExplicit = allHsExplicit;
309 ps.doRandom = doRandom;
318 const std::vector<std::string> *atomSymbols =
nullptr,
319 const std::vector<std::string> *
bondSymbols =
nullptr);
347 const std::vector<std::string> *atomSymbols =
nullptr,
348 const std::vector<std::string> *
bondSymbols =
nullptr,
349 bool doIsomericSmiles =
true,
bool doKekule =
false,
int rootedAtAtom = -1,
350 bool canonical =
true,
bool allBondsExplicit =
false,
351 bool allHsExplicit =
false) {
354 ps.doKekule = doKekule;
355 ps.rootedAtAtom = rootedAtAtom;
356 ps.canonical = canonical;
357 ps.allBondsExplicit = allBondsExplicit;
358 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