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 holding the experimental information data container."""
25
26
27 from data_classes import RelaxListType, Element
28 from relax_errors import RelaxError
29
30
32 """The experimental information data container."""
33
35 """Initialise the data container."""
36
37
38 self.name = "exp_info"
39
40
41 self.desc = "Experimental information"
42
43
44 self.blacklist = ["citations", "software", "temp_calibration", "temp_control"]
45
46
47 - def add_citation(self, cite_id=None, authors=None, doi=None, pubmed_id=None, full_citation=None, title=None, status=None, type=None, journal_abbrev=None, journal_full=None, volume=None, issue=None, page_first=None, page_last=None, year=None):
48 """Store a citation.
49
50 @keyword cite_id: The citation ID string.
51 @type cite_id: str
52 @keyword authors: The list of authors. Each author element is a list of four elements: the first name, last name, first initial, and middle initials.
53 @type authors: list of lists of str
54 @keyword doi: The DOI number, e.g. "10.1000/182".
55 @type doi: None or str
56 @keyword pubmed_id: The identification code assigned to the publication by PubMed.
57 @type pubmed_id: None or int
58 @keyword full_citation: A full citation in a format similar to that used in a journal article by either cutting and pasting from another document or by typing. Please include author names, title, journal, page numbers, and year or equivalent information for the type of publication given.
59 @type full_citation: str
60 @keyword title: The title of the publication.
61 @type title: str
62 @keyword status: The publication status. Can be one of in "preparation", "in press", "published", "retracted", or "submitted".
63 @type status: str
64 @keyword type: The publication type. Can be one of "abstract", "BMRB only", "book", "book chapter", "internet", "journal", "personal communication", or "thesis".
65 @type type: str
66 @keyword journal_abbrev: A standard journal abbreviation as defined by the Chemical Abstract Services for the journal where the data are or will be published. If the data in the deposition are related to a J. Biomol. NMR paper, the value must be 'J. Biomol. NMR' to alert the BMRB annotators so that the deposition is properly processed. If the depositor truly does not know the journal, a value of 'not known' or 'na' is acceptable.
67 @type journal_abbrev: str
68 @keyword journal_full: The full journal name.
69 @type journal_full: str
70 @keyword volume: The volume number.
71 @type volume: int
72 @keyword issue: The issue number.
73 @type issue: int
74 @keyword page_first: The first page number.
75 @type page_first: int
76 @keyword page_last: The last page number.
77 @type page_last: int
78 @keyword year: The publication year.
79 @type year: int
80 """
81
82
83 if not hasattr(self, "citations"):
84
85 self.citations = RelaxListType()
86
87
88 self.citations.container_name = "citation_list"
89
90
91 self.citations.container_desc = "List of citations"
92
93
94 cite = Element()
95
96
97 cite.name = "citation"
98
99
100 cite.desc = "Literature citation"
101
102
103 cite.cite_id = cite_id
104 cite.authors = authors
105 cite.doi = doi
106 cite.pubmed_id = pubmed_id
107 cite.full_citation = full_citation
108 cite.title = title
109 cite.status = status
110 cite.type = type
111 cite.journal_abbrev = journal_abbrev
112 cite.journal_full = journal_full
113 cite.volume = volume
114 cite.issue = issue
115 cite.page_first = page_first
116 cite.page_last = page_last
117 cite.year = year
118
119
120 self.citations.append(cite)
121
122
124 """Return the citation ID number for the given citation ID string.
125
126 @param cite_id: The citation ID string.
127 @type cite_id: str
128 @return: The citation ID number.
129 @rtype: int
130 """
131
132
133 for i in range(len(self.citations)):
134
135 if self.citations[i].cite_id == cite_id:
136 return i + 1
137
138
140 """Store the peak intensity type.
141
142 @param ri_id: The relaxation data ID string.
143 @type ri_id: str
144 @param type: The peak intensity type, one of 'height' or 'volume'.
145 @type type: str
146 """
147
148
149 if not hasattr(self, "peak_intensity_type"):
150 self.peak_intensity_type = {}
151
152
153 self.peak_intensity_type[ri_id] = type
154
155
157 """Set up the thiol state of the system.
158
159 @param state: The thiol state of the molecule.
160 @type state: str
161 """
162
163
164 self.thiol_state = state
165
166
167 - def setup_script(self, file=None, dir=None, cite_ids=None, text=None, analysis_type=None, model_selection=None, engine=None, model_elim=False, universal_solution=False):
168 """Specify the scripts used in the analysis.
169
170 @keyword file: The name of the script file.
171 @type file: str
172 @keyword dir: The directory containing the file (defaults to the current directory if None).
173 @type dir: None or str
174 @keyword cite_ids: The citation ID numbers.
175 @type cite_ids: None or str
176 @param text: The script text.
177 @type text: str
178 @keyword analysis_type: The type of analysis performed.
179 @type analysis_type: str
180 @keyword model_selection: The model selection technique used, if relevant.
181 @type model_selection: None or str
182 @keyword engine: The software engine used in the analysis.
183 @type engine: str
184 @keyword model_elim: A model-free specific flag specifying if model elimination was performed.
185 @type model_elim: bool
186 @keyword universal_solution: A model-free specific flag specifying if the universal solution was sought after.
187 @type universal_solution: bool
188 """
189
190
191 if not hasattr(self, "scripts"):
192
193 self.scripts = RelaxListType()
194
195
196 self.scripts.container_name = "script_list"
197
198
199 self.scripts.container_desc = "List of scripts used for the analysis"
200
201
202 script = Element()
203
204
205 script.name = "script"
206
207
208 script.desc = "Script used for the analysis"
209
210
211 script.file = file
212 script.dir = dir
213 script.cite_ids = cite_ids
214 script.text = text
215 script.analysis_type = analysis_type
216 script.model_selection = model_selection
217 script.engine = engine
218 script.model_elim = model_elim
219 script.universal_solution = universal_solution
220
221
222 self.scripts.append(script)
223
224
225 - def software_setup(self, name, version=None, url=None, vendor_name=None, cite_ids=None, tasks=None):
226 """Set up the software information.
227
228 @param name: The name of the software program.
229 @type name: str
230 @keyword version: The program version.
231 @type version: None or str
232 @keyword url: The program's URL.
233 @type url: None or str
234 @keyword vendor_name: The name of the company or person behind the program.
235 @type vendor_name: str
236 @keyword cite_ids: The citation ID numbers.
237 @type cite_ids: None or str
238 @keyword tasks: The tasks performed by the program.
239 @type tasks: list of str
240 """
241
242
243 if not hasattr(self, "software"):
244
245 self.software = RelaxListType()
246
247
248 self.software.container_name = "software_list"
249
250
251 self.software.container_desc = "List of software programs used in the analysis"
252
253
254 software = Element()
255
256
257 software.name = "software"
258
259
260 software.desc = "Software program used in the analysis"
261
262
263 software.name = name
264 software.url = url
265 software.version = version
266 software.vendor_name = vendor_name
267 software.cite_ids = cite_ids
268 software.tasks = tasks
269
270
271 self.software.append(software)
272
273
275 """Store the temperature calibration method.
276
277 @param ri_id: The relaxation data ID string.
278 @type ri_id: str
279 @param method: The temperature calibration method.
280 @type method: str
281 """
282
283
284 if not hasattr(self, "temp_calibration"):
285 self.temp_calibration = {}
286
287
288 self.temp_calibration[ri_id] = method
289
290
292 """Store the temperature control method.
293
294 @param ri_id: The relaxation data ID string.
295 @type ri_id: str
296 @param method: The temperature control method.
297 @type method: str
298 """
299
300
301 if not hasattr(self, "temp_control"):
302 self.temp_control = {}
303
304
305 self.temp_control[ri_id] = method
306