1
2
3
4
5
6 """The structure class, representing a macromolecular structure."""
7
8 from Bio.PDB.Entity import Entity
9
10
12 """
13 The Structure class contains a collection of Model instances.
14 """
18
19
20
22 return "<Structure id=%s>" % self.get_id()
23
24
25
27 """Sort models.
28
29 This sorting function sorts the Model instances in the Structure instance.
30 The sorting is done based on the model id, which is a simple int that
31 reflects the order of the models in the PDB file.
32
33 Arguments:
34 o m1, m2 - Model instances
35 """
36 return cmp(m1.get_id(), m2.get_id())
37
38
39
41 for m in self:
42 for c in m:
43 yield c
44
46 for c in self.get_chains():
47 for r in c:
48 yield r
49
54