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

Source Code for Module user_functions.eliminate

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2004,2009,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 eliminate user function definitions for removing failed models.""" 
24   
25  # relax module imports. 
26  from graphics import WIZARD_IMAGE_PATH 
27  from pipe_control import eliminate 
28  from specific_analyses.model_free import uf as model_free_uf 
29  from user_functions.data import Uf_info; uf_info = Uf_info() 
30  from user_functions.objects import Desc_container 
31   
32   
33  # The eliminate user function. 
34  uf = uf_info.add_uf('eliminate') 
35  uf.title = "Elimination or rejection of models." 
36  uf.title_short = "Model elimination." 
37  uf.display = True 
38  uf.add_keyarg( 
39      name = "function", 
40      arg_type = "func", 
41      desc_short = "function", 
42      desc = "An optional user supplied function for model elimination.", 
43      can_be_none = True 
44  ) 
45  uf.add_keyarg( 
46      name = "args", 
47      arg_type = "func args", 
48      desc_short = "function arguments", 
49      desc = "A tuple of arguments used by the optional function for model elimination.", 
50      can_be_none = True 
51  ) 
52  # Description. 
53  uf.desc.append(Desc_container()) 
54  uf.desc[-1].add_paragraph("This is used for model validation to eliminate or reject models prior to model selection.  Model validation is a part of mathematical modelling whereby models are either accepted or rejected.") 
55  uf.desc[-1].add_paragraph("Empirical rules are used for model rejection and are listed below.  However these can be overridden by supplying a function in the prompt and scripting modes.  The function should accept five arguments, a string defining a certain parameter, the value of the parameter, the minimisation instance (ie the residue index if the model is residue specific), and the function arguments.  If the model is rejected, the function should return True, otherwise it should return False.  The function will be executed multiple times, once for each parameter of the model.") 
56  uf.desc[-1].add_paragraph("The function arguments should be a tuple, a list enclosed in round brackets, and will be passed to the user supplied function or the inbuilt function.  For a description of the arguments accepted by the inbuilt functions, see below.") 
57  uf.desc[-1].add_paragraph("Once a model is rejected, the select flag corresponding to that model will be set to False so that model selection, or any other function, will then skip the model.") 
58  uf.desc += model_free_uf.eliminate_doc 
59  uf.backend = eliminate.eliminate 
60  uf.menu_text = "&eliminate" 
61  uf.gui_icon = "oxygen.actions.edit-delete" 
62  uf.wizard_height_desc = 620 
63  uf.wizard_size = (1000, 750) 
64  uf.wizard_apply_button = False 
65  uf.wizard_image = WIZARD_IMAGE_PATH + 'model_elimination.png' 
66