BALL  1.5.0
chain.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_KERNEL_CHAIN_H
6 #define BALL_KERNEL_CHAIN_H
7 
8 #ifndef BALL_KERNEL_RESIDUE_H
9 # include <BALL/KERNEL/residue.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_SECONDARYSTRUCTUREITERATOR_H
14 #endif
15 
16 
17 #define BALL_CHAIN_DEFAULT_NAME ' '
18 
19 namespace BALL
20 {
21  class Protein;
22 
31  : public AtomContainer
32  {
33  public:
34 
36 
37 
40 
43  enum Property
44  {
45  NUMBER_OF_PROPERTIES = AtomContainer::NUMBER_OF_PROPERTIES
46  };
47 
49 
52 
54  Chain();
55 
57  Chain(const Chain& chain, bool deep = true);
58 
60  Chain(const String& name);
61 
63  virtual ~Chain();
64 
66 
69 
73  void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
74 
79 
81 
84 
90  void set(const Chain& chain, bool deep = true);
91 
98  Chain& operator = (const Chain& chain);
99 
105  void get(Chain& chain, bool deep = true) const;
106 
110  void swap(Chain& chain);
111 
113 
118  bool operator == (const Chain& chain) const;
119 
123  bool operator != (const Chain& chain) const;
124 
125 
129 
135 
140  const Protein* getProtein() const;
141 
149 
157 
164 
170  const Residue* getResidue(Position position) const;
171 
178 
184  const Residue* getNTerminal() const;
185 
192 
198  const Residue* getCTerminal() const;
199 
206 
212  const PDBAtom* getPDBAtom(Position position) const;
213 
218 
223 
228 
232  void prepend(SecondaryStructure& secondary_structure);
233 
237  void append(SecondaryStructure& secondary_structure);
238 
242  void insert(SecondaryStructure& secondary_structure);
243 
248  void insertBefore(SecondaryStructure& secondary_structure, Composite& before);
249 
254  void insertAfter(SecondaryStructure& secondary_structure, Composite& after);
255 
259  bool remove(SecondaryStructure& secondary_structure);
260 
264  void prepend(Residue& residue);
265 
269  void append(Residue& residue);
270 
274  void insert(Residue& residue);
275 
280  void insertBefore(Residue& residue, Composite& before);
281 
286  void insertAfter(Residue& residue, Composite& after);
287 
291  bool remove(Residue& residue);
292 
296  void spliceBefore(Chain& chain);
297 
301  void spliceAfter(Chain &chain);
302 
306  void splice(Chain &chain);
307 
309 
312  virtual bool isChain() const { return true; }
315 
319 
326  virtual void dump(std::ostream& s = std::cout, Size depth = 0) const
327 ;
328 
330 
331  // --- EXTERNAL ITERATORS
332 
336 
340 
341  protected:
342 
343  private:
344  AtomContainer* getAtomContainer(Position position);
345 
346  const AtomContainer* getAtomContainer(Position position) const;
347 
348  Atom* getAtom(Position position);
349 
350  const Atom* getAtom(Position position) const;
351 
352  void prepend(Atom& atom);
353 
354  void append(Atom& atom);
355 
356  void insert(Atom& atom);
357 
358  void insertBefore(Atom& atom, Composite& before);
359 
360  void insertAfter(Atom& atom, Composite& after);
361 
362  bool remove(Atom& atom);
363 
364  void prepend(AtomContainer& atom_container);
365 
366  void append(AtomContainer& atom_container);
367 
368  void insert(AtomContainer& atom_container);
369 
370  void insertBefore(AtomContainer& atom_container, Composite& before);
371 
372  void insertAfter(AtomContainer& atom_container, Composite& after);
373 
374  void spliceBefore(AtomContainer& atom_container);
375 
376  void spliceAfter(AtomContainer& atom_container);
377 
378  void splice(AtomContainer& atom_container);
379 
380  bool remove(AtomContainer& atom_container);
381 
384  };
385 } // namespace BALL
386 
387 #endif // BALL_KERNEL_CHAIN_H
BALL::Chain::getResidue
Residue * getResidue(Position position)
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::Chain::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::Chain
Definition: chain.h:32
BALL::Chain::set
void set(const Chain &chain, bool deep=true)
BALL::Chain::getCTerminal
const Residue * getCTerminal() const
BALL::operator!=
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
BALL::Chain::getSecondaryStructure
SecondaryStructure * getSecondaryStructure(Position position)
BALL::Chain::persistentRead
void persistentRead(PersistenceManager &pm)
BALL::AtomContainer
Definition: atomContainer.h:32
BALL::Chain::Chain
Chain(const Chain &chain, bool deep=true)
Copy constructor.
BALL::Chain::get
void get(Chain &chain, bool deep=true) const
BALL::SecondaryStructure
Definition: secondaryStructure.h:31
BALL_DECLARE_STD_ITERATOR_WRAPPER
#define BALL_DECLARE_STD_ITERATOR_WRAPPER(container, type, method_name)
Definition: stdIteratorWrapper.h:30
BALL_KERNEL_DEFINE_ITERATOR_CREATORS
#define BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Type)
Definition: iterator.h:25
BALL::Chain::getPDBAtom
const PDBAtom * getPDBAtom(Position position) const
BALL::Atom
Definition: atom.h:90
BALL_CREATE_DEEP
#define BALL_CREATE_DEEP(name)
Definition: create.h:26
BALL::PersistenceManager
Definition: persistenceManager.h:73
BALL::PDBAtom
Definition: PDBAtom.h:40
BALL::Chain::getNTerminal
const Residue * getNTerminal() const
BALL::Chain::Chain
Chain(const String &name)
Detailled constructor.
BALL::residues
BALL_EXPORT ResidueList residues(const AtomContainer &fragment, bool selected_only=false)
BALL::Residue
Definition: residue.h:38
BALL::Chain::spliceAfter
void spliceAfter(Chain &chain)
BALL::Chain::prepend
void prepend(SecondaryStructure &secondary_structure)
BALL::Chain::spliceBefore
void spliceBefore(Chain &chain)
BALL::Chain::countResidues
Size countResidues() const
BALL::Chain::Chain
Chain()
Default constrcutor.
BALL::Chain::prepend
void prepend(Residue &residue)
BALL::Chain::insertAfter
void insertAfter(SecondaryStructure &secondary_structure, Composite &after)
BALL::Chain::countSecondaryStructures
Size countSecondaryStructures() const
BALL::Chain::getNTerminal
Residue * getNTerminal()
BALL::String
Definition: string.h:57
BALL::Protein
Definition: protein.h:30
BALL::Chain::insert
void insert(SecondaryStructure &secondary_structure)
BALL::Chain::getCTerminal
Residue * getCTerminal()
BALL
Definition: constants.h:13
BALL::secondaryStructures
BALL_EXPORT SecondaryStructureList secondaryStructures(const AtomContainer &fragment, bool selected_only=false)
BALL::Chain::persistentWrite
void persistentWrite(PersistenceManager &pm, const char *name=0) const
BALL::atomContainers
BALL_EXPORT AtomContainerList atomContainers(const AtomContainer &fragment, bool selected_only=false)
BALL::Composite
Definition: composite.h:74
BALL::Chain::insertBefore
void insertBefore(Residue &residue, Composite &before)
BALL_SIZE_TYPE
BALL::Chain::remove
bool remove(SecondaryStructure &secondary_structure)
BALL::Chain::append
void append(SecondaryStructure &secondary_structure)
BALL::Chain::remove
bool remove(Residue &residue)
BALL::Chain::swap
void swap(Chain &chain)
BALL::Chain::insertAfter
void insertAfter(Residue &residue, Composite &after)
BALL::operator==
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL::Chain::getResidue
const Residue * getResidue(Position position) const
residue.h
BALL::Chain::getSecondaryStructure
const SecondaryStructure * getSecondaryStructure(Position position) const
BALL::Chain::insert
void insert(Residue &residue)
BALL::Chain::countPDBAtoms
Size countPDBAtoms() const
BALL::AtomContainer::Property
Property
The number of predefined properties for AtomContainer.
Definition: atomContainer.h:43
BALL::Chain::getPDBAtom
PDBAtom * getPDBAtom(Position position)
BALL::Chain::append
void append(Residue &residue)
BALL::Chain::insertBefore
void insertBefore(SecondaryStructure &secondary_structure, Composite &before)
secondaryStructureIterator.h
BALL::Chain::getProtein
Protein * getProtein()
BALL::AtomContainer::NUMBER_OF_PROPERTIES
@ NUMBER_OF_PROPERTIES
Definition: atomContainer.h:45
BALL::Chain::~Chain
virtual ~Chain()
Destructor.
BALL::Chain::getProtein
const Protein * getProtein() const
BALL::Chain::splice
void splice(Chain &chain)