RDKit
Open-source cheminformatics and machine learning.
SmilesParseOps.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2022 Greg Landrum and other RDKit contributors
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #include <RDGeneral/export.h>
11 #ifndef RD_SMILESPARSEOPS_H
12 #define RD_SMILESPARSEOPS_H
13 #include <GraphMol/Bond.h>
14 
15 namespace RDKit {
16 class RWMol;
17 class Atom;
18 } // namespace RDKit
19 namespace SmilesParseOps {
21  RDKit::RWMol *mp);
22 RDKIT_SMILESPARSE_EXPORT void ReportParseError(const char *message,
23  bool throwIt = true);
25 // This uses SMARTS semantics: unspecified bonds are treated as
26 // aromatic or single.
28  RDKit::RWMol *mol, RDKit::RWMol *frag,
32  const RDKit::RWMol *mol, const RDKit::Atom *atom1,
33  const RDKit::Atom *atom2);
35  bool strict);
37  bool toleratePartials);
42  RDKit::RWMol &mol, const std::string &extText,
43  std::string::const_iterator &pos, unsigned int startAtomIdx = 0,
44  unsigned int startBondIdx = 0);
45 inline void parseCXExtensions(RDKit::RWMol &mol, const std::string &extText,
46  unsigned int startAtomIdx,
47  unsigned int startBondIdx) {
48  auto iter = extText.begin();
49  parseCXExtensions(mol, extText, iter, startAtomIdx, startBondIdx);
50 };
51 //! removes formal charge, isotope, etc. Primarily useful for QueryAtoms
53 
54 //! returns whether or not the combination of tag and permutation provided are
55 //! legal
57  int permutation);
58 namespace detail {
59 constexpr auto _needsDetectBondStereo = "_needsDetectBondStereo";
60 constexpr auto _needsDetectAtomStereo = "_needsDetectAtomStereo";
61 } // namespace detail
62 } // namespace SmilesParseOps
63 
64 #endif
The class for representing atoms.
Definition: Atom.h:68
BondType
the type of Bond
Definition: Bond.h:56
@ UNSPECIFIED
Definition: Bond.h:57
BondDir
the bond's direction (for chirality)
Definition: Bond.h:83
@ NONE
no special style
Definition: Bond.h:84
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:32
#define RDKIT_SMILESPARSE_EXPORT
Definition: export.h:457
Std stuff.
Definition: Abbreviations.h:19
constexpr auto _needsDetectBondStereo
constexpr auto _needsDetectAtomStereo
RDKIT_SMILESPARSE_EXPORT void CheckChiralitySpecifications(RDKit::RWMol *mol, bool strict)
RDKIT_SMILESPARSE_EXPORT void CloseMolRings(RDKit::RWMol *mol, bool toleratePartials)
RDKIT_SMILESPARSE_EXPORT bool checkChiralPermutation(int chiralTag, int permutation)
RDKIT_SMILESPARSE_EXPORT void ClearAtomChemicalProps(RDKit::Atom *atom)
removes formal charge, isotope, etc. Primarily useful for QueryAtoms
RDKIT_SMILESPARSE_EXPORT void parseCXExtensions(RDKit::RWMol &mol, const std::string &extText, std::string::const_iterator &pos, unsigned int startAtomIdx=0, unsigned int startBondIdx=0)
RDKIT_SMILESPARSE_EXPORT void ReportParseError(const char *message, bool throwIt=true)
RDKIT_SMILESPARSE_EXPORT void SetUnspecifiedBondTypes(RDKit::RWMol *mol)
RDKIT_SMILESPARSE_EXPORT void AddFragToMol(RDKit::RWMol *mol, RDKit::RWMol *frag, RDKit::Bond::BondType bondOrder=RDKit::Bond::UNSPECIFIED, RDKit::Bond::BondDir bondDir=RDKit::Bond::NONE)
RDKIT_SMILESPARSE_EXPORT void CleanupAfterParseError(RDKit::RWMol *mol)
RDKIT_SMILESPARSE_EXPORT void AdjustAtomChiralityFlags(RDKit::RWMol *mol)
RDKIT_SMILESPARSE_EXPORT void CheckRingClosureBranchStatus(RDKit::Atom *atom, RDKit::RWMol *mp)
RDKIT_SMILESPARSE_EXPORT RDKit::Bond::BondType GetUnspecifiedBondType(const RDKit::RWMol *mol, const RDKit::Atom *atom1, const RDKit::Atom *atom2)
RDKIT_SMILESPARSE_EXPORT void CleanupAfterParsing(RDKit::RWMol *mol)