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

Source Code for Module user_functions.palmer

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2003-2006,2009,2012-2013,2019 Edward d'Auvergne               # 
  4  # Copyright (C) 2008 Sebastien Morin                                          # 
  5  #                                                                             # 
  6  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  7  #                                                                             # 
  8  # This program is free software: you can redistribute it and/or modify        # 
  9  # it under the terms of the GNU General Public License as published by        # 
 10  # the Free Software Foundation, either version 3 of the License, or           # 
 11  # (at your option) any later version.                                         # 
 12  #                                                                             # 
 13  # This program is distributed in the hope that it will be useful,             # 
 14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 16  # GNU General Public License for more details.                                # 
 17  #                                                                             # 
 18  # You should have received a copy of the GNU General Public License           # 
 19  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Module docstring. 
 24  """The palmer user function definitions for controlling the Modelfree4 software.""" 
 25   
 26  # relax module imports. 
 27  from graphics import WIZARD_IMAGE_PATH 
 28  from pipe_control import palmer 
 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      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      basic_types = ["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      arg_type = "file sel read", 
 62      desc_short = "Modelfree executable file", 
 63      desc = "The name of the executable Modelfree program file.", 
 64      wiz_filesel_preview = False 
 65  ) 
 66  uf.add_keyarg( 
 67      name = "diff_search", 
 68      default = "none", 
 69      basic_types = ["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      basic_types = ["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      basic_types = ["str"], 
 84      desc_short = "simulation type", 
 85      desc = "See the Modelfree4 manual." 
 86  ) 
 87  uf.add_keyarg( 
 88      name = "trim", 
 89      default = 0, 
 90      basic_types = ["number"], 
 91      desc_short = "trimming", 
 92      desc = "See the Modelfree4 manual." 
 93  ) 
 94  uf.add_keyarg( 
 95      name = "steps", 
 96      default = 20, 
 97      basic_types = ["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      basic_types = ["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      basic_types = ["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      basic_types = ["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      basic_types = ["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      basic_types = ["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      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      basic_types = ["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      arg_type = "file sel read", 
181      desc_short = "Modelfree4 executable file", 
182      desc = "The name of the executable Modelfree program file.", 
183      wiz_filesel_preview = False 
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      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