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;
136 int insertion_code = 32) {
139 m->
add_attribute(get_insertion_code_key(), pi, insertion_code);
141 if (!Hierarchy::get_is_setup(m, pi)) {
149 do_setup_particle(m, pi, o.get_residue_type(), o.
get_index(),
150 o.get_insertion_code());
163 return m->get_has_attribute(get_residue_type_key(), pi) &&
164 m->get_has_attribute(get_index_key(), pi) &&
165 m->get_has_attribute(get_insertion_code_key(), pi) &&
171 get_particle_index()));
175 void set_residue_type(ResidueType t);
177 bool get_is_protein()
const {
178 return get_residue_type().get_index() < ADE.get_index();
181 bool get_is_dna()
const {
182 return get_residue_type().get_index() >= DADE.get_index() &&
183 get_residue_type().get_index() <= DTHY.get_index();
186 bool get_is_rna()
const {
187 return get_residue_type().get_index() >= ADE.get_index() &&
188 get_residue_type().get_index() < DADE.get_index();
194 char get_insertion_code()
const {
195 return char(
get_model()->get_attribute(get_insertion_code_key(),
196 get_particle_index()));
199 void set_insertion_code(
char insertion_code) {
201 get_particle_index(), insertion_code);
204 static IntKey get_index_key();
206 static IntKey get_residue_type_key();
208 static IntKey get_insertion_code_key();
240 IMPATOMEXPORT ResidueType get_residue_type(
char c);
246 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)
Import IMP/kernel/base_types.h in the namespace.
#define IMP_DECORATOR_METHODS(Name, Parent)
Model * get_model() const
Returns the Model containing the particle.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
static bool get_is_setup(kernel::Model *m, kernel::ParticleIndex p)
char get_one_letter_code(ResidueType c)
Decorator for helping deal with a hierarchy of molecules.
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())
Hierarchy get_previous_residue(Residue rd)
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.
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)
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
Class for storing model, its restraints, constraints, and particles.