1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The noe user function definitions."""
24
25
26 import dep_check
27 if dep_check.wx_module:
28 from wx import FD_OPEN
29 else:
30 FD_OPEN = -1
31
32
33 from graphics import ANALYSIS_IMAGE_PATH
34 from pipe_control import noesy, spectrum
35 from specific_analyses.setup import noe_obj
36 from user_functions.data import Uf_info; uf_info = Uf_info()
37 from user_functions.objects import Desc_container
38
39
40
41 uf_class = uf_info.add_class('noe')
42 uf_class.title = "Class for handling steady-state NOE and NOESY data."
43 uf_class.menu_text = "&noe"
44 uf_class.gui_icon = "relax.noe"
45
46
47
48 uf = uf_info.add_uf('noe.read_restraints')
49 uf.title = "Read NOESY or ROESY restraints from a file."
50 uf.title_short = "Restraint reading."
51 uf.add_keyarg(
52 name = "file",
53 py_type = "str",
54 arg_type = "file sel",
55 desc_short = "file name",
56 desc = "The name of the file containing the restraint data.",
57 wiz_filesel_style = FD_OPEN
58 )
59 uf.add_keyarg(
60 name = "dir",
61 py_type = "str",
62 arg_type = "dir",
63 desc_short = "directory name",
64 desc = "The directory where the file is located.",
65 can_be_none = True
66 )
67 uf.add_keyarg(
68 name = "proton1_col",
69 py_type = "int",
70 desc_short = "first proton column",
71 desc = "The column containing the first proton of the NOE or ROE cross peak.",
72 wiz_element_type = "text",
73 can_be_none = True
74 )
75 uf.add_keyarg(
76 name = "proton2_col",
77 py_type = "int",
78 desc_short = "second proton column",
79 desc = "The column containing the second proton of the NOE or ROE cross peak.",
80 wiz_element_type = "text",
81 can_be_none = True
82 )
83 uf.add_keyarg(
84 name = "lower_col",
85 py_type = "int",
86 desc_short = "lower bound column",
87 desc = "The column containing the lower NOE bound.",
88 wiz_element_type = "text",
89 can_be_none = True
90 )
91 uf.add_keyarg(
92 name = "upper_col",
93 py_type = "int",
94 desc_short = "upper bound column",
95 desc = "The column containing the upper NOE bound.",
96 wiz_element_type = "text",
97 can_be_none = True
98 )
99 uf.add_keyarg(
100 name = "sep",
101 py_type = "str",
102 desc_short = "column separator",
103 desc = "The column separator (the default is white space).",
104 wiz_element_type = "combo",
105 wiz_combo_choices = [",", ";", "\\t"],
106 can_be_none = True
107 )
108
109 uf.desc.append(Desc_container())
110 uf.desc[-1].add_paragraph("The format of the file will be automatically determined, for example Xplor formatted restraint files. A generically formatted file is also supported if it contains minimally four columns with the two proton names and the upper and lower bounds, as specified by the column numbers. The proton names need to be in the spin ID string format.")
111
112 uf.desc.append(Desc_container("Prompt examples"))
113 uf.desc[-1].add_paragraph("To read the Xplor formatted restraint file 'NOE.xpl', type one of:")
114 uf.desc[-1].add_prompt("relax> noe.read_restraints('NOE.xpl')")
115 uf.desc[-1].add_prompt("relax> noe.read_restraints(file='NOE.xpl')")
116 uf.desc[-1].add_paragraph("To read the generic formatted file 'noes', type one of:")
117 uf.desc[-1].add_prompt("relax> noe.read_restraints(file='NOE.xpl', proton1_col=0, proton2_col=1, lower_col=2, upper_col=3)")
118 uf.backend = noesy.read_restraints
119 uf.menu_text = "&read_restraints"
120 uf.gui_icon = "oxygen.actions.document-open"
121 uf.wizard_size = (800, 600)
122 uf.wizard_image = ANALYSIS_IMAGE_PATH + 'noe_200x200.png'
123
124
125
126 uf = uf_info.add_uf('noe.spectrum_type')
127 uf.title = "Set the steady-state NOE spectrum type for pre-loaded peak intensities."
128 uf.title_short = "Steady-state NOE spectrum type."
129 uf.add_keyarg(
130 name = "spectrum_type",
131 py_type = "str",
132 desc_short = "spectrum type",
133 desc = "The type of steady-state NOE spectrum, one of 'ref' for the reference spectrum or 'sat' for the saturated spectrum.",
134 wiz_element_type = "combo",
135 wiz_combo_choices = ["Reference spectrum", "Saturated spectrum"],
136 wiz_combo_data = ["ref", "sat"],
137 wiz_read_only = True,
138 )
139 uf.add_keyarg(
140 name = "spectrum_id",
141 py_type = "str",
142 desc_short = "spectrum ID string",
143 desc = "The spectrum ID string.",
144 wiz_element_type = 'combo',
145 wiz_combo_iter = spectrum.get_ids,
146 wiz_read_only = True
147 )
148
149 uf.desc.append(Desc_container())
150 uf.desc[-1].add_paragraph("The spectrum type can be one of the following:")
151 uf.desc[-1].add_list_element("The steady-state NOE reference spectrum.")
152 uf.desc[-1].add_list_element("The steady-state NOE spectrum with proton saturation turned on.")
153 uf.desc[-1].add_paragraph("Peak intensities should be loaded before this user function via the spectrum.read_intensities user function. The intensity values will then be associated with a spectrum ID string which can be used here.")
154 uf.backend = noe_obj._spectrum_type
155 uf.menu_text = "&spectrum_type"
156 uf.gui_icon = "oxygen.actions.edit-rename"
157 uf.wizard_height_desc = 350
158 uf.wizard_size = (800, 600)
159 uf.wizard_image = ANALYSIS_IMAGE_PATH + 'noe_200x200.png'
160