8 #ifndef IMPATOM_RESIDUE_H
9 #define IMPATOM_RESIDUE_H
11 #include <IMP/atom/atom_config.h>
21 IMPATOM_BEGIN_NAMESPACE
26 typedef Key<IMP_RESIDUE_TYPE_INDEX, true> ResidueType;
137 int insertion_code = 32) {
140 m->
add_attribute(get_insertion_code_key(), pi, insertion_code);
142 if (!Hierarchy::get_is_setup(m, pi)) {
150 do_setup_particle(m, pi, o.get_residue_type(), o.
get_index(),
151 o.get_insertion_code());
164 return m->get_has_attribute(get_residue_type_key(), pi) &&
165 m->get_has_attribute(get_index_key(), pi) &&
166 m->get_has_attribute(get_insertion_code_key(), pi) &&
176 void set_residue_type(ResidueType t);
178 bool get_is_protein()
const {
182 bool get_is_dna()
const {
187 bool get_is_rna()
const {
195 char get_insertion_code()
const {
196 return char(
get_model()->get_attribute(get_insertion_code_key(),
200 void set_insertion_code(
char insertion_code) {
205 static IntKey get_index_key();
207 static IntKey get_residue_type_key();
209 static IntKey get_insertion_code_key();
244 IMPATOMEXPORT
double get_mass(ResidueType c);
247 IMPATOM_END_NAMESPACE
Import IMP/kernel/Decorator.h in the namespace.
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Import IMP/kernel/base_types.h in the namespace.
double get_mass(ResidueType c)
Get the mass from the residue type.
#define IMP_DECORATOR_METHODS(Name, Parent)
Model * get_model() const
Returns the Model containing the particle.
static bool get_is_setup(kernel::Model *m, kernel::ParticleIndex p)
char get_one_letter_code(ResidueType c)
Get the 1-letter amino acid code from the residue type.
Decorator for helping deal with a hierarchy of molecules.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Int get_index() const
The residues index in the chain.
The standard decorator for manipulating molecular structures.
static Hierarchy setup_particle(kernel::Model *m, kernel::ParticleIndex pi, kernel::ParticleIndexesAdaptor children=kernel::ParticleIndexesAdaptor())
const ResidueType UNK
Unknown residue.
Hierarchy get_previous_residue(Residue rd)
Return the residue from the same chain with one lower index.
void set_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Storage of a model, its restraints, constraints and particles.
Classes to handle individual model particles. (Note that implementation of inline functions in in int...
Various important macros for implementing decorators.
A decorator for a residue.
#define IMP_DECORATOR_SETUP_3(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name,ThirdArgumentType, third_argument_name)
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
int Int
Basic integer value.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
void set_residue_type(ResidueType t)
Update the stored ResidueType and the atom::Hierarchy::Name.
#define IMP_DECORATOR_GET_SET(name, AttributeKey, Type, ReturnType)
Define methods for getting and setting a particular simple field.
Hierarchy get_next_residue(Residue rd)
Return the residue from the same chain with one higher index.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
ResidueType get_residue_type(char c)
Get the residue type from the 1-letter amino acid code.
Class for storing model, its restraints, constraints, and particles.