Loading...
Searching...
No Matches
residue.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_KERNEL_RESIDUE_H
#define BALL_KERNEL_RESIDUE_H
#ifndef BALL_KERNEL_FRAGMENT_H
# include <BALL/KERNEL/fragment.h>
#endif
#ifndef BALL_KERNEL_PDBATOMITERATOR_H
# include <BALL/KERNEL/PDBAtomIterator.h>
#endif
#ifndef BALL_KERNEL_RESIDUEITERATOR_H
# include <BALL/KERNEL/residueIterator.h>
#endif
#define BALL_RESIDUE_DEFAULT_ID ""
#define BALL_RESIDUE_DEFAULT_INSERTION_CODE ' '
namespace BALL
{
class Chain;
class Protein;
class SecondaryStructure;
class BALL_EXPORT Residue
: public Fragment
{
public:
BALL_CREATE_DEEP(Residue)
enum Property
{
PROPERTY__NON_STANDARD = Fragment::NUMBER_OF_PROPERTIES + 1,
PROPERTY__AMINO_ACID,
PROPERTY__WATER,
PROPERTY__HAS_SSBOND,
PROPERTY__C_TERMINAL,
PROPERTY__N_TERMINAL,
PROPERTY__CYCLIC,
NUMBER_OF_PROPERTIES
};
enum FullNameType
{
NO_VARIANT_EXTENSIONS,
ADD_VARIANT_EXTENSIONS,
// Add the residue ID separated by a colon
ADD_RESIDUE_ID,
// Add the residue ID and the residue extension
ADD_VARIANT_EXTENSIONS_AND_ID
};
Residue();
Residue(const Residue& residue, bool deep = true);
Residue
(const String& name,
const String& id = BALL_RESIDUE_DEFAULT_ID,
char insertion_code = BALL_RESIDUE_DEFAULT_INSERTION_CODE);
virtual ~Residue();
virtual void clear();
virtual void destroy();
void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
void persistentRead(PersistenceManager& pm);
void set(const Residue& residue, bool deep = true);
Residue& operator = (const Residue& residue);
void get(Residue& residue, bool deep = true) const;
void swap(Residue& residue);
bool operator == (const Residue& residue) const;
bool operator != (const Residue& residue) const;
String getFullName(FullNameType type = ADD_VARIANT_EXTENSIONS) const;
bool hasTorsionPhi() const;
Angle getTorsionPhi() const;
bool hasTorsionPsi() const;
Angle getTorsionPsi() const;
bool hasTorsionOmega() const;
Angle getTorsionOmega() const;
Protein* getProtein();
const Protein* getProtein() const;
Chain* getChain();
const Chain* getChain() const;
SecondaryStructure* getSecondaryStructure();
const SecondaryStructure* getSecondaryStructure() const;
PDBAtom* getPDBAtom(Position position);
const PDBAtom* getPDBAtom(Position position) const;
void setID(const String& id);
const String& getID() const;
void setInsertionCode(char insertion_code);
void unsetInsertionCode();
char getInsertionCode() const;
Size countPDBAtoms() const;
void prepend(PDBAtom& atom);
void append(PDBAtom& atom);
void insert(PDBAtom& atom);
void insertBefore(PDBAtom& atom, Composite& before);
void insertAfter(PDBAtom& atom, Composite& after);
bool remove(PDBAtom& atom);
void spliceBefore(Residue& residue);
void spliceAfter(Residue& residue);
void splice(Residue& residue);
bool isAminoAcid() const;
bool isTerminal() const;
bool isNTerminal() const;
bool isCTerminal() const;
virtual bool isResidue() const { return true; }
virtual bool isValid() const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
// --- EXTERNAL ITERATORS
BALL_KERNEL_DEFINE_ITERATOR_CREATORS(PDBAtom)
BALL_DECLARE_STD_ITERATOR_WRAPPER(Residue, PDBAtom, pdbAtoms)
private:
AtomContainer* getAtomContainer(Position position);
const AtomContainer* getAtomContainer(Position position) const;
Size countAtomContainers() const;
void prepend(AtomContainer& atom_container);
void append(AtomContainer& atom_container);
void insert(AtomContainer& atom_container);
void insertBefore(AtomContainer& atom_container, Composite& composite);
void insertAfter(AtomContainer& atom_container, Composite& composite);
void spliceBefore(AtomContainer& atom_container);
void spliceAfter(AtomContainer& base_ragment);
void splice(AtomContainer& AtomContainer);
bool remove(AtomContainer& AtomContainer);
bool isSuperAtomContainerOf(const AtomContainer& atom_container) const;
BALL_KERNEL_DEFINE_ITERATOR_CREATORS(AtomContainer)
BALL_DECLARE_STD_ITERATOR_WRAPPER(Residue, AtomContainer, atomContainers)
// --- ATTRIBUTES
String id_;
char insertion_code_;
};
template <class ResidueContainerType>
const Residue* getNTerminal(const ResidueContainerType& residue_container)
{
ResidueConstIterator res_it(residue_container.beginResidue());
for (; res_it != residue_container.endResidue(); ++res_it)
{
if (res_it->isAminoAcid() == true)
{
return &(*res_it);
}
}
return 0;
}
template <class ResidueContainerType>
const Residue* getCTerminal(const ResidueContainerType& residue_container)
{
ResidueConstReverseIterator res_it(residue_container.rbeginResidue());
for (; res_it != residue_container.rendResidue(); ++res_it)
{
// Look for the last residue marked as amino acid
if (res_it->isAminoAcid() == true)
{
return &(*res_it);
}
}
return 0;
}
} // namespace BALL
#endif // BALL_KERNEL_RESIDUE_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
PDBAtomIterator.h
BALL::AtomContainer
Definition atomContainer.h:32
BALL::Chain
Definition chain.h:32
BALL::Composite
Definition composite.h:74
BALL::Fragment::Fragment
Fragment()
BALL::Fragment::NUMBER_OF_PROPERTIES
@ NUMBER_OF_PROPERTIES
Definition fragment.h:35
BALL::PDBAtom
Definition PDBAtom.h:40
BALL::PersistenceManager
Definition persistenceManager.h:73
BALL::Protein
Definition protein.h:30
BALL::Residue
Definition residue.h:38
BALL::Residue::Residue
Residue(const Residue &residue, bool deep=true)
Copy constructor.
BALL::Residue::unsetInsertionCode
void unsetInsertionCode()
BALL::Residue::swap
void swap(Residue &residue)
BALL::Residue::isCTerminal
bool isCTerminal() const
BALL::Residue::isAminoAcid
bool isAminoAcid() const
BALL::Residue::getTorsionPhi
Angle getTorsionPhi() const
BALL::Residue::getTorsionPsi
Angle getTorsionPsi() const
BALL::Residue::getID
const String & getID() const
BALL::Residue::destroy
virtual void destroy()
Clears the contents of this instance and removes it from all composite structures.
BALL::Residue::getChain
const Chain * getChain() const
BALL::Residue::getSecondaryStructure
SecondaryStructure * getSecondaryStructure()
BALL::Residue::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::Residue::persistentWrite
void persistentWrite(PersistenceManager &pm, const char *name=0) const
BALL::Residue::set
void set(const Residue &residue, bool deep=true)
BALL::Residue::getPDBAtom
const PDBAtom * getPDBAtom(Position position) const
BALL::Residue::insertAfter
void insertAfter(PDBAtom &atom, Composite &after)
BALL::Residue::isNTerminal
bool isNTerminal() const
BALL::Residue::persistentRead
void persistentRead(PersistenceManager &pm)
BALL::Residue::getProtein
Protein * getProtein()
BALL::Residue::insert
void insert(PDBAtom &atom)
BALL::Residue::remove
bool remove(PDBAtom &atom)
BALL::Residue::get
void get(Residue &residue, bool deep=true) const
BALL::Residue::getTorsionOmega
Angle getTorsionOmega() const
BALL::Residue::setInsertionCode
void setInsertionCode(char insertion_code)
BALL::Residue::~Residue
virtual ~Residue()
Destructor.
BALL::Residue::countPDBAtoms
Size countPDBAtoms() const
BALL::Residue::getPDBAtom
PDBAtom * getPDBAtom(Position position)
BALL::Residue::getInsertionCode
char getInsertionCode() const
BALL::Residue::isResidue
virtual bool isResidue() const
Definition residue.h:389
BALL::Residue::isTerminal
bool isTerminal() const
BALL::Residue::getFullName
String getFullName(FullNameType type=ADD_VARIANT_EXTENSIONS) const
BALL::Residue::clear
virtual void clear()
Clears the contents of this instance.
BALL::Residue::Residue
Residue()
Default constructor.
BALL::Residue::getChain
Chain * getChain()
BALL::Residue::isValid
virtual bool isValid() const
BALL::Residue::insertBefore
void insertBefore(PDBAtom &atom, Composite &before)
BALL::Residue::hasTorsionPhi
bool hasTorsionPhi() const
BALL::Residue::spliceBefore
void spliceBefore(Residue &residue)
BALL::Residue::hasTorsionOmega
bool hasTorsionOmega() const
BALL::Residue::getSecondaryStructure
const SecondaryStructure * getSecondaryStructure() const
BALL::Residue::spliceAfter
void spliceAfter(Residue &residue)
BALL::Residue::Residue
Residue(const String &name, const String &id=BALL_RESIDUE_DEFAULT_ID, char insertion_code=BALL_RESIDUE_DEFAULT_INSERTION_CODE)
Detailled constructor.
BALL::Residue::FullNameType
FullNameType
Definition residue.h:77
BALL::Residue::ADD_VARIANT_EXTENSIONS_AND_ID
@ ADD_VARIANT_EXTENSIONS_AND_ID
Definition residue.h:85
BALL::Residue::ADD_VARIANT_EXTENSIONS
@ ADD_VARIANT_EXTENSIONS
Add the residue variant extensions (e.g. '-C' for C-terminal residues).
Definition residue.h:81
BALL::Residue::NO_VARIANT_EXTENSIONS
@ NO_VARIANT_EXTENSIONS
This returns the unmodified residue name only.
Definition residue.h:79
BALL::Residue::ADD_RESIDUE_ID
@ ADD_RESIDUE_ID
Definition residue.h:83
BALL::Residue::splice
void splice(Residue &residue)
BALL::Residue::setID
void setID(const String &id)
BALL::Residue::Property
Property
Definition residue.h:49
BALL::Residue::PROPERTY__HAS_SSBOND
@ PROPERTY__HAS_SSBOND
Definition residue.h:57
BALL::Residue::PROPERTY__WATER
@ PROPERTY__WATER
Definition residue.h:55
BALL::Residue::PROPERTY__N_TERMINAL
@ PROPERTY__N_TERMINAL
Definition residue.h:61
BALL::Residue::PROPERTY__NON_STANDARD
@ PROPERTY__NON_STANDARD
Definition residue.h:51
BALL::Residue::NUMBER_OF_PROPERTIES
@ NUMBER_OF_PROPERTIES
Definition residue.h:70
BALL::Residue::PROPERTY__CYCLIC
@ PROPERTY__CYCLIC
Definition residue.h:67
BALL::Residue::PROPERTY__C_TERMINAL
@ PROPERTY__C_TERMINAL
Definition residue.h:59
BALL::Residue::PROPERTY__AMINO_ACID
@ PROPERTY__AMINO_ACID
Definition residue.h:53
BALL::Residue::hasTorsionPsi
bool hasTorsionPsi() const
BALL::Residue::prepend
void prepend(PDBAtom &atom)
BALL::Residue::getProtein
const Protein * getProtein() const
BALL::Residue::append
void append(PDBAtom &atom)
BALL::SecondaryStructure
Definition secondaryStructure.h:31
BALL::String
Definition string.h:57
fragment.h
BALL_CREATE_DEEP
#define BALL_CREATE_DEEP(name)
Definition create.h:26
BALL_KERNEL_DEFINE_ITERATOR_CREATORS
#define BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Type)
Definition iterator.h:25
BALL
Definition constants.h:13
BALL::atomContainers
BALL_EXPORT AtomContainerList atomContainers(const AtomContainer &fragment, bool selected_only=false)
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::getCTerminal
const Residue * getCTerminal(const ResidueContainerType &residue_container)
Definition residue.h:472
BALL::ResidueConstReverseIterator
std::reverse_iterator< ResidueConstIterator > ResidueConstReverseIterator
Definition residueIterator.h:73
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::getNTerminal
const Residue * getNTerminal(const ResidueContainerType &residue_container)
Definition residue.h:457
BALL::Angle
TAngle< float > Angle
Definition angle.h:697
BALL::ResidueConstIterator
ConstBidirectionalIterator< Composite, Residue, Composite::CompositeIterator, ResidueIteratorTraits > ResidueConstIterator
Definition residueIterator.h:67
residueIterator.h
BALL_RESIDUE_DEFAULT_INSERTION_CODE
#define BALL_RESIDUE_DEFAULT_INSERTION_CODE
Definition residue.h:22
BALL_RESIDUE_DEFAULT_ID
#define BALL_RESIDUE_DEFAULT_ID
Definition residue.h:21
BALL_DECLARE_STD_ITERATOR_WRAPPER
#define BALL_DECLARE_STD_ITERATOR_WRAPPER(container, type, method_name)
Definition stdIteratorWrapper.h:30