1
2
3
4
5
6 import os
7
8
9 from Entity import Entity
10
11 __doc__="Model class, used in Structure objects."
12
13
15 """
16 The object representing a model in a structure. In a structure
17 derived from an X-ray crystallography experiment, only a single
18 model will be present (with some exceptions). NMR structures
19 normally contain many different models.
20 """
21
23 """
24 Arguments:
25 o id - int
26 """
27 self.level="M"
28 Entity.__init__(self, id)
29
30
31
33 """Sort the Chains instances in the Model instance.
34
35 Chain instances are sorted alphabetically according to
36 their chain id. Blank chains come last, as they often consist
37 of waters.
38
39 Arguments:
40 o c1, c2 - Chain objects
41 """
42 id1=c1.get_id()
43 id2= c2.get_id()
44
45 if id1==" " and not id2==" ":
46 return 1
47 elif id2==" " and not id1==" ":
48 return -1
49 return cmp(id1, id2)
50
51
52
54 return "<Model id=%s>" % self.get_id()
55
56
57
59 for c in self:
60 for r in c:
61 yield r
62
67