Package user_functions :: Module palmer'
[hide private]
[frames] | no frames]

Source Code for Module user_functions.palmer'

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2003-2012 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax.                                     # 
  6  #                                                                             # 
  7  # relax is free software; you can redistribute it and/or modify               # 
  8  # it under the terms of the GNU General Public License as published by        # 
  9  # the Free Software Foundation; either version 2 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # relax is distributed in the hope that it will be useful,                    # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 15  # GNU General Public License for more details.                                # 
 16  #                                                                             # 
 17  # You should have received a copy of the GNU General Public License           # 
 18  # along with relax; if not, write to the Free Software                        # 
 19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Module docstring. 
 24  """The palmer user function definitions for controlling the Modelfree4 software.""" 
 25   
 26  # relax module imports. 
 27  from generic_fns import palmer 
 28  from graphics import WIZARD_IMAGE_PATH 
 29  from user_functions.data import Uf_info; uf_info = Uf_info() 
 30  from user_functions.objects import Desc_container 
 31   
 32   
 33  # The user function class. 
 34  uf_class = uf_info.add_class('palmer') 
 35  uf_class.title = "Class for interfacing with Art Palmer's Modelfree 4." 
 36  uf_class.menu_text = "&palmer" 
 37  uf_class.gui_icon = "relax.modelfree4" 
 38   
 39   
 40  # The palmer.create user function. 
 41  uf = uf_info.add_uf('palmer.create') 
 42  uf.title = "Create the Modelfree4 input files." 
 43  uf.title_short = "Modelfree4 input file creation." 
 44  uf.add_keyarg( 
 45      name = "dir", 
 46      py_type = "str", 
 47      arg_type = "dir sel", 
 48      desc_short = "directory name", 
 49      desc = "The directory to place the files.", 
 50      can_be_none = True 
 51  ) 
 52  uf.add_keyarg( 
 53      name = "force", 
 54      default = False, 
 55      py_type = "bool", 
 56      desc_short = "force flag", 
 57      desc = "A flag which if set to True will cause the results file to be overwritten if it already exists." 
 58  ) 
 59  uf.add_keyarg( 
 60      name = "binary", 
 61      default = "modelfree4", 
 62      py_type = "str", 
 63      desc_short = "Modelfree executable file", 
 64      desc = "The name of the executable Modelfree program file." 
 65  ) 
 66  uf.add_keyarg( 
 67      name = "diff_search", 
 68      default = "none", 
 69      py_type = "str", 
 70      desc_short = "diffusion search", 
 71      desc = "See the Modelfree4 manual for 'diffusion_search'." 
 72  ) 
 73  uf.add_keyarg( 
 74      name = "sims", 
 75      default = 0, 
 76      py_type = "int", 
 77      desc_short = "Monte Carlo simulation number", 
 78      desc = "The number of Monte Carlo simulations." 
 79  ) 
 80  uf.add_keyarg( 
 81      name = "sim_type", 
 82      default = "pred", 
 83      py_type = "str", 
 84      desc_short = "simulation type", 
 85      desc = "See the Modelfree4 manual." 
 86  ) 
 87  uf.add_keyarg( 
 88      name = "trim", 
 89      default = 0, 
 90      py_type = "num", 
 91      desc_short = "trimming", 
 92      desc = "See the Modelfree4 manual." 
 93  ) 
 94  uf.add_keyarg( 
 95      name = "steps", 
 96      default = 20, 
 97      py_type = "int", 
 98      desc_short = "grid search steps", 
 99      desc = "See the Modelfree4 manual." 
100  ) 
101  uf.add_keyarg( 
102      name = "constraints", 
103      default = True, 
104      py_type = "bool", 
105      desc_short = "constraints flag", 
106      desc = "A flag specifying whether the parameters should be constrained.  The default is to turn constraints on (constraints=True)." 
107  ) 
108  uf.add_keyarg( 
109      name = "heteronuc_type", 
110      default = "15N", 
111      py_type = "str", 
112      desc_short = "heteronucleus", 
113      desc = "A three letter string describing the heteronucleus type, ie '15N', '13C', etc." 
114  ) 
115  uf.add_keyarg( 
116      name = "atom1", 
117      default = "N", 
118      py_type = "str", 
119      desc_short = "atom1", 
120      desc = "The symbol of the X heteronucleus in the PDB file." 
121  ) 
122  uf.add_keyarg( 
123      name = "atom2", 
124      default = "H", 
125      py_type = "str", 
126      desc_short = "atom2", 
127      desc = "The symbol of the H nucleus in the PDB file." 
128  ) 
129  uf.add_keyarg( 
130      name = "spin_id", 
131      py_type = "str", 
132      desc_short = "spin ID string", 
133      desc = "The spin identification string.", 
134      can_be_none = True 
135  ) 
136  # Description. 
137  uf.desc.append(Desc_container()) 
138  uf.desc[-1].add_paragraph("The following files are created") 
139  uf.desc[-1].add_list_element("'dir/mfin'") 
140  uf.desc[-1].add_list_element("'dir/mfdata'") 
141  uf.desc[-1].add_list_element("'dir/mfpar'") 
142  uf.desc[-1].add_list_element("'dir/mfmodel'") 
143  uf.desc[-1].add_list_element("'dir/run.sh'") 
144  uf.desc[-1].add_paragraph("The file 'dir/run.sh' contains the single command,") 
145  uf.desc[-1].add_item_list_element(None, "'modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out',") 
146  uf.desc[-1].add_paragraph("which can be used to execute modelfree4.") 
147  uf.desc[-1].add_paragraph("If you would like to use a different Modelfree executable file, change the binary name to the appropriate file name.  If the file is not located within the environment's path, include the full path in front of the binary file name.") 
148  uf.backend = palmer.create 
149  uf.menu_text = "&create" 
150  uf.gui_icon = "oxygen.actions.list-add-relax-blue" 
151  uf.wizard_height_desc = 230 
152  uf.wizard_size = (1000, 750) 
153  uf.wizard_apply_button = False 
154  uf.wizard_image = WIZARD_IMAGE_PATH + 'modelfree4.png' 
155   
156   
157  # The palmer.execute user function. 
158  uf = uf_info.add_uf('palmer.execute') 
159  uf.title = "Perform a model-free optimisation using Modelfree4." 
160  uf.title_short = "Modelfree4 execution." 
161  uf.add_keyarg( 
162      name = "dir", 
163      py_type = "str", 
164      arg_type = "dir sel", 
165      desc_short = "directory name", 
166      desc = "The directory to place the files.", 
167      can_be_none = True 
168  ) 
169   
170  uf.add_keyarg( 
171      name = "force", 
172      default = False, 
173      py_type = "bool", 
174      desc_short = "force flag", 
175      desc = "A flag which if set to True will cause the results file to be overwritten if it already exists." 
176  ) 
177   
178  uf.add_keyarg( 
179      name = "binary", 
180      default = "modelfree4", 
181      py_type = "str", 
182      desc_short = "Modelfree4 executable file", 
183      desc = "The name of the executable Modelfree program file." 
184  ) 
185  # Description. 
186  uf.desc.append(Desc_container()) 
187  uf.desc[-1].add_paragraph("Modelfree 4 will be executed as") 
188  uf.desc[-1].add_prompt("$ modelfree4 -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out") 
189  uf.desc[-1].add_paragraph("If a PDB file is loaded and non-isotropic diffusion is selected, then the file name will be placed on the command line as '-s pdb_file_name'.") 
190  uf.desc[-1].add_paragraph("If you would like to use a different Modelfree executable file, change the binary name to the appropriate file name.  If the file is not located within the environment's path, include the full path in front of the binary file name.") 
191  uf.backend = palmer.execute 
192  uf.gui_icon = "oxygen.categories.applications-education" 
193  uf.menu_text = "&execute" 
194  uf.wizard_size = (800, 600) 
195  uf.wizard_apply_button = False 
196  uf.wizard_image = WIZARD_IMAGE_PATH + 'modelfree4.png' 
197   
198   
199  # The palmer.extract user function. 
200  uf = uf_info.add_uf('palmer.extract') 
201  uf.title = "Extract data from the Modelfree4 'mfout' star formatted file." 
202  uf.title_short = "Modelfree4 data extraction." 
203  uf.add_keyarg( 
204      name = "dir", 
205      py_type = "str", 
206      arg_type = "dir sel", 
207      desc_short = "directory name", 
208      desc = "The directory where the file 'mfout' is found.", 
209      can_be_none = True 
210  ) 
211  # Description. 
212  uf.desc.append(Desc_container()) 
213  uf.desc[-1].add_paragraph("The model-free results will be extracted from the Modelfree4 results file 'mfout' located in the given directory.") 
214  uf.backend = palmer.extract 
215  uf.menu_text = "ex&tract" 
216  uf.gui_icon = "oxygen.actions.archive-extract" 
217  uf.wizard_apply_button = False 
218  uf.wizard_image = WIZARD_IMAGE_PATH + 'modelfree4.png' 
219