Residue¶
-
class Residue¶
A
Residueis a group of atoms belonging to the same logical unit. They can be molecules, amino-acids in a protein, monomers in polymers, etc.Iterating over a
Residuegives the indexes of the atoms in the associatedTopology.Public Functions
-
explicit Residue(std::string name)¶
Create a new residue with a given
nameand no residue id.
-
Residue(std::string name, int64_t resid)¶
Create a new residue with a given
nameand residue idresid.
-
inline const std::string &name() const¶
Get the name of the residue.
-
inline size_t size() const¶
Get the size of the residue, i.e. the number of atoms in this residue.
-
void add_atom(size_t i)¶
Add an atom with index
ito this residueIf the atom is already in the residue, this does nothing.
-
bool contains(size_t i) const¶
Check if the residue contains a given atom with index
i
-
inline const property_map &properties() const¶
Get the map of properties asociated with this residue. This map might be iterated over to list the properties of the residue, or directly accessed.
-
inline void set(std::string name, Property value)¶
Set an arbitrary
Propertyfor this residue with the givennameandvalue. If a property with this name already exist, it is replaced with the new value.
-
inline optional<const Property&> get(const std::string &name) const¶
Get the
Propertywith the givennamefor this residue if it exists.If no property with the given
nameis found, this function returnsnullopt.
-
template<Property::Kind kind>
inline optional<typename property_metadata<kind>::type> get(const std::string &name) const¶ Get the
Propertywith the givennamefor this residue if it exists, and check that it has the requiredkind.If no property with the given
nameis found, this function returnsnullopt.If a property with the given
nameis found, but has a different kind, this function emits a warning and returnsnullopt.
-
explicit Residue(std::string name)¶