20 #include <unordered_map>
25 #include <boost/smart_ptr.hpp>
35 :
public std::runtime_error {
61 typedef std::array<RDGeom::Point3D, 3>
Bracket;
70 return aIdx == other.
aIdx && lvIdx == other.
lvIdx &&
id == other.
id;
81 return bondIdx == other.
bondIdx;
133 const std::vector<unsigned int> &
getAtoms()
const {
return d_atoms; }
135 const std::vector<unsigned int> &
getBonds()
const {
return d_bonds; }
137 const std::vector<Bracket> &
getBrackets()
const {
return d_brackets; }
138 const std::vector<CState> &
getCStates()
const {
return d_cstates; }
177 return dp_mol == other.dp_mol && d_atoms == other.d_atoms &&
178 d_patoms == other.d_patoms && d_bonds == other.d_bonds &&
179 d_saps == other.d_saps;
183 ROMol *dp_mol =
nullptr;
185 std::vector<unsigned int> d_atoms;
186 std::vector<unsigned int> d_patoms;
187 std::vector<unsigned int> d_bonds;
189 std::vector<Bracket> d_brackets;
190 std::vector<CState> d_cstates;
191 std::vector<AttachPoint> d_saps;
194 namespace SubstanceGroupChecks {
198 "SRU",
"MON",
"COP",
"CRO",
"GRA",
"MOD",
"MER",
"ANY",
202 "SUP",
"MUL",
"DAT",
"GEN"};
240 RWMol &mol,
unsigned int idx);
247 RWMol &mol,
unsigned int idx);
#define PRECONDITION(expr, mess)
RDKIT_GRAPHMOL_EXPORT std::ostream & operator<<(std::ostream &target, const RDKit::SubstanceGroup &sg)
allows SubstanceGroup objects to be dumped to streams
RWMol is a molecule class that is intended to be edited.
used to indicate errors from incorrect sgroup access
SubstanceGroupException(const std::string &msg)
construct with an error message
SubstanceGroupException(const char *msg)
construct with an error message
The class for representing SubstanceGroups.
const std::vector< Bracket > & getBrackets() const
void addBondWithIdx(unsigned int idx)
void setOwningMol(ROMol *mol)
void addAttachPoint(unsigned int aIdx, int lvIdx, const std::string &idStr)
const std::vector< unsigned int > & getAtoms() const
void addParentAtomWithBookmark(int mark)
const std::vector< unsigned int > & getParentAtoms() const
SubstanceGroup(SubstanceGroup &&other)=default
~SubstanceGroup()
Destructor.
const std::vector< unsigned int > & getBonds() const
bool adjustToRemovedBond(unsigned int bondIdx)
void addCState(unsigned int bondIdx, const RDGeom::Point3D &vector)
const std::vector< CState > & getCStates() const
SubstanceGroup()=delete
No default constructor.
bool adjustToRemovedAtom(unsigned int atomIdx)
bool operator==(const SubstanceGroup &other) const
BondType
Bond type (see V3000 spec)
SubstanceGroup(const SubstanceGroup &other)=default
const std::vector< AttachPoint > & getAttachPoints() const
ROMol & getOwningMol() const
Get the molecule that owns this instance.
SubstanceGroup & operator=(const SubstanceGroup &other)=default
void addBondWithBookmark(int mark)
void addAtomWithBookmark(int mark)
bool includesAtom(unsigned int atomIdx) const
SubstanceGroup(ROMol *owning_mol, const std::string &type)
void addParentAtomWithIdx(unsigned int idx)
void addAtomWithIdx(unsigned int idx)
SubstanceGroup & operator=(SubstanceGroup &&other)=default
std::array< RDGeom::Point3D, 3 > Bracket
void addBracket(const Bracket &bracket)
bool hasOwningMol() const
returns whether or not this belongs to a molecule
bool includesBond(unsigned int bondIdx) const
BondType getBondType(unsigned int bondIdx) const
unsigned int getIndexInMol() const
#define RDKIT_GRAPHMOL_EXPORT
RDKIT_GRAPHMOL_EXPORT bool isValidType(const std::string &type)
RDKIT_GRAPHMOL_EXPORT bool isValidSubType(const std::string &type)
const std::vector< std::string > sGroupConnectTypes
RDKIT_GRAPHMOL_EXPORT bool isSubstanceGroupIdFree(const ROMol &mol, unsigned int id)
RDKIT_GRAPHMOL_EXPORT bool isValidConnectType(const std::string &type)
const std::vector< std::string > sGroupSubtypes
const std::vector< std::string > sGroupTypes
RDKIT_GRAPHMOL_EXPORT unsigned int addSubstanceGroup(ROMol &mol, SubstanceGroup sgroup)
RDKIT_GRAPHMOL_EXPORT void removeSubstanceGroupsReferencingBond(RWMol &mol, unsigned int idx)
Removes SubstanceGroups which reference a particular bond index.
RDKIT_GRAPHMOL_EXPORT std::vector< SubstanceGroup > & getSubstanceGroups(ROMol &mol)
RDKIT_GRAPHMOL_EXPORT void removeSubstanceGroupsReferencingAtom(RWMol &mol, unsigned int idx)
Removes SubstanceGroups which reference a particular atom index.
bool operator==(const AttachPoint &other) const
bool operator==(const CState &other) const