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
The base class for decorators.
#define IMP_DECORATOR_GET_SET(name, AttributeKey, Type, ReturnType)
Define methods for getting and setting a particular simple field.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
double get_mass(ResidueType c)
Get the mass from the residue type.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
Model * get_model() const
Returns the Model containing the particle.
Storage of a model, its restraints, constraints and particles.
char get_one_letter_code(ResidueType c)
Get the 1-letter amino acid code from the residue type.
Class for storing model, its restraints, constraints, and particles.
Decorator for helping deal with a hierarchy of molecules.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
static Hierarchy setup_particle(Model *m, ParticleIndex pi, ParticleIndexesAdaptor children=ParticleIndexesAdaptor())
Create a Hierarchy of level t by adding the needed attributes.
Int get_index() const
The residues index in the chain.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
The standard decorator for manipulating molecular structures.
const ResidueType UNK
Unknown residue.
Hierarchy get_previous_residue(Residue rd)
Return the residue from the same chain with one lower index.
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
void set_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Various important macros for implementing decorators.
A decorator for a residue.
static bool get_is_setup(Model *m, ParticleIndex p)
Check if the particle has the needed attributes for a cast to succeed.
#define IMP_DECORATOR_METHODS(Name, Parent)
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
int Int
Basic integer value.
#define IMP_DECORATOR_SETUP_3(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name,ThirdArgumentType, third_argument_name)
void set_residue_type(ResidueType t)
Update the stored ResidueType and the atom::Hierarchy::Name.
Hierarchy get_next_residue(Residue rd)
Return the residue from the same chain with one higher index.
ResidueType get_residue_type(char c)
Get the residue type from the 1-letter amino acid code.