BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
78  void persistentRead(PersistenceManager& pm);
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 
134  Protein* getProtein();
135 
140  const Protein* getProtein() const;
141 
148  SecondaryStructure* getSecondaryStructure(Position position);
149 
156  const SecondaryStructure* getSecondaryStructure(Position position) const;
157 
163  Residue* getResidue(Position position);
164 
170  const Residue* getResidue(Position position) const;
171 
178 
184  const Residue* getNTerminal() const;
185 
192 
198  const Residue* getCTerminal() const;
199 
205  PDBAtom* getPDBAtom(Position position);
206 
212  const PDBAtom* getPDBAtom(Position position) const;
213 
217  Size countSecondaryStructures() const;
218 
222  Size countResidues() const;
223 
227  Size countPDBAtoms() const;
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 
333  BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure)
336 
337  BALL_DECLARE_STD_ITERATOR_WRAPPER(Chain, SecondaryStructure, secondaryStructures)
339  BALL_DECLARE_STD_ITERATOR_WRAPPER(Chain, PDBAtom , pdbAtoms)
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
#define BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Type)
Definition: iterator.h:25
BALL_EXPORT SecondaryStructureList secondaryStructures(const AtomContainer &fragment, bool selected_only=false)
const Residue * getNTerminal(const ResidueContainerType &residue_container)
Definition: residue.h:444
const Residue * getCTerminal(const ResidueContainerType &residue_container)
Definition: residue.h:459
Property
The number of predefined properties for AtomContainer.
Definition: atomContainer.h:42
BALL_EXPORT ResidueList residues(const AtomContainer &fragment, bool selected_only=false)
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
#define BALL_CREATE_DEEP(name)
Definition: create.h:26
#define BALL_DECLARE_STD_ITERATOR_WRAPPER(container, type, method_name)
BALL_SIZE_TYPE Size
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL_EXPORT AtomContainerList atomContainers(const AtomContainer &fragment, bool selected_only=false)
char Atom[5]
Definition: PDBdefs.h:257
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL_SIZE_TYPE Position