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