BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
secondaryStructure.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_SECONDARYSTRUCTURE_H
6 #define BALL_KERNEL_SECONDARYSTRUCTURE_H
7 
8 #ifndef BALL_KERNEL_RESIDUE_H
9 # include <BALL/KERNEL/residue.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_RESIDUEITERATOR_H
14 #endif
15 
16 #ifndef BALL_KERNEL_ATOMCONTAINER_H
18 #endif
19 
20 namespace BALL
21 {
30  : public AtomContainer
31  {
32  public:
33 
35 
36 
39 
42  enum Type
43  {
55  NUMBER_OF_TYPES
56  };
57 
59 
60 
64 
67 
69  SecondaryStructure(const SecondaryStructure& secondary_structure, bool deep = true);
70 
72  SecondaryStructure(const String& name);
73 
75  virtual ~SecondaryStructure();
76 
78  virtual void clear();
79 
81  virtual void destroy();
83 
91  bool operator == (const SecondaryStructure& secondary_structure) const;
92 
96  bool operator != (const SecondaryStructure& secondary_structure) const;
98 
102 
106  void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
107 
111  void persistentRead(PersistenceManager& pm);
113 
117 
123  void set(const SecondaryStructure& secondary_structure, bool deep = true);
124 
130  SecondaryStructure& operator = (const SecondaryStructure& secondary_structure);
131 
137  void get(SecondaryStructure& secondary_structure, bool deep = true) const;
138 
142  void swap(SecondaryStructure& secondary_structure);
144 
148 
150  Type getType() const { return type_; }
151 
153  void setType(Type type) { type_ = type; }
154 
159  Protein* getProtein();
160 
165  const Protein* getProtein() const;
166 
171  Chain* getChain();
172 
177  const Chain* getChain() const;
178 
184  Residue* getResidue(Position position);
185 
191  const Residue* getResidue(Position position) const;
192 
199 
205  const Residue* getNTerminal() const;
206 
213 
219  const Residue* getCTerminal() const;
220 
226  PDBAtom* getPDBAtom(Position position);
227 
233  const PDBAtom* getPDBAtom(Position position) const;
234 
238  Size countResidues() const;
239 
243  Size countPDBAtoms() const;
244 
248  void prepend(Residue& residue);
249 
253  void append(Residue& residue);
254 
258  void insert(Residue& residue);
259 
264  void insertBefore(Residue& residue, Composite& before);
265 
270  void insertAfter(Residue& residue, Composite& after);
271 
275  bool remove(Residue& residue);
276 
281  void spliceBefore(SecondaryStructure& secondary_structure);
282 
287  void spliceAfter(SecondaryStructure& secondary_structure);
288 
292  void splice(SecondaryStructure& secondary_structure);
294 
298 
303  virtual bool isValid() const;
304 
311  virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
312 
314 
315  // --- EXTERNAL ITERATORS
316 
319 
321  BALL_DECLARE_STD_ITERATOR_WRAPPER(SecondaryStructure, PDBAtom, pdbAtoms)
322 
323  protected:
324 
326  Type type_;
327 
328  private:
329 
330  Fragment* getFragment(Position position);
331 
332  const Fragment* getFragment(Position position) const;
333 
334  Atom* getAtom(Position position);
335 
336  const Atom* getAtom(Position position) const;
337 
338  void prepend(Atom& atom);
339 
340  void append(Atom& atom);
341 
342  void insert(Atom& atom);
343 
344  void insertBefore(Atom& atom, Composite& before);
345 
346  void insertAfter(Atom& atom, Composite& after);
347 
348  bool remove(Atom& atom);
349 
350  void prepend(AtomContainer& atom_container);
351 
352  void append(AtomContainer& atom_container);
353 
354  void insert(AtomContainer& atom_container);
355 
356  void insertBefore(AtomContainer& atom_container, Composite& before);
357 
358  void insertAfter(AtomContainer& atom_container, Composite& after);
359 
360  void spliceBefore(AtomContainer& atom_container);
361 
362  void spliceAfter(AtomContainer& atom_container);
363 
364  void splice(AtomContainer& atom_container);
365 
366  bool remove(AtomContainer& atom_container);
367 
370  };
371 
372 } // namespace BALL
373 
374 #endif // BALL_KERNEL_SECONDARYSTRUCTURE_H
#define BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Type)
Definition: iterator.h:25
Type getType() const
Return the type of secondary structure.
const Residue * getNTerminal(const ResidueContainerType &residue_container)
Definition: residue.h:444
void setType(Type type)
Set the type of secondary structure.
const Residue * getCTerminal(const ResidueContainerType &residue_container)
Definition: residue.h:459
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_EXPORT bool operator==(const String &s1, const String &s2)
BALL_EXPORT AtomContainerList atomContainers(const AtomContainer &fragment, bool selected_only=false)
#define BALL_EXPORT
Definition: COMMON/global.h:50