RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
SmilesWrite.h File Reference
#include <RDGeneral/export.h>
#include <string>
#include <vector>
#include <memory>
#include <cstdint>
#include <limits>

Go to the source code of this file.

Classes

struct  RDKit::SmilesWriteParams
 

Namespaces

namespace  RDKit
 Std stuff.
 
namespace  RDKit::SmilesWrite
 
namespace  RDKit::SmilesWrite::detail
 

Macros

#define CXSMILESFIELDS_ENUM_ITEMS
 
#define CXSMILESFIELDS_ENUM_ITEM(k, v)   k = (v),
 
#define CXSMILESFIELDS_STD_MAP_ITEM(k)   {#k, SmilesWrite::CXSmilesFields::k},
 
#define CXSMILESFIELDS_ENUM_ITEM(k, v)   CXSMILESFIELDS_STD_MAP_ITEM(k)
 
#define CXSMILESFIELDS_ITEMS_MAP
 
#define RESTOREBONDDIROPTION_ENUM_ITEMS
 
#define RESTOREBONDDIROPTION_ENUM_ITEM(k, v)   k = v,
 
#define RESTOREBONDDIROPTION_STD_MAP_ITEM(k)   {#k, k},
 
#define RESTOREBONDDIROPTION_ENUM_ITEM(k, v)    RESTOREBONDDIROPTION_STD_MAP_ITEM(k)
 
#define RESTOREBONDDIROPTION_ITEMS_MAP
 

Enumerations

enum  RDKit::SmilesWrite::CXSmilesFields : uint32_t { RDKit::SmilesWrite::CXSMILESFIELDS_ENUM_ITEMS }
 
enum  RDKit::RestoreBondDirOption { RDKit::RESTOREBONDDIROPTION_ENUM_ITEMS }
 

Functions

RDKIT_SMILESPARSE_EXPORT std::string RDKit::SmilesWrite::getCXExtensions (const ROMol &mol, std::uint32_t flags=CXSmilesFields::CX_ALL)
 returns the cxsmiles data for a molecule
 
RDKIT_SMILESPARSE_EXPORT bool RDKit::SmilesWrite::inOrganicSubset (int atomicNumber)
 returns true if the atom number is in the SMILES organic subset
 
RDKIT_SMILESPARSE_EXPORT std::string RDKit::SmilesWrite::GetAtomSmiles (const Atom *atom, const SmilesWriteParams &ps)
 returns the SMILES for an atom
 
std::string RDKit::SmilesWrite::GetAtomSmiles (const Atom *atom, bool doKekule=false, const Bond *=nullptr, bool allHsExplicit=false, bool isomericSmiles=true)
 returns the SMILES for an atom
 
RDKIT_SMILESPARSE_EXPORT std::string RDKit::SmilesWrite::GetBondSmiles (const Bond *bond, const SmilesWriteParams &ps, int atomToLeftIdx=-1)
 returns the SMILES for a bond
 
std::string RDKit::SmilesWrite::GetBondSmiles (const Bond *bond, int atomToLeftIdx=-1, bool doKekule=false, bool allBondsExplicit=false)
 returns the SMILES for a bond
 
RDKIT_SMILESPARSE_EXPORT std::string RDKit::SmilesWrite::detail::MolToSmiles (const ROMol &mol, const SmilesWriteParams &params, bool doingCXSmiles)
 
RDKIT_SMILESPARSE_EXPORT std::string RDKit::MolToSmiles (const ROMol &mol, const SmilesWriteParams &params)
 returns canonical SMILES for a molecule
 
std::string RDKit::MolToSmiles (const ROMol &mol, bool doIsomericSmiles=true, bool doKekule=false, int rootedAtAtom=-1, bool canonical=true, bool allBondsExplicit=false, bool allHsExplicit=false, bool doRandom=false, bool ignoreAtomMapNumbers=false)
 returns SMILES for a molecule, canonical by default
 
RDKIT_SMILESPARSE_EXPORT std::vector< std::string > RDKit::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)
 
RDKIT_SMILESPARSE_EXPORT std::string RDKit::MolFragmentToSmiles (const ROMol &mol, const SmilesWriteParams &params, 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
 
std::string RDKit::MolFragmentToSmiles (const ROMol &mol, 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, bool doIsomericSmiles=true, bool doKekule=false, int rootedAtAtom=-1, bool canonical=true, bool allBondsExplicit=false, bool allHsExplicit=false)
 returns canonical SMILES for part of a molecule
 
RDKIT_SMILESPARSE_EXPORT std::string RDKit::MolToCXSmiles (const ROMol &mol, const SmilesWriteParams &ps, std::uint32_t flags=SmilesWrite::CXSmilesFields::CX_ALL, RestoreBondDirOption restoreBondDirs=RestoreBondDirOptionClear)
 returns canonical CXSMILES for a molecule
 
std::string RDKit::MolToCXSmiles (const ROMol &mol, bool doIsomericSmiles=true, bool doKekule=false, int rootedAtAtom=-1, bool canonical=true, bool allBondsExplicit=false, bool allHsExplicit=false, bool doRandom=false)
 returns canonical CXSMILES for a molecule
 
RDKIT_SMILESPARSE_EXPORT std::string RDKit::MolFragmentToCXSmiles (const ROMol &mol, const SmilesWriteParams &params, 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::string RDKit::MolFragmentToCXSmiles (const ROMol &mol, 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, bool doIsomericSmiles=true, bool doKekule=false, int rootedAtAtom=-1, bool canonical=true, bool allBondsExplicit=false, bool allHsExplicit=false)
 returns canonical CXSMILES for part of a molecule
 
void RDKit::updateSmilesWriteParamsFromJSON (SmilesWriteParams &params, const std::string &details_json)
 
void RDKit::updateSmilesWriteParamsFromJSON (SmilesWriteParams &params, const char *details_json)
 
void RDKit::updateCXSmilesFieldsFromJSON (SmilesWrite::CXSmilesFields &cxSmilesFields, RestoreBondDirOption &restoreBondDirs, const std::string &details_json)
 
void RDKit::updateCXSmilesFieldsFromJSON (SmilesWrite::CXSmilesFields &cxSmilesFields, RestoreBondDirOption &restoreBondDirs, const char *details_json)
 

Macro Definition Documentation

◆ CXSMILESFIELDS_ENUM_ITEM [1/2]

#define CXSMILESFIELDS_ENUM_ITEM (   k,
 
)    k = (v),

Definition at line 65 of file SmilesWrite.h.

◆ CXSMILESFIELDS_ENUM_ITEM [2/2]

#define CXSMILESFIELDS_ENUM_ITEM (   k,
 
)    CXSMILESFIELDS_STD_MAP_ITEM(k)

