11#ifndef RD_MACROMOLTEMPLATE_H
12#define RD_MACROMOLTEMPLATE_H
65 const std::string &
getName()
const {
return d_name; }
67 const std::string &
getSymbol()
const {
return d_symbol; }
74 return d_mainAtomIdxs;
78 return d_leavingGroups;
87 std::string name, std::string
symbol,
88 std::string originalData, std::string subclass,
89 std::vector<unsigned int> mainAtomIdxs,
90 std::vector<MacroMolLeavingGroup> leavingGroups,
91 unsigned int mainSgroupIdx)
92 : d_mol(std::move(mol)),
93 d_monomerClass(monomerClass),
94 d_name(std::move(name)),
95 d_symbol(std::move(
symbol)),
96 d_originalData(std::move(originalData)),
97 d_subclass(std::move(subclass)),
98 d_mainAtomIdxs(std::move(mainAtomIdxs)),
99 d_leavingGroups(std::move(leavingGroups)),
100 d_mainSgroupIdx(mainSgroupIdx) {}
105 std::string d_symbol;
106 std::string d_originalData;
107 std::string d_subclass;
108 std::vector<unsigned int> d_mainAtomIdxs;
109 std::vector<MacroMolLeavingGroup> d_leavingGroups;
110 unsigned int d_mainSgroupIdx;
123 std::string name, std::string
symbol,
124 std::string originalData)
126 d_monomerClass(monomerClass),
127 d_name(std::move(name)),
128 d_symbol(std::move(
symbol)),
129 d_originalData(std::move(originalData)) {}
146 std::unique_ptr<MacroMolTemplate>
build()
const;
152 std::string d_symbol;
153 std::string d_originalData;
154 std::string d_subclass;
155 std::vector<unsigned int> d_mainAtomIdxs;
156 std::vector<MacroMolLeavingGroup> d_leavingGroups;
157 bool d_mainGroupSet =
false;
174 MonomerClass monomerClass, const std::
string &name) const;
180 using MacroMolTemplateKey = std::pair<
MonomerClass, std::
string>;
182 std::map<MacroMolTemplateKey, std::unique_ptr<const
MacroMolTemplate>> byName;
Defines atom-level macro atom information.
Defines the editable molecule class RWMol.
Defines the SubstanceGroup class.
Collects and validates the pieces needed to create a MacroMolTemplate.
MacroMolTemplateBuilder(const ROMol &mol, MonomerClass monomerClass, std::string name, std::string symbol, std::string originalData)
RWMol & getMol()
Returns the mutable molecule being prepared for the template.
MacroMolTemplateBuilder & setMainGroup(std::vector< unsigned int > &&atomIdxs)
Defines the atoms retained as the main monomer group.
MacroMolTemplateBuilder & setSubclass(std::string subclass)
Sets the optional SCSR subclass.
std::unique_ptr< MacroMolTemplate > build() const
Validates the complete definition and returns an immutable template.
MacroMolTemplateBuilder & addLeavingGroup(MacroMolLeavingGroup &&leavingGroup)
Adds a leaving group and its attachment-point definition.
void addTemplate(std::unique_ptr< MacroMolTemplate > macroMolTemplate)
Adds a completed template and takes ownership of it.
const MacroMolTemplate * getByName(MonomerClass monomerClass, const std::string &name) const
Returns a matching template, or nullptr if none has been added.
MacroMolTemplateLibrary()=default
MacroMolTemplateLibrary(MacroMolTemplateLibrary &&) noexcept=default
const MacroMolTemplate * getBySymbol(MonomerClass monomerClass, const std::string &symbol) const
Returns a matching template, or nullptr if none has been added.
MacroMolTemplateLibrary(const MacroMolTemplateLibrary &other)
const std::vector< MacroMolLeavingGroup > & getLeavingGroups() const
Returns the typed leaving-group definitions.
const std::vector< unsigned int > & getMainAtomIdxs() const
Returns the atom indices belonging to the retained monomer group.
MacroMolTemplate(MacroMolTemplate &&) noexcept=default
const std::string & getOriginalData() const
Returns the original template definition (SMILES, SDF, etc.).
const std::string & getName() const
Returns the name, e.g. "ALA".
MonomerClass getMonomerClass() const
Returns the monomer class used for lookup and the main SGroup CLASS.
const SubstanceGroup & getMainSgroup() const
Returns the main SUP SGroup mirrored onto the owned molecule.
const std::string & getSubclass() const
Returns the SCSR subclass, or an empty string if unspecified.
MacroMolTemplate(const MacroMolTemplate &)=default
friend class MacroMolTemplateBuilder
const ROMol & getMol() const
Returns a read-only view of the underlying template molecule.
const std::string & getSymbol() const
Returns the template symbol, e.g. "A" for alanine.
RWMol is a molecule class that is intended to be edited.
The class for representing SubstanceGroups.
#define RDKIT_GRAPHMOL_EXPORT
static const char * symbol[119]
MonomerClass
Format-neutral classes of monomer that a macro atom can represent.
Describes the atoms removed at one MacroMol template attachment point.
unsigned int leavingAtomIdx
MacroMolLeavingGroup(std::vector< unsigned int > atomIdxs, unsigned int attachAtomIdx, unsigned int leavingAtomIdx, int attachPoint)
std::vector< unsigned int > atomIdxs
unsigned int attachAtomIdx