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> ResidueType;
140 int insertion_code = 32) {
143 m->
add_attribute(get_insertion_code_key(), pi, insertion_code);
145 if (!Hierarchy::get_is_setup(m, pi)) {
153 do_setup_particle(m, pi, o.get_residue_type(), o.
get_index(),
154 o.get_insertion_code());
179 void set_residue_type(ResidueType t);
181 bool get_is_protein()
const {
185 bool get_is_dna()
const {
190 bool get_is_rna()
const {
198 char get_insertion_code()
const {
199 return char(
get_model()->get_attribute(get_insertion_code_key(),
203 void set_insertion_code(
char insertion_code) {
208 static IntKey get_index_key();
210 static IntKey get_residue_type_key();
212 static IntKey get_insertion_code_key();
247 IMPATOMEXPORT
double get_mass(ResidueType c);
250 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.
A more IMP-like version of the std::vector.
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)
add particle atribute with the specied key and initial 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)
set the value of particle attribute with the specified key
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.
bool get_has_attribute(TypeKey attribute_key, ParticleIndex particle) const
return true if particle has attribute with the specified key
#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.