1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 """Module containing the 'noe' user function class."""
25 __docformat__ = 'plaintext'
26
27
28 from base_class import User_fn_class, _build_doc
29 import arg_check
30 from generic_fns import noesy
31 from specific_fns.setup import noe_obj
32
33
34 -class Noe(User_fn_class):
35 """Class for handling steady-state NOE and NOESY data."""
36
37 - def read_restraints(self, file=None, dir=None, proton1_col=None, proton2_col=None, lower_col=None, upper_col=None, sep=None):
38
39 if self._exec_info.intro:
40 text = self._exec_info.ps3 + "noe.read_restraints("
41 text = text + "file=" + repr(file)
42 text = text + ", dir=" + repr(dir)
43 text = text + ", proton1_col=" + repr(proton1_col)
44 text = text + ", proton2_col=" + repr(proton2_col)
45 text = text + ", lower_col=" + repr(lower_col)
46 text = text + ", upper_col=" + repr(upper_col)
47 text = text + ", sep=" + repr(sep) + ")"
48 print(text)
49
50
51 arg_check.is_str(file, 'file name')
52 arg_check.is_str(dir, 'directory name', can_be_none=True)
53 arg_check.is_int(proton1_col, 'first proton column', can_be_none=True)
54 arg_check.is_int(proton2_col, 'second proton column', can_be_none=True)
55 arg_check.is_int(lower_col, 'lower bound column', can_be_none=True)
56 arg_check.is_int(upper_col, 'upper bound column', can_be_none=True)
57 arg_check.is_str(sep, 'column separator', can_be_none=True)
58
59
60 noesy.read_restraints(file=file, dir=dir, proton1_col=proton1_col, proton2_col=proton2_col, lower_col=lower_col, upper_col=upper_col, sep=sep)
61
62
63 read_restraints._doc_title = "Read NOESY or ROESY restraints from a file."
64 read_restraints._doc_title_short = "Restraint reading."
65 read_restraints._doc_args = [
66 ["file", "The name of the file containing the restraint data."],
67 ["dir", "The directory where the file is located."],
68 ["proton1_col", "The column containing the first proton of the NOE or ROE cross peak."],
69 ["proton2_col", "The column containing the second proton of the NOE or ROE cross peak."],
70 ["lower_col", "The column containing the lower NOE bound."],
71 ["upper_col", "The column containing the upper NOE bound."],
72 ["sep", "The column separator (the default is white space)."]
73 ]
74 read_restraints._doc_desc = """
75 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.
76 """
77 read_restraints._doc_examples = """
78 To read the Xplor formatted restraint file 'NOE.xpl', type one of:
79
80 relax> noe.read_restraints('NOE.xpl')
81 relax> noe.read_restraints(file='NOE.xpl')
82
83
84 To read the generic formatted file 'noes', type one of:
85
86 relax> noe.read_restraints(file='NOE.xpl', proton1_col=0, proton2_col=1, lower_col=2, upper_col=3)
87 """
88 _build_doc(read_restraints)
89
90
105
106
107 spectrum_type._doc_title = "Set the steady-state NOE spectrum type for pre-loaded peak intensities."
108 spectrum_type._doc_title_short = "Steady-state NOE spectrum type."
109 spectrum_type._doc_args = [
110 ["spectrum_type", "The type of steady-state NOE spectrum, one of 'ref' for the reference spectrum or 'sat' for the saturated spectrum."],
111 ["spectrum_id", "The spectrum ID string."]
112 ]
113 spectrum_type._doc_desc = """
114 The spectrum type can be one of the following:
115
116 The steady-state NOE reference spectrum.
117 The steady-state NOE spectrum with proton saturation turned on.
118
119 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.
120 """
121 _build_doc(spectrum_type)
122