1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 """The eliminate user function definitions for removing failed models."""
25
26
27 from generic_fns import eliminate
28 from graphics import WIZARD_IMAGE_PATH
29 from specific_fns.model_free import Model_free
30 from user_functions.data import Uf_info; uf_info = Uf_info()
31 from user_functions.objects import Desc_container
32
33
34
35 uf = uf_info.add_uf('eliminate')
36 uf.title = "Elimination or rejection of models."
37 uf.title_short = "Model elimination."
38 uf.display = True
39 uf.add_keyarg(
40 name = "function",
41 py_type = "func",
42 arg_type = "func",
43 desc_short = "function",
44 desc = "An optional user supplied function for model elimination.",
45 can_be_none = True
46 )
47 uf.add_keyarg(
48 name = "args",
49 py_type = "tuple",
50 arg_type = "func args",
51 desc_short = "function arguments",
52 desc = "A tuple of arguments used by the optional function for model elimination.",
53 can_be_none = True
54 )
55
56 uf.desc.append(Desc_container())
57 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.")
58 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.")
59 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.")
60 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.")
61 uf.desc += Model_free.eliminate_doc
62 uf.backend = eliminate.eliminate
63 uf.menu_text = "&eliminate"
64 uf.gui_icon = "oxygen.actions.edit-delete"
65 uf.wizard_height_desc = 620
66 uf.wizard_size = (1000, 750)
67 uf.wizard_apply_button = False
68 uf.wizard_image = WIZARD_IMAGE_PATH + 'model_elimination.png'
69