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 basic_types = ["number"],
46 container_types = ["list", "numpy array"],
47 dim = (3,),
48 desc_short = "atomic position",
49 desc = "The atomic position of the paramagnetic centre.",
50 list_titles = ['X coordinate', 'Y coordinate', 'Z coordinate'],
51 can_be_none = True
52 )
53 uf.add_keyarg(
54 name = "atom_id",
55 basic_types = ["str"],
56 desc_short = "atom ID string",
57 desc = "The atom ID string.",
58 can_be_none = True
59 )
60 uf.add_keyarg(
61 name = "pipe",
62 basic_types = ["str"],
63 desc_short = "data pipe",
64 desc = "The data pipe containing the structures to extract the centre from.",
65 wiz_element_type = 'combo',
66 wiz_combo_iter = pipes.pipe_names,
67 can_be_none = True
68 )
69 uf.add_keyarg(
70 name = "verbosity",
71 default = 1,
72 basic_types = ["int"],
73 desc_short = "verbosity level",
74 desc = "The amount of information to print out."
75 )
76 uf.add_keyarg(
77 name = "fix",
78 default = True,
79 basic_types = ["bool"],
80 desc_short = "fix flag",
81 desc = "A flag specifying if the paramagnetic centre should be fixed during optimisation."
82 )
83 uf.add_keyarg(
84 name = "ave_pos",
85 default = True,
86 basic_types = ["bool"],
87 desc_short = "average position flag",
88 desc = "A flag specifying if the position of the atom is to be averaged across all models."
89 )
90 uf.add_keyarg(
91 name = "force",
92 default = False,
93 basic_types = ["bool"],
94 desc_short = "force flag",
95 desc = "A flag which if True will cause the current paramagnetic centre to be overwritten."
96 )
97
98 uf.desc.append(Desc_container())
99 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.")
100 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.")
101 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.")
102
103 uf.desc.append(Desc_container("Prompt examples"))
104 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:")
105 uf.desc[-1].add_prompt("relax> paramag.centre('Dy')")
106 uf.desc[-1].add_prompt("relax> paramag.centre(atom_id='Dy')")
107 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:")
108 uf.desc[-1].add_prompt("relax> paramag.centre(':4@C1')")
109 uf.desc[-1].add_paragraph("To state that the Dy3+ atomic position is [0.136, 12.543, 4.356], type one of:")
110 uf.desc[-1].add_prompt("relax> paramag.centre([0.136, 12.543, 4.356])")
111 uf.desc[-1].add_prompt("relax> paramag.centre(pos=[0.136, 12.543, 4.356])")
112 uf.desc[-1].add_paragraph("To find an unknown paramagnetic centre, type:")
113 uf.desc[-1].add_prompt("relax> paramag.centre(fix=False)")
114 uf.backend = paramag.centre
115 uf.menu_text = "¢re"
116 uf.wizard_height_desc = 400
117 uf.wizard_size = (1000, 750)
118 uf.wizard_apply_button = False
119 uf.wizard_image = WIZARD_IMAGE_PATH + 'align_tensor.png'
120