 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
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;
129 const std::vector<unsigned int> &
getAtoms()
const {
return d_atoms; }
131 const std::vector<unsigned int> &
getBonds()
const {
return d_bonds; }
133 const std::vector<Bracket> &
getBrackets()
const {
return d_brackets; }
134 const std::vector<CState> &
getCStates()
const {
return d_cstates; }
169 return dp_mol == other.dp_mol && d_atoms == other.d_atoms &&
170 d_patoms == other.d_patoms && d_bonds == other.d_bonds &&
171 d_saps == other.d_saps;
175 ROMol *dp_mol =
nullptr;
177 std::vector<unsigned int> d_atoms;
178 std::vector<unsigned int> d_patoms;
179 std::vector<unsigned int> d_bonds;
181 std::vector<Bracket> d_brackets;
182 std::vector<CState> d_cstates;
183 std::vector<AttachPoint> d_saps;
186 namespace SubstanceGroupChecks {
190 "SRU",
"MON",
"COP",
"CRO",
"GRA",
"MOD",
"MER",
"ANY",
194 "SUP",
"MUL",
"DAT",
"GEN"};
232 RWMol &mol,
unsigned int idx);
239 RWMol &mol,
unsigned int idx);
SubstanceGroupException(const char *msg)
construct with an error message
void addAtomWithIdx(unsigned int idx)
used to indicate errors from incorrect sgroup access
void addAtomWithBookmark(int mark)
void addBondWithIdx(unsigned int idx)
RDKIT_GRAPHMOL_EXPORT void removeSubstanceGroupsReferencingAtom(RWMol &mol, unsigned int idx)
Removes SubstanceGroups which reference a particular atom index.
const std::vector< unsigned int > & getBonds() const
RDKIT_GRAPHMOL_EXPORT bool isValidSubType(const std::string &type)
const std::vector< unsigned int > & getParentAtoms() const
RDKIT_GRAPHMOL_EXPORT unsigned int addSubstanceGroup(ROMol &mol, SubstanceGroup sgroup)
bool hasOwningMol() const
returns whether or not this belongs to a molecule
The class for representing SubstanceGroups.
RWMol is a molecule class that is intended to be edited.
const std::vector< CState > & getCStates() const
const std::vector< std::string > sGroupSubtypes
bool operator==(const AttachPoint &other) const
RDKIT_GRAPHMOL_EXPORT bool isValidConnectType(const std::string &type)
BondType
Bond type (see V3000 spec)
void setOwningMol(ROMol *mol)
RDKIT_GRAPHMOL_EXPORT std::ostream & operator<<(std::ostream &target, const RDKit::SubstanceGroup &sg)
allows SubstanceGroup objects to be dumped to streams
bool adjustToRemovedAtom(unsigned int atomIdx)
RDKIT_GRAPHMOL_EXPORT bool isValidType(const std::string &type)
const std::vector< unsigned int > & getAtoms() const
const std::vector< Bracket > & getBrackets() const
bool operator==(const SubstanceGroup &other) const
SubstanceGroup()=delete
No default constructor.
void addBondWithBookmark(int mark)
void addParentAtomWithBookmark(int mark)
bool adjustToRemovedBond(unsigned int bondIdx)
#define RDKIT_GRAPHMOL_EXPORT
SubstanceGroup & operator=(const SubstanceGroup &other)=default
bool includesAtom(unsigned int atomIdx) const
unsigned int getIndexInMol() const
~SubstanceGroup()
Destructor.
bool operator==(const CState &other) const
void addAttachPoint(unsigned int aIdx, int lvIdx, const std::string &idStr)
const std::vector< std::string > sGroupTypes
void addCState(unsigned int bondIdx, const RDGeom::Point3D &vector)
const std::vector< std::string > sGroupConnectTypes
RDKIT_GRAPHMOL_EXPORT bool isSubstanceGroupIdFree(const ROMol &mol, unsigned int id)
BondType getBondType(unsigned int bondIdx) const
SubstanceGroup(const SubstanceGroup &other)=default
std::array< RDGeom::Point3D, 3 > Bracket
ROMol & getOwningMol() const
Get the molecule that owns this instance.
#define PRECONDITION(expr, mess)
SubstanceGroup(ROMol *owning_mol, const std::string &type)
void addParentAtomWithIdx(unsigned int idx)
void addBracket(const Bracket &bracket)
SubstanceGroupException(const std::string &msg)
construct with an error message
RDKIT_GRAPHMOL_EXPORT void removeSubstanceGroupsReferencingBond(RWMol &mol, unsigned int idx)
Removes SubstanceGroups which reference a particular bond index.
SubstanceGroup(SubstanceGroup &&other)=default
RDKIT_GRAPHMOL_EXPORT std::vector< SubstanceGroup > & getSubstanceGroups(ROMol &mol)
const std::vector< AttachPoint > & getAttachPoints() const
SubstanceGroup & operator=(SubstanceGroup &&other)=default
bool includesBond(unsigned int bondIdx) const