1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The paramag user function definitions for paramagnetic related functions."""
24
25
26 from graphics import WIZARD_IMAGE_PATH
27 from pipe_control import paramag, pipes
28 from user_functions.data import Uf_info; uf_info = Uf_info()
29 from user_functions.objects import Desc_container
30
31
32
33 uf_class = uf_info.add_class('paramag')
34 uf_class.title = "Class for handling paramagnetic information."
35 uf_class.menu_text = "¶mag"
36 uf_class.gui_icon = "relax.align_tensor"
37
38
39
40 uf = uf_info.add_uf('paramag.centre')
41 uf.title = "Specify which atom is the paramagnetic centre."
42 uf.title_short = "Paramagnetic centre selection."
43 uf.add_keyarg(
44 name = "pos",
45 py_type = "num_list",
46 dim = 3,
47 desc_short = "atomic position",
48 desc = "The atomic position of the paramagnetic centre.",
49 can_be_none = True
50 )
51 uf.add_keyarg(
52 name = "atom_id",
53 py_type = "str",
54 desc_short = "atom ID string",
55 desc = "The atom ID string.",
56 can_be_none = True
57 )
58 uf.add_keyarg(
59 name = "pipe",
60 py_type = "str",
61 desc_short = "data pipe",
62 desc = "The data pipe containing the structures to extract the centre from.",
63 wiz_element_type = 'combo',
64 wiz_combo_iter = pipes.pipe_names,
65 can_be_none = True
66 )
67 uf.add_keyarg(
68 name = "verbosity",
69 default = 1,
70 py_type = "int",
71 desc_short = "verbosity level",
72 desc = "The amount of information to print out."
73 )
74 uf.add_keyarg(
75 name = "fix",
76 default = True,
77 py_type = "bool",
78 desc_short = "fix flag",
79 desc = "A flag specifying if the paramagnetic centre should be fixed during optimisation."
80 )
81 uf.add_keyarg(
82 name = "ave_pos",
83 default = True,
84 py_type = "bool",
85 desc_short = "average position flag",
86 desc = "A flag specifying if the position of the atom is to be averaged across all models."
87 )
88 uf.add_keyarg(
89 name = "force",
90 default = False,
91 py_type = "bool",
92 desc_short = "force flag",
93 desc = "A flag which if True will cause the current paramagnetic centre to be overwritten."
94 )
95
96 uf.desc.append(Desc_container())
97 uf.desc[-1].add_paragraph("This is required for specifying where the paramagnetic centre is located in the loaded structure file. If no structure number is given, then the average atom position will be calculated if multiple structures are loaded.")
98 uf.desc[-1].add_paragraph("A different set of structures than those loaded into the current data pipe can also be used to determine the position, or its average. This can be achieved by loading the alternative structures into another data pipe, and then specifying that pipe.")
99 uf.desc[-1].add_paragraph("If the average position flag is set to True, the average position from all models will be used as the position of the paramagnetic centre. If False, then the positions from all structures will be used. If multiple positions are used, then a fast paramagnetic centre motion will be assumed so that PCSs for a single tensor will be calculated for each position, and the PCS values linearly averaged.")
100
101 uf.desc.append(Desc_container("Prompt examples"))
102 uf.desc[-1].add_paragraph("If the paramagnetic centre is the lanthanide Dysprosium which is labelled as Dy in a loaded PDB file, then type one of:")
103 uf.desc[-1].add_prompt("relax> paramag.centre('Dy')")
104 uf.desc[-1].add_prompt("relax> paramag.centre(atom_id='Dy')")
105 uf.desc[-1].add_paragraph("If the carbon atom 'C1' of residue '4' in the PDB file is to be used as the paramagnetic centre, then type:")
106 uf.desc[-1].add_prompt("relax> paramag.centre(':4@C1')")
107 uf.desc[-1].add_paragraph("To state that the Dy3+ atomic position is [0.136, 12.543, 4.356], type one of:")
108 uf.desc[-1].add_prompt("relax> paramag.centre([0.136, 12.543, 4.356])")
109 uf.desc[-1].add_prompt("relax> paramag.centre(pos=[0.136, 12.543, 4.356])")
110 uf.desc[-1].add_paragraph("To find an unknown paramagnetic centre, type:")
111 uf.desc[-1].add_prompt("relax> paramag.centre(fix=False)")
112 uf.backend = paramag.centre
113 uf.menu_text = "¢re"
114 uf.wizard_height_desc = 400
115 uf.wizard_size = (1000, 750)
116 uf.wizard_apply_button = False
117 uf.wizard_image = WIZARD_IMAGE_PATH + 'align_tensor.png'
118