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
79 'dir/mfin',
80 'dir/mfdata',
81 'dir/mfpar',
82 'dir/mfmodel',
83 'dir/run.sh'.
84
85 The file 'run/run.sh' contains the single command,
86
87 'modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out',
88
89 which can be used to execute modelfree4.
90 """
91
92
93 if self.__relax__.interpreter.intro:
94 text = sys.ps3 + "palmer.create("
95 text = text + "run=" + `run`
96 text = text + ", dir=" + `dir`
97 text = text + ", force=" + `force`
98 text = text + ", diff_search=" + `diff_search`
99 text = text + ", sims=" + `sims`
100 text = text + ", sim_type=" + `sim_type`
101 text = text + ", trim=" + `trim`
102 text = text + ", steps=" + `steps`
103 text = text + ", constraints=" + `constraints`
104 text = text + ", nucleus=" + `nucleus`
105 text = text + ", atom1=" + `atom1`
106 text = text + ", atom2=" + `atom2` + ")"
107 print text
108
109
110 if type(run) != str:
111 raise RelaxStrError, ('run', run)
112
113
114 if dir != None:
115 if type(dir) != str:
116 raise RelaxNoneStrError, ('directory name', dir)
117
118
119 if type(force) != int or (force != 0 and force != 1):
120 raise RelaxBinError, ('force flag', force)
121
122
123 if type(diff_search) != str:
124 raise RelaxStrError, ('diff_search', diff_search)
125
126
127 if type(sims) != int:
128 raise RelaxIntError, ('sims', sims)
129
130
131 if type(sim_type) != str:
132 raise RelaxStrError, ('sim_type', sim_type)
133
134
135 if type(trim) != float and type(trim) != int:
136 raise RelaxFloatError, ('trim', trim)
137
138
139 if type(steps) != int:
140 raise RelaxIntError, ('steps', steps)
141
142
143 if type(constraints) != int or (constraints != 0 and constraints != 1):
144 raise RelaxBinError, ('constraint flag', constraints)
145
146
147 if type(nucleus) != str:
148 raise RelaxStrError, ('nucleus', nucleus)
149
150
151 if type(atom1) != str:
152 raise RelaxStrError, ('atom1', atom1)
153
154
155 if type(atom2) != str:
156 raise RelaxStrError, ('atom2', atom2)
157
158
159 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)
160
161
162 - def execute(self, run=None, dir=None, force=0):
163 """Function for executing Modelfree4.
164
165 Keyword Arguments
166 ~~~~~~~~~~~~~~~~~
167
168 run: The name of the run.
169
170 dir: The directory to place the files. The default is the value of 'run'.
171
172 force: A flag which if set to 1 will cause the results file to be overwritten if it already
173 exists.
174
175
176 Description
177 ~~~~~~~~~~~
178
179 Modelfree 4 will be executed as
180
181 $ modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out
182
183 If a PDB file is loaded and non-isotropic diffusion is selected, then the file name will be
184 placed on the command line as '-s pdb_file_name'.
185 """
186
187
188 if self.__relax__.interpreter.intro:
189 text = sys.ps3 + "palmer.execute("
190 text = text + "run=" + `run`
191 text = text + ", dir=" + `dir`
192 text = text + ", force=" + `force` + ")"
193 print text
194
195
196 if type(run) != str:
197 raise RelaxStrError, ('run', run)
198
199
200 if dir != None:
201 if type(dir) != str:
202 raise RelaxNoneStrError, ('directory name', dir)
203
204
205 if type(force) != int or (force != 0 and force != 1):
206 raise RelaxBinError, ('force flag', force)
207
208
209 self.__relax__.generic.palmer.execute(run=run, dir=dir, force=force)
210
211
213 """Function for extracting data from the Modelfree4 'mfout' star formatted file.
214
215 Keyword Arguments
216 ~~~~~~~~~~~~~~~~~
217
218 run: The name of the run.
219
220 dir: The directory where the file 'mfout' is found. The default is the value of 'run'.
221 """
222
223
224 if self.__relax__.interpreter.intro:
225 text = sys.ps3 + "palmer.extract("
226 text = text + "run=" + `run`
227 text = text + ", dir=" + `dir` + ")"
228 print text
229
230
231 if type(run) != str:
232 raise RelaxStrError, ('run', run)
233
234
235 if dir != None:
236 if type(dir) != str:
237 raise RelaxNoneStrError, ('directory name', dir)
238
239
240 self.__relax__.generic.palmer.extract(run=run, dir=dir)
241