1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import sys
24
25 import help
26
27
30
31 self.__relax_help__ = \
32 """Class for interfacing with Art Palmer's Modelfree 4."""
33
34
35 self.__relax_help__ = self.__relax_help__ + "\n" + help.relax_class_help
36
37
38 self.__relax__ = relax
39
40
41 - def create(self, run=None, dir=None, force=0, diff_search='none', sims=0, sim_type='pred', trim=0, steps=20, constraints=1, nucleus='15N', atom1='N', atom2='H'):
42 """Function for creating the Modelfree4 input files.
43
44 Keyword Arguments
45 ~~~~~~~~~~~~~~~~~
46
47 run: The name of the run.
48
49 dir: The directory to place the files. The default is the value of 'run'.
50
51 force: A flag which if set to 1 will cause the results file to be overwritten if it already
52 exists.
53
54 diff_search: See the Modelfree4 manual for 'diffusion_search'.
55
56 sims: The number of Monte Carlo simulations.
57
58 sim_type: See the Modelfree4 manual.
59
60 trim: See the Modelfree4 manual.
61
62 steps: See the Modelfree4 manual.
63
64 constraints: A flag specifying whether the parameters should be constrained. The default
65 is to turn constraints on (constraints=1).
66
67 nucleus: A three letter string describing the nucleus type, ie 15N, 13C, etc.
68
69 atom1: The symbol of the X nucleus in the pdb file.
70
71 atom2: The symbol of the H nucleus in the pdb file.
72
73
74 Description
75 ~~~~~~~~~~~
76
77 The following files are created:
78 dir/mfin
79 dir/mfdata
80 dir/mfpar
81 dir/mfmodel
82 dir/run.sh
83
84 The file 'run/run.sh' contains the single command:
85 modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out
86 This can be used to execute modelfree4.
87 """
88
89
90 if self.__relax__.interpreter.intro:
91 text = sys.ps3 + "palmer.create("
92 text = text + "run=" + `run`
93 text = text + ", dir=" + `dir`
94 text = text + ", force=" + `force`
95 text = text + ", diff_search=" + `diff_search`
96 text = text + ", sims=" + `sims`
97 text = text + ", sim_type=" + `sim_type`
98 text = text + ", trim=" + `trim`
99 text = text + ", steps=" + `steps`
100 text = text + ", constraints=" + `constraints`
101 text = text + ", nucleus=" + `nucleus`
102 text = text + ", atom1=" + `atom1`
103 text = text + ", atom2=" + `atom2` + ")"
104 print text
105
106
107 if type(run) != str:
108 raise RelaxStrError, ('run', run)
109
110
111 if dir != None:
112 if type(dir) != str:
113 raise RelaxNoneStrError, ('directory name', dir)
114
115
116 if type(force) != int or (force != 0 and force != 1):
117 raise RelaxBinError, ('force flag', force)
118
119
120 if type(diff_search) != str:
121 raise RelaxStrError, ('diff_search', diff_search)
122
123
124 if type(sims) != int:
125 raise RelaxIntError, ('sims', sims)
126
127
128 if type(sim_type) != str:
129 raise RelaxStrError, ('sim_type', sim_type)
130
131
132 if type(trim) != float and type(trim) != int:
133 raise RelaxFloatError, ('trim', trim)
134
135
136 if type(steps) != int:
137 raise RelaxIntError, ('steps', steps)
138
139
140 if type(constraints) != int or (constraints != 0 and constraints != 1):
141 raise RelaxBinError, ('constraint flag', constraints)
142
143
144 if type(nucleus) != str:
145 raise RelaxStrError, ('nucleus', nucleus)
146
147
148 if type(atom1) != str:
149 raise RelaxStrError, ('atom1', atom1)
150
151
152 if type(atom2) != str:
153 raise RelaxStrError, ('atom2', atom2)
154
155
156 self.__relax__.generic.palmer.create(run=run, dir=dir, force=force, diff_search=diff_search, sims=sims, sim_type=sim_type, trim=trim, steps=steps, constraints=constraints, nucleus=nucleus, atom1=atom1, atom2=atom2)
157
158
159 - def execute(self, run=None, dir=None, force=0):
160 """Function for executing Modelfree4.
161
162 Keyword Arguments
163 ~~~~~~~~~~~~~~~~~
164
165 run: The name of the run.
166
167 dir: The directory to place the files. The default is the value of 'run'.
168
169 force: A flag which if set to 1 will cause the results file to be overwritten if it already
170 exists.
171
172
173 Description
174 ~~~~~~~~~~~
175
176 Modelfree 4 will be executed as:
177 modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out
178
179 If a PDB file is loaded and non-isotropic diffusion is selected, then the file name will be
180 placed on the command line as '-s pdb_file_name'.
181 """
182
183
184 if self.__relax__.interpreter.intro:
185 text = sys.ps3 + "palmer.execute("
186 text = text + "run=" + `run`
187 text = text + ", dir=" + `dir`
188 text = text + ", force=" + `force` + ")"
189 print text
190
191
192 if type(run) != str:
193 raise RelaxStrError, ('run', run)
194
195
196 if dir != None:
197 if type(dir) != str:
198 raise RelaxNoneStrError, ('directory name', dir)
199
200
201 if type(force) != int or (force != 0 and force != 1):
202 raise RelaxBinError, ('force flag', force)
203
204
205 self.__relax__.generic.palmer.execute(run=run, dir=dir, force=force)
206
207
209 """Function for extracting data from the Modelfree4 'mfout' star formatted file.
210
211 Keyword Arguments
212 ~~~~~~~~~~~~~~~~~
213
214 run: The name of the run.
215
216 dir: The directory where the file 'mfout' is found. The default is the value of 'run'.
217 """
218
219
220 if self.__relax__.interpreter.intro:
221 text = sys.ps3 + "palmer.extract("
222 text = text + "run=" + `run`
223 text = text + ", dir=" + `dir` + ")"
224 print text
225
226
227 if type(run) != str:
228 raise RelaxStrError, ('run', run)
229
230
231 if dir != None:
232 if type(dir) != str:
233 raise RelaxNoneStrError, ('directory name', dir)
234
235
236 self.__relax__.generic.palmer.extract(run=run, dir=dir)
237