1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The eliminate user function definitions for removing failed models."""
24
25
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
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 py_type = "func",
41 arg_type = "func",
42 desc_short = "function",
43 desc = "An optional user supplied function for model elimination.",
44 can_be_none = True
45 )
46 uf.add_keyarg(
47 name = "args",
48 py_type = "tuple",
49 arg_type = "func args",
50 desc_short = "function arguments",
51 desc = "A tuple of arguments used by the optional function for model elimination.",
52 can_be_none = True
53 )
54
55 uf.desc.append(Desc_container())
56 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.")
57 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.")
58 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.")
59 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.")
60 uf.desc += model_free_uf.eliminate_doc
61 uf.backend = eliminate.eliminate
62 uf.menu_text = "&eliminate"
63 uf.gui_icon = "oxygen.actions.edit-delete"
64 uf.wizard_height_desc = 620
65 uf.wizard_size = (1000, 750)
66 uf.wizard_apply_button = False
67 uf.wizard_image = WIZARD_IMAGE_PATH + 'model_elimination.png'
68