Definition at line 65 of file SmilesWrite.h.

◆ CXSMILESFIELDS_ENUM_ITEMS

#define CXSMILESFIELDS_ENUM_ITEMS
Value:
CXSMILESFIELDS_ENUM_ITEM(CX_ATOM_LABELS, 1 << 0) \
CXSMILESFIELDS_ENUM_ITEM(CX_MOLFILE_VALUES, 1 << 1) \
CXSMILESFIELDS_ENUM_ITEM(CX_COORDS, 1 << 2) \
CXSMILESFIELDS_ENUM_ITEM(CX_RADICALS, 1 << 3) \
CXSMILESFIELDS_ENUM_ITEM(CX_ATOM_PROPS, 1 << 4) \
CXSMILESFIELDS_ENUM_ITEM(CX_LINKNODES, 1 << 5) \
CXSMILESFIELDS_ENUM_ITEM(CX_ENHANCEDSTEREO, 1 << 6) \
CXSMILESFIELDS_ENUM_ITEM(CX_SGROUPS, 1 << 7) \
CXSMILESFIELDS_ENUM_ITEM(CX_POLYMER, 1 << 8) \
CXSMILESFIELDS_ENUM_ITEM(CX_BOND_CFG, 1 << 9) \
CXSMILESFIELDS_ENUM_ITEM(CX_BOND_ATROPISOMER, 1 << 10) \
CXSMILESFIELDS_ENUM_ITEM(CX_COORDINATE_BONDS, 1 << 11) \
CXSMILESFIELDS_ENUM_ITEM(CX_ALL, 0x7fffffff) \
CXSMILESFIELDS_ENUM_ITEM(CX_ALL_BUT_COORDS, CX_ALL ^ CX_COORDS)
#define CXSMILESFIELDS_ENUM_ITEM(k, v)
Definition SmilesWrite.h:65

Definition at line 48 of file SmilesWrite.h.

◆ CXSMILESFIELDS_ITEMS_MAP

#define CXSMILESFIELDS_ITEMS_MAP
Value:
std::map<std::string, SmilesWrite::CXSmilesFields> { \
}
#define CXSMILESFIELDS_ENUM_ITEMS
Definition SmilesWrite.h:48

Definition at line 70 of file SmilesWrite.h.

◆ CXSMILESFIELDS_STD_MAP_ITEM

#define CXSMILESFIELDS_STD_MAP_ITEM (   k)    {#k, SmilesWrite::CXSmilesFields::k},

Definition at line 68 of file SmilesWrite.h.

◆ RESTOREBONDDIROPTION_ENUM_ITEM [1/2]

#define RESTOREBONDDIROPTION_ENUM_ITEM (   k,
 
)    k = v,

Definition at line 268 of file SmilesWrite.h.

◆ RESTOREBONDDIROPTION_ENUM_ITEM [2/2]

#define RESTOREBONDDIROPTION_ENUM_ITEM (   k,
 
)     RESTOREBONDDIROPTION_STD_MAP_ITEM(k)

Definition at line 268 of file SmilesWrite.h.

◆ RESTOREBONDDIROPTION_ENUM_ITEMS

#define RESTOREBONDDIROPTION_ENUM_ITEMS
Value:
RESTOREBONDDIROPTION_ENUM_ITEM(RestoreBondDirOptionTrue, \
0) /*!< DO restore bond dirs */ \
RESTOREBONDDIROPTION_ENUM_ITEM(RestoreBondDirOptionClear, \
1)
#define RESTOREBONDDIROPTION_ENUM_ITEM(k, v)

clear all bond dir information

Definition at line 266 of file SmilesWrite.h.

◆ RESTOREBONDDIROPTION_ITEMS_MAP

#define RESTOREBONDDIROPTION_ITEMS_MAP
Value:
std::map<std::string, RestoreBondDirOption> { \
}
#define RESTOREBONDDIROPTION_ENUM_ITEMS

Definition at line 274 of file SmilesWrite.h.

◆ RESTOREBONDDIROPTION_STD_MAP_ITEM

#define RESTOREBONDDIROPTION_STD_MAP_ITEM (   k)    {#k, k},

Definition at line 271 of file SmilesWrite.h.