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