line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MzML::Parser; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
18351
|
use v5.12; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
26
|
|
6
|
1
|
|
|
1
|
|
177
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use namespace::autoclean; |
8
|
|
|
|
|
|
|
use MzML::Registry; |
9
|
|
|
|
|
|
|
use MzML::MzML; |
10
|
|
|
|
|
|
|
use MzML::Cv; |
11
|
|
|
|
|
|
|
use MzML::CvList; |
12
|
|
|
|
|
|
|
use MzML::CvParam; |
13
|
|
|
|
|
|
|
use MzML::SourceFile; |
14
|
|
|
|
|
|
|
use MzML::SourceFileList; |
15
|
|
|
|
|
|
|
use MzML::ReferenceableParamGroupList; |
16
|
|
|
|
|
|
|
use MzML::ReferenceableParamGroup; |
17
|
|
|
|
|
|
|
use MzML::SampleList; |
18
|
|
|
|
|
|
|
use MzML::Sample; |
19
|
|
|
|
|
|
|
use MzML::InstrumentConfigurationList; |
20
|
|
|
|
|
|
|
use MzML::InstrumentConfiguration; |
21
|
|
|
|
|
|
|
use MzML::SoftwareList; |
22
|
|
|
|
|
|
|
use MzML::Software; |
23
|
|
|
|
|
|
|
use MzML::SoftwareParam; |
24
|
|
|
|
|
|
|
use MzML::ScanSettingsList; |
25
|
|
|
|
|
|
|
use MzML::ScanSettings; |
26
|
|
|
|
|
|
|
use MzML::DataProcessingList; |
27
|
|
|
|
|
|
|
use MzML::DataProcessing; |
28
|
|
|
|
|
|
|
use MzML::ProcessingMethod; |
29
|
|
|
|
|
|
|
use MzML::Run; |
30
|
|
|
|
|
|
|
use MzML::SourceFileRefList; |
31
|
|
|
|
|
|
|
use MzML::SpectrumList; |
32
|
|
|
|
|
|
|
use MzML::Spectrum; |
33
|
|
|
|
|
|
|
use MzML::ChromatogramList; |
34
|
|
|
|
|
|
|
use MzML::Chromatogram; |
35
|
|
|
|
|
|
|
use MzML::Scan; |
36
|
|
|
|
|
|
|
use MzML::ScanWindowList; |
37
|
|
|
|
|
|
|
use MzML::ScanWindow; |
38
|
|
|
|
|
|
|
use MzML::TargetList; |
39
|
|
|
|
|
|
|
use MzML::Target; |
40
|
|
|
|
|
|
|
use MzML::SourceFileRef; |
41
|
|
|
|
|
|
|
use MzML::PrecursorList; |
42
|
|
|
|
|
|
|
use MzML::Precursor; |
43
|
|
|
|
|
|
|
use MzML::Activation; |
44
|
|
|
|
|
|
|
use MzML::IsolationWindow; |
45
|
|
|
|
|
|
|
use MzML::SelectedIonList; |
46
|
|
|
|
|
|
|
use MzML::SelectedIon; |
47
|
|
|
|
|
|
|
use MzML::BinaryDataArrayList; |
48
|
|
|
|
|
|
|
use MzML::BinaryDataArray; |
49
|
|
|
|
|
|
|
use XML::Twig; |
50
|
|
|
|
|
|
|
use URI; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my $reg = MzML::Registry->new(); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub parse { |
57
|
|
|
|
|
|
|
my $self = shift; |
58
|
|
|
|
|
|
|
my $file = shift; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my %data; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $parser = XML::Twig->new( |
63
|
|
|
|
|
|
|
twig_handlers => |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
mzML => \&parse_mzml, |
66
|
|
|
|
|
|
|
cvList => \&parse_cvlist, |
67
|
|
|
|
|
|
|
fileContent => \&parse_filecontent, |
68
|
|
|
|
|
|
|
sourceFileList => \&parse_sourcefilelist, |
69
|
|
|
|
|
|
|
referenceableParamGroupList => \&parse_refparamgroup, |
70
|
|
|
|
|
|
|
sampleList => \&parse_samplelist, |
71
|
|
|
|
|
|
|
instrumentConfigurationList => \&parse_intrconflist, |
72
|
|
|
|
|
|
|
softwareList => \&parse_softwarelist, |
73
|
|
|
|
|
|
|
scanSettingsList => \&parse_scansettinglist, |
74
|
|
|
|
|
|
|
dataProcessingList => \&parse_dataproclist, |
75
|
|
|
|
|
|
|
run => \&parse_run, |
76
|
|
|
|
|
|
|
}, |
77
|
|
|
|
|
|
|
pretty_print => 'indented', |
78
|
|
|
|
|
|
|
); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$parser->parsefile($file); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
return $reg; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub parse_mzml { |
86
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
my $mzml = MzML::MzML->new(); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
$mzml->version($node->{'att'}->{'version'}); |
91
|
|
|
|
|
|
|
$mzml->id($node->{'att'}->{'id'}) if defined ($node->{'att'}->{'id'}); |
92
|
|
|
|
|
|
|
$mzml->accession($node->{'att'}->{'accession'}) if defined ($node->{'att'}->{'accession'}); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
$reg->mzML($mzml); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub parse_cvlist { |
98
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
my @cv = $node->children; |
101
|
|
|
|
|
|
|
my @list; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
for my $el ( @cv ) { |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
my $cv = MzML::Cv->new(); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
$cv->uri(my $uri = URI->new($el->{'att'}->{'URI'})); |
108
|
|
|
|
|
|
|
$cv->fullName($el->{'att'}->{'fullName'}); |
109
|
|
|
|
|
|
|
$cv->id($el->{'att'}->{'id'}); |
110
|
|
|
|
|
|
|
$cv->version($el->{'att'}->{'version'}) if defined ($el->{'att'}->{'version'}); |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
push(@list, $cv); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
my $cvlist = MzML::CvList->new(); |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
$cvlist->count($node->{'att'}->{'count'}); |
118
|
|
|
|
|
|
|
$cvlist->cv(\@list); |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
$reg->cvlist($cvlist); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub parse_filecontent { |
124
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
my @subnodes = $node->children; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
for my $el ( @subnodes ) { |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
if ( $el->name eq 'cvParam' ) { |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
my $cvp = get_cvParam($el); |
133
|
|
|
|
|
|
|
$reg->fileDescription->fileContent->cvParam($cvp); |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
} elsif ( $el->name eq 'referenceableParamGroupRef' ) { |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el); |
138
|
|
|
|
|
|
|
$reg->fileContent->referenceableParamGroupRef($ref); |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
} elsif ($el->name eq 'userParam' ) { |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
my $user = get_userParam($el); |
143
|
|
|
|
|
|
|
$reg->fileDescription->fileContent->userParam($user); |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub parse_sourcefilelist { |
151
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
my @subnodes = $node->children; |
154
|
|
|
|
|
|
|
my @list; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
for my $el ( @subnodes ) { |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
my $sf = MzML::SourceFile->new(); |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
$sf->id($el->{'att'}->{'id'}); |
161
|
|
|
|
|
|
|
$sf->name($el->{'att'}->{'name'}); |
162
|
|
|
|
|
|
|
$sf->location($el->{'att'}->{'location'}); |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
my @undernodes = $el->children; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
my @cvparam_list; |
167
|
|
|
|
|
|
|
my @reference_list; |
168
|
|
|
|
|
|
|
my @user_list; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
for my $subel ( @undernodes ) { |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
if ( $subel->name eq 'cvParam' ) { |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
my $cvp = get_cvParam($subel); |
175
|
|
|
|
|
|
|
push(@cvparam_list, $cvp); |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
} elsif ( $subel->name eq 'referenceableParamGroupRef' ) { |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($subel); |
180
|
|
|
|
|
|
|
push(@reference_list, $ref); |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
} elsif ($subel->name eq 'userParam' ) { |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
my $user = get_userParam($subel); |
185
|
|
|
|
|
|
|
push(@user_list, $user); |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
} |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
$sf->cvParam(\@cvparam_list); |
192
|
|
|
|
|
|
|
$sf->referenceableParamGroupRef(\@reference_list); |
193
|
|
|
|
|
|
|
$sf->userParam(\@user_list); |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
push(@list, $sf); |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
my $slist = MzML::SourceFileList->new(); |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
$slist->count($node->{'att'}->{'count'}); |
201
|
|
|
|
|
|
|
$slist->sourceFile(\@list); |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
$reg->fileDescription->sourceFileList($slist); |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
sub parse_refparamgroup { |
208
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
my @subnodes = $node->children; |
211
|
|
|
|
|
|
|
my @list; |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
for my $el ( @subnodes ) { |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
my $refgl = MzML::ReferenceableParamGroup->new(); |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
$refgl->id($el->{'att'}->{'id'}); |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
my @undernodes = $el->children; |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
my @cvparam_list; |
222
|
|
|
|
|
|
|
my @user_list; |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
for my $subel ( @undernodes ) { |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
if ( $subel->name eq 'cvParam' ) { |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
my $cvp = get_cvParam($subel); |
229
|
|
|
|
|
|
|
push(@cvparam_list, $cvp); |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
} elsif ($subel->name eq 'userParam' ) { |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
my $user = get_userParam($subel); |
234
|
|
|
|
|
|
|
push(@user_list, $user); |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
$refgl->cvParam(\@cvparam_list); |
241
|
|
|
|
|
|
|
$refgl->userParam(\@user_list); |
242
|
|
|
|
|
|
|
push(@list, $refgl); |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
my $refg = MzML::ReferenceableParamGroupList->new(); |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
$refg->count($node->{'att'}->{'count'}); |
249
|
|
|
|
|
|
|
$refg->referenceableParamGroup(\@list); |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
$reg->referenceableParamGroupList($refg); |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
} |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
sub parse_samplelist { |
256
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
my @subnodes = $node->children; |
259
|
|
|
|
|
|
|
my @list; |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
for my $el ( @subnodes ) { |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
my $sample = MzML::Sample->new(); |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
$sample->id($el->{'att'}->{'id'}); |
266
|
|
|
|
|
|
|
$sample->name($el->{'att'}->{'name'}) if defined($el->{'att'}->{'name'}); |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
my @undernodes = $el->children; |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
my @cvparam_list; |
271
|
|
|
|
|
|
|
my @reference_list; |
272
|
|
|
|
|
|
|
my @user_list; |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
for my $subel ( @undernodes ) { |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
if ( $subel->name eq 'cvParam' ) { |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
my $cvp = get_cvParam($subel); |
279
|
|
|
|
|
|
|
push(@cvparam_list, $cvp); |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
} elsif ( $subel->name eq 'referenceableParamGroupRef' ) { |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($subel); |
284
|
|
|
|
|
|
|
push(@reference_list, $ref); |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
} elsif ($subel->name eq 'userParam' ) { |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
my $user = get_userParam($subel); |
289
|
|
|
|
|
|
|
push(@user_list, $user); |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
$sample->cvParam(\@cvparam_list); |
296
|
|
|
|
|
|
|
$sample->referenceableParamGroupRef(\@reference_list); |
297
|
|
|
|
|
|
|
$sample->userParam(\@user_list); |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
push(@list, $sample); |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
my $sampl = MzML::SampleList->new(); |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
$sampl->count($node->{'att'}->{'count'}); |
306
|
|
|
|
|
|
|
$sampl->sample(\@list); |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
$reg->sampleList($sampl); |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
} |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
sub parse_intrconflist { |
313
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
my @subnodes_1 = $node->children; |
316
|
|
|
|
|
|
|
my @list; |
317
|
|
|
|
|
|
|
my @clist; |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
for my $el ( @subnodes_1 ) { |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
my $ic = MzML::InstrumentConfiguration->new(); |
322
|
|
|
|
|
|
|
$ic->id($el->{'att'}->{'id'}); |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
my @subnodes_2 = $el->children; |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
my $clist; |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
my @reference_list; |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
my $source; |
331
|
|
|
|
|
|
|
my $analyzer; |
332
|
|
|
|
|
|
|
my $detector; |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
for my $el2 ( @subnodes_2 ) { |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
if ( $el2->name eq 'referenceableParamGroupRef' ) { |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el2); |
339
|
|
|
|
|
|
|
push(@reference_list, $ref); |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'componentList' ) { |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
undef($source); |
344
|
|
|
|
|
|
|
undef($analyzer); |
345
|
|
|
|
|
|
|
undef($detector); |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
$clist = MzML::ComponentList->new(); |
348
|
|
|
|
|
|
|
$clist->count($el2->{'att'}->{'count'}); |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
my @subnodes_3 = $el2->children; |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
my (@source_cvparam_list, @analyzer_cvparam_list, @detector_cvparam_list); |
353
|
|
|
|
|
|
|
my (@source_reference_list, @analyzer_reference_list, @detector_reference_list); |
354
|
|
|
|
|
|
|
my (@source_user_list, @analyzer_user_list, @detector_user_list); |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
for my $el3 ( @subnodes_3 ) { |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
if ( $el3->name eq 'source' ) { |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
$source = MzML::Source->new(); |
361
|
|
|
|
|
|
|
$source->order($el3->{'att'}->{'order'}); |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
if ( $el4->name eq 'cvParam' ) { |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
my $cvp = get_cvParam($el4); |
370
|
|
|
|
|
|
|
push(@source_cvparam_list, $cvp); |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'referenceableParamGroupRef' ) { |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el4); |
375
|
|
|
|
|
|
|
push(@source_reference_list, $ref); |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
} elsif ($el4->name eq 'userParam' ) { |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
my $user = get_userParam($el4); |
380
|
|
|
|
|
|
|
push(@source_user_list, $user); |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
} |
383
|
|
|
|
|
|
|
} |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'analyzer' ) { |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
$analyzer = MzML::Analyzer->new(); |
388
|
|
|
|
|
|
|
$analyzer->order($el3->{'att'}->{'order'}); |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
if ( $el4->name eq 'cvParam' ) { |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
my $cvp = get_cvParam($el4); |
397
|
|
|
|
|
|
|
push(@analyzer_cvparam_list, $cvp); |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'referenceableParamGroupRef' ) { |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el4); |
402
|
|
|
|
|
|
|
push(@analyzer_reference_list, $ref); |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
} elsif ($el4->name eq 'userParam' ) { |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
my $user = get_userParam($el4); |
407
|
|
|
|
|
|
|
push(@analyzer_user_list, $user); |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
} |
410
|
|
|
|
|
|
|
} |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'detector' ) { |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
$detector = MzML::Detector->new(); |
415
|
|
|
|
|
|
|
$detector->order($el3->{'att'}->{'order'}); |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
if ( $el4->name eq 'cvParam' ) { |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
my $cvp = get_cvParam($el4); |
424
|
|
|
|
|
|
|
push(@detector_cvparam_list, $cvp); |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'referenceableParamGroupRef' ) { |
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el4); |
429
|
|
|
|
|
|
|
push(@detector_reference_list, $ref); |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
} elsif ($el4->name eq 'userParam' ) { |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
my $user = get_userParam($el4); |
434
|
|
|
|
|
|
|
push(@detector_user_list, $user); |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
} |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
} |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
}#end el3 |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
$source->cvParam(\@source_cvparam_list); |
444
|
|
|
|
|
|
|
$source->userParam(\@source_user_list); |
445
|
|
|
|
|
|
|
$source->referenceableParamGroupRef(\@source_reference_list); |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
$analyzer->cvParam(\@analyzer_cvparam_list); |
448
|
|
|
|
|
|
|
$analyzer->userParam(\@analyzer_user_list); |
449
|
|
|
|
|
|
|
$analyzer->referenceableParamGroupRef(\@analyzer_reference_list); |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
$detector->cvParam(\@detector_cvparam_list); |
452
|
|
|
|
|
|
|
$detector->userParam(\@detector_user_list); |
453
|
|
|
|
|
|
|
$detector->referenceableParamGroupRef(\@detector_reference_list); |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
$clist->source($source); |
456
|
|
|
|
|
|
|
$clist->analyzer($analyzer); |
457
|
|
|
|
|
|
|
$clist->detector($detector); |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
push(@clist, $clist); |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
$ic->componentList($clist); |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'softwareRef' ) { |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
my $software = MzML::SoftwareRef->new(); |
466
|
|
|
|
|
|
|
$software->ref($el2->{'att'}->{'ref'}); |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
$ic->softwareRef($software); |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
} |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
}# end el2 |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
push(@list, $ic); |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
}# end el |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
my $icl = MzML::InstrumentConfigurationList->new(); |
479
|
|
|
|
|
|
|
$icl->count($node->{'att'}->{'count'}); |
480
|
|
|
|
|
|
|
$icl->instrumentConfiguration(\@list); |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
$reg->instrumentConfigurationList($icl); |
483
|
|
|
|
|
|
|
} |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
sub parse_softwarelist { |
486
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
my @subnodes_1 = $node->children; |
489
|
|
|
|
|
|
|
my @list; |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
my $sw; |
492
|
|
|
|
|
|
|
my $sp; |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
for my $el1 ( @subnodes_1 ) { |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
if ( $el1->name eq 'software' ) { |
497
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
$sw = MzML::Software->new(); |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
$sw->id($el1->{'att'}->{'id'}) if defined ($el1->{'att'}->{'id'}); |
501
|
|
|
|
|
|
|
$sw->version($el1->{'att'}->{'version'}) if defined ($el1->{'att'}->{'version'}); |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
my @subnodes_2 = $el1->children; |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
my @cvparam; |
506
|
|
|
|
|
|
|
my @reference; |
507
|
|
|
|
|
|
|
my @userlist; |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
for my $el2 ( @subnodes_2 ) { |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
if ( $el2->name eq 'cvParam' ) { |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
my $cvp = get_cvParam($el2); |
514
|
|
|
|
|
|
|
push(@cvparam, $cvp); |
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'referenceableParamGroupRef' ) { |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el2); |
519
|
|
|
|
|
|
|
push(@reference, $ref); |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'userParam' ) { |
522
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
my $user = get_userParam($el2); |
524
|
|
|
|
|
|
|
push(@userlist, $user); |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
} |
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
}#end el2 |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
$sw->cvParam(\@cvparam); |
531
|
|
|
|
|
|
|
$sw->referenceableParamGroupRef(\@reference); |
532
|
|
|
|
|
|
|
$sw->userParam(\@userlist); |
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
} |
535
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
push(@list, $sw); |
537
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
}#end el1 |
539
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
my $swl = MzML::SoftwareList->new(); |
541
|
|
|
|
|
|
|
$swl->count($node->{'att'}->{'count'}); |
542
|
|
|
|
|
|
|
$swl->software(\@list); |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
$reg->softwareList($swl); |
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
} |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
sub parse_scansettinglist { |
549
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
my $scanSettingsList = MzML::ScanSettingsList->new(); |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
if ( $node->name eq 'scanSettingsList' ) { |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
$scanSettingsList->count($node->{'att'}->{'count'}); |
556
|
|
|
|
|
|
|
} |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
my @subnodes_1 = $node->children; |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
my $scanSettings; |
561
|
|
|
|
|
|
|
my @scansettingslist; |
562
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
for my $el1 ( @subnodes_1 ) { |
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
if ( $el1->name eq 'scanSettings' ) { |
566
|
|
|
|
|
|
|
#inside scansettings |
567
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
$scanSettings = MzML::ScanSettings->new(); |
569
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
$scanSettings->id($el1->{'att'}->{'id'}); |
571
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
my @subnodes_2 = $el1->children; |
573
|
|
|
|
|
|
|
|
574
|
|
|
|
|
|
|
my @cvparam_el2; |
575
|
|
|
|
|
|
|
my @reference_el2; |
576
|
|
|
|
|
|
|
my @user_el2; |
577
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
my $sourceFileRefList; |
579
|
|
|
|
|
|
|
my $sourceFileRef; |
580
|
|
|
|
|
|
|
my @sourcefilelist; |
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
my $targetList; |
583
|
|
|
|
|
|
|
my $target; |
584
|
|
|
|
|
|
|
my @targetlist; |
585
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
for my $el2 ( @subnodes_2 ) { |
587
|
|
|
|
|
|
|
#inside scansettings tag |
588
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
if ( $el2->name eq 'cvParam' ) { |
590
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
my $cvp = get_cvParam($el2); |
592
|
|
|
|
|
|
|
push(@cvparam_el2, $cvp); |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'referenceableParamGroupRef' ) { |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el2); |
597
|
|
|
|
|
|
|
push(@reference_el2, $ref); |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'userParam' ) { |
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
my $user = get_userParam($el2); |
602
|
|
|
|
|
|
|
push(@user_el2, $user); |
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'sourceFileRefList' ) { |
605
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
$sourceFileRefList = MzML::SourceFileRefList->new(); |
607
|
|
|
|
|
|
|
|
608
|
|
|
|
|
|
|
my $el3 = $el2->first_child; |
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
$sourceFileRef = MzML::SourceFileRef->new(); |
611
|
|
|
|
|
|
|
$sourceFileRef->ref($el3->{'att'}->{'ref'}); |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
push(@sourcefilelist, $sourceFileRef); |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
} elsif ( $el2->name eq 'targetList' ) { |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
$targetList = MzML::TargetList->new(); |
618
|
|
|
|
|
|
|
$targetList->count($el2->{'att'}->{'count'}); |
619
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
my @subnodes_3 = $el2->children; |
621
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
for my $el3 ( @subnodes_3 ) { |
623
|
|
|
|
|
|
|
#inside targetlist tag |
624
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
$target = MzML::Target->new(); |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
my @cvparam_el4; |
628
|
|
|
|
|
|
|
my @reference_el4; |
629
|
|
|
|
|
|
|
my @user_el4; |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
634
|
|
|
|
|
|
|
#inside target tag |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
if ( $el4->name eq 'cvParam' ) { |
637
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
my $cvp = get_cvParam($el4); |
639
|
|
|
|
|
|
|
push(@cvparam_el4, $cvp); |
640
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'referenceableParamGroupRef' ) { |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el4); |
644
|
|
|
|
|
|
|
push(@reference_el4, $ref); |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'userParam' ) { |
647
|
|
|
|
|
|
|
|
648
|
|
|
|
|
|
|
my $user = get_userParam($el4); |
649
|
|
|
|
|
|
|
push(@user_el4, $user); |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
} |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
}#end el4 |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
$target->cvParam(\@cvparam_el4); |
656
|
|
|
|
|
|
|
$target->referenceableParamGroupRef(\@reference_el4); |
657
|
|
|
|
|
|
|
$target->userParam(\@user_el4); |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
push(@targetlist, $target); |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
|
662
|
|
|
|
|
|
|
}#end el3 |
663
|
|
|
|
|
|
|
|
664
|
|
|
|
|
|
|
} |
665
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
}#end el2 |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
$targetList->target(\@targetlist); |
669
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
$sourceFileRefList->sourceFileRef(\@sourcefilelist); |
671
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
$scanSettings->targetList($targetList); |
673
|
|
|
|
|
|
|
$scanSettings->sourceFileRefList($sourceFileRefList); |
674
|
|
|
|
|
|
|
$scanSettings->cvParam(\@cvparam_el2); |
675
|
|
|
|
|
|
|
$scanSettings->referenceableParamGroupRef(\@reference_el2); |
676
|
|
|
|
|
|
|
$scanSettings->userParam(\@user_el2); |
677
|
|
|
|
|
|
|
|
678
|
|
|
|
|
|
|
push(@scansettingslist, $scanSettings); |
679
|
|
|
|
|
|
|
|
680
|
|
|
|
|
|
|
}#end el1 |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
} |
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
$scanSettingsList->scanSettings(\@scansettingslist); |
685
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
$reg->scanSettingsList($scanSettingsList); |
687
|
|
|
|
|
|
|
} |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
sub parse_dataproclist { |
690
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
691
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
my @subnodes_1 = $node->children; |
693
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
my @list; |
695
|
|
|
|
|
|
|
my @dataplist; |
696
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
my $datap; |
698
|
|
|
|
|
|
|
my $proc; |
699
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
for my $el1 ( @subnodes_1 ) { |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
$datap = MzML::DataProcessing->new(); |
703
|
|
|
|
|
|
|
$datap->id($el1->{'att'}->{'id'}); |
704
|
|
|
|
|
|
|
|
705
|
|
|
|
|
|
|
my @subnodes_2 = $el1->children; |
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
for my $el2 ( @subnodes_2 ) { |
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
if ( $el2->name eq 'processingMethod' ) { |
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
$proc = MzML::ProcessingMethod->new(); |
712
|
|
|
|
|
|
|
$proc->order($el2->{'att'}->{'order'}); |
713
|
|
|
|
|
|
|
|
714
|
|
|
|
|
|
|
my @subnodes_3 = $el2->children; |
715
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
my @cvparam_list; |
717
|
|
|
|
|
|
|
my @reference_list; |
718
|
|
|
|
|
|
|
my @user_list; |
719
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
for my $el3 ( @subnodes_3 ) { |
721
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
if ( $el3->name eq 'cvParam' ) { |
723
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
my $cvp = get_cvParam($el3); |
725
|
|
|
|
|
|
|
push(@cvparam_list, $cvp); |
726
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'referenceableParamGroupRef' ) { |
728
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el3); |
730
|
|
|
|
|
|
|
push(@reference_list, $ref); |
731
|
|
|
|
|
|
|
|
732
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'userParam' ) { |
733
|
|
|
|
|
|
|
|
734
|
|
|
|
|
|
|
my $user = get_userParam($el3); |
735
|
|
|
|
|
|
|
push(@user_list, $user); |
736
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
} |
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
}#end el3 |
740
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
$proc->cvParam(\@cvparam_list); |
742
|
|
|
|
|
|
|
$proc->userParam(\@user_list); |
743
|
|
|
|
|
|
|
$proc->referenceableParamGroupRef(\@reference_list); |
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
push(@dataplist, $proc); |
746
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
} |
748
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
}#end el2 |
750
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
$datap->processingMethod(\@dataplist); |
752
|
|
|
|
|
|
|
push(@list, $datap); |
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
}#end el1 |
755
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
my $dpl = MzML::DataProcessingList->new(); |
757
|
|
|
|
|
|
|
$dpl->count($node->{'att'}->{'count'}); |
758
|
|
|
|
|
|
|
$dpl->dataProcessing(\@list); |
759
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
$reg->dataProcessingList($dpl); |
761
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
} |
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
sub parse_run { |
765
|
|
|
|
|
|
|
my ($parser, $node) = @_; |
766
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
my $run = MzML::Run->new(); |
768
|
|
|
|
|
|
|
$run->defaultInstrumentConfigurationRef($node->{'att'}->{'defaultInstrumentConfigurationRef'}); |
769
|
|
|
|
|
|
|
$run->id($node->{'att'}->{'id'}); |
770
|
|
|
|
|
|
|
$run->sampleRef($node->{'att'}->{'sampleRef'}) if defined $node->{'att'}->{'sampleRef'}; |
771
|
|
|
|
|
|
|
$run->startTimeStamp($node->{'att'}->{'startTimeStamp'}) if defined $node->{'att'}->{'startTimeStamp'}; |
772
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
my @subnodes_1 = $node->children; |
774
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
my @cvparam_list; |
776
|
|
|
|
|
|
|
my @reference_list; |
777
|
|
|
|
|
|
|
my @user_list; |
778
|
|
|
|
|
|
|
|
779
|
|
|
|
|
|
|
my $sfrl; |
780
|
|
|
|
|
|
|
my $sl; |
781
|
|
|
|
|
|
|
my $cl; |
782
|
|
|
|
|
|
|
|
783
|
|
|
|
|
|
|
for my $el1 ( @subnodes_1 ) { |
784
|
|
|
|
|
|
|
|
785
|
|
|
|
|
|
|
if ( $el1->name eq 'sourceFileRefList' ) { |
786
|
|
|
|
|
|
|
|
787
|
|
|
|
|
|
|
#$sfrl = MzML::SourceFileRefList->new(); |
788
|
|
|
|
|
|
|
#TODO not implemented |
789
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
} elsif ( $el1->name eq 'spectrumList' ) { |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
$sl = MzML::SpectrumList->new(); |
793
|
|
|
|
|
|
|
|
794
|
|
|
|
|
|
|
$sl->count($el1->{'att'}->{'count'}); |
795
|
|
|
|
|
|
|
$sl->defaultDataProcessingRef($el1->{'att'}->{'defaultDataProcessingRef'}); |
796
|
|
|
|
|
|
|
|
797
|
|
|
|
|
|
|
my @subnodes_2 = $el1->children; |
798
|
|
|
|
|
|
|
my @spectrum; |
799
|
|
|
|
|
|
|
|
800
|
|
|
|
|
|
|
for my $el2 ( @subnodes_2 ) { |
801
|
|
|
|
|
|
|
#inside spectrumlist tag |
802
|
|
|
|
|
|
|
|
803
|
|
|
|
|
|
|
if ( $el2->name eq 'spectrum' ) { |
804
|
|
|
|
|
|
|
|
805
|
|
|
|
|
|
|
my $spec = MzML::Spectrum->new(); |
806
|
|
|
|
|
|
|
|
807
|
|
|
|
|
|
|
$spec->dataProcessingRef($el2->{'att'}->{'dataProcessingRef'}) if defined $el2->{'att'}->{'dataProcessingRef'}; |
808
|
|
|
|
|
|
|
$spec->defaultArrayLength($el2->{'att'}->{'defaultArrayLength'}); |
809
|
|
|
|
|
|
|
$spec->id($el2->{'att'}->{'defaultArrayLength'}); |
810
|
|
|
|
|
|
|
$spec->index($el2->{'att'}->{'index'}); |
811
|
|
|
|
|
|
|
$spec->nativeID($el2->{'att'}->{'nativeID'}) if defined $el2->{'att'}->{'nativeID'};; |
812
|
|
|
|
|
|
|
$spec->sourceFileRef($el2->{'att'}->{'sourceFileRef'}) if defined $el2->{'att'}->{'sourceFileRef'}; |
813
|
|
|
|
|
|
|
$spec->spotID($el2->{'att'}->{'spotID'}) if defined $el2->{'att'}->{'spotID'}; |
814
|
|
|
|
|
|
|
|
815
|
|
|
|
|
|
|
my @subnodes_3 = $el2->children; |
816
|
|
|
|
|
|
|
my @cvparam; |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
my @cvparam_el3; |
819
|
|
|
|
|
|
|
my @reference_el3; |
820
|
|
|
|
|
|
|
my @user_el3; |
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
my $binaryDataArrayList; |
823
|
|
|
|
|
|
|
my $binaryDataArray; |
824
|
|
|
|
|
|
|
my @binarylist; |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
for my $el3 ( @subnodes_3 ) { |
827
|
|
|
|
|
|
|
#inside spectrum tag |
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
if ( $el3->name eq 'cvParam' ) { |
830
|
|
|
|
|
|
|
|
831
|
|
|
|
|
|
|
my $cvp = get_cvParam($el3); |
832
|
|
|
|
|
|
|
push(@cvparam_el3, $cvp); |
833
|
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'referenceableParamGroupRef' ) { |
835
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el3); |
837
|
|
|
|
|
|
|
push(@reference_el3, $ref); |
838
|
|
|
|
|
|
|
|
839
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'userParam' ) { |
840
|
|
|
|
|
|
|
|
841
|
|
|
|
|
|
|
my $user = get_userParam($el3); |
842
|
|
|
|
|
|
|
push(@user_el3, $user); |
843
|
|
|
|
|
|
|
|
844
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'scanList' ) { |
845
|
|
|
|
|
|
|
|
846
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
847
|
|
|
|
|
|
|
|
848
|
|
|
|
|
|
|
my @cvparam; |
849
|
|
|
|
|
|
|
my @reference; |
850
|
|
|
|
|
|
|
my @user; |
851
|
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
my $scanlist; |
853
|
|
|
|
|
|
|
my @scans; |
854
|
|
|
|
|
|
|
|
855
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
856
|
|
|
|
|
|
|
#inside scanlist tag |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
$scanlist = MzML::ScanList->new(); |
859
|
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
if ( $el4->name eq 'cvParam' ) { |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
my $cvp = get_cvParam($el4); |
863
|
|
|
|
|
|
|
push(@cvparam, $cvp); |
864
|
|
|
|
|
|
|
|
865
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'referenceableParamGroupRef' ) { |
866
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el4); |
868
|
|
|
|
|
|
|
push(@reference, $ref); |
869
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'userParam' ) { |
871
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
my $user = get_userParam($el4); |
873
|
|
|
|
|
|
|
push(@user, $user); |
874
|
|
|
|
|
|
|
|
875
|
|
|
|
|
|
|
} elsif ( $el4->name eq 'scan' ) { |
876
|
|
|
|
|
|
|
|
877
|
|
|
|
|
|
|
my $scan = MzML::Scan->new(); |
878
|
|
|
|
|
|
|
my @subnodes_5 = $el4->children; |
879
|
|
|
|
|
|
|
|
880
|
|
|
|
|
|
|
my @cvparam; |
881
|
|
|
|
|
|
|
my @reference; |
882
|
|
|
|
|
|
|
my @user; |
883
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
my $swl; |
885
|
|
|
|
|
|
|
my @scanwindows; |
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
for my $el5 ( @subnodes_5 ) { |
888
|
|
|
|
|
|
|
#inside scan tag |
889
|
|
|
|
|
|
|
|
890
|
|
|
|
|
|
|
if ( $el5->name eq 'cvParam' ) { |
891
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
my $cvp = get_cvParam($el5); |
893
|
|
|
|
|
|
|
push(@cvparam, $cvp); |
894
|
|
|
|
|
|
|
|
895
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'referenceableParamGroupRef' ) { |
896
|
|
|
|
|
|
|
|
897
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el5); |
898
|
|
|
|
|
|
|
push(@reference, $ref); |
899
|
|
|
|
|
|
|
|
900
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'userParam' ) { |
901
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
my $user = get_userParam($el5); |
903
|
|
|
|
|
|
|
push(@user, $user); |
904
|
|
|
|
|
|
|
|
905
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'scanWindowList' ) { |
906
|
|
|
|
|
|
|
|
907
|
|
|
|
|
|
|
$swl = MzML::ScanWindowList->new(); |
908
|
|
|
|
|
|
|
$swl->count($el5->{'att'}->{'count'}); |
909
|
|
|
|
|
|
|
|
910
|
|
|
|
|
|
|
} |
911
|
|
|
|
|
|
|
|
912
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
}#end el5 |
914
|
|
|
|
|
|
|
|
915
|
|
|
|
|
|
|
$scan->cvParam(\@cvparam); |
916
|
|
|
|
|
|
|
$scan->referenceableParamGroupRef(\@reference); |
917
|
|
|
|
|
|
|
$scan->userParam(\@user); |
918
|
|
|
|
|
|
|
$scan->scanWindowList($swl); |
919
|
|
|
|
|
|
|
|
920
|
|
|
|
|
|
|
push(@scans, $scan); |
921
|
|
|
|
|
|
|
|
922
|
|
|
|
|
|
|
} |
923
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
}#end el4 |
925
|
|
|
|
|
|
|
|
926
|
|
|
|
|
|
|
$scanlist->cvParam(\@cvparam); |
927
|
|
|
|
|
|
|
$scanlist->referenceableParamGroupRef(\@reference); |
928
|
|
|
|
|
|
|
$scanlist->userParam(\@user); |
929
|
|
|
|
|
|
|
$scanlist->scan(\@scans); |
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
$spec->scanList($scanlist); |
932
|
|
|
|
|
|
|
|
933
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'precursorList' ) { |
934
|
|
|
|
|
|
|
|
935
|
|
|
|
|
|
|
my $precursorlist = MzML::PrecursorList->new(); |
936
|
|
|
|
|
|
|
$precursorlist->count($el3->{'att'}->{'count'}); |
937
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
939
|
|
|
|
|
|
|
|
940
|
|
|
|
|
|
|
my $precursor; |
941
|
|
|
|
|
|
|
my @precursorlist; |
942
|
|
|
|
|
|
|
|
943
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
944
|
|
|
|
|
|
|
#inside precursorlist tag |
945
|
|
|
|
|
|
|
|
946
|
|
|
|
|
|
|
if ( $el4->name eq 'precursor' ) { |
947
|
|
|
|
|
|
|
|
948
|
|
|
|
|
|
|
my $precursor = MzML::Precursor->new(); |
949
|
|
|
|
|
|
|
$precursor->spectrumRef($el4->{'att'}->{'spectrumRef'}); |
950
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
my @subnodes_5 = $el4->children; |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
my $activation; |
954
|
|
|
|
|
|
|
my $isolation; |
955
|
|
|
|
|
|
|
my $selectedIonList; |
956
|
|
|
|
|
|
|
my $selectedIon; |
957
|
|
|
|
|
|
|
my @ionlist; |
958
|
|
|
|
|
|
|
|
959
|
|
|
|
|
|
|
for my $el5 ( @subnodes_5 ) { |
960
|
|
|
|
|
|
|
#inside precursor tag |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
my (@activation_cvparam, @isolation_cvparam); |
963
|
|
|
|
|
|
|
my (@activation_reference, @isolation_reference); |
964
|
|
|
|
|
|
|
my (@activation_user, @isolation_user); |
965
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
if ( $el5->name eq 'activation' ) { |
967
|
|
|
|
|
|
|
|
968
|
|
|
|
|
|
|
$activation = MzML::Activation->new(); |
969
|
|
|
|
|
|
|
|
970
|
|
|
|
|
|
|
my @subnodes_6 = $el5->children; |
971
|
|
|
|
|
|
|
|
972
|
|
|
|
|
|
|
for my $el6 ( @subnodes_6 ) { |
973
|
|
|
|
|
|
|
#inside activation tag |
974
|
|
|
|
|
|
|
|
975
|
|
|
|
|
|
|
if ( $el6->name eq 'cvParam' ) { |
976
|
|
|
|
|
|
|
|
977
|
|
|
|
|
|
|
my $cvp = get_cvParam($el6); |
978
|
|
|
|
|
|
|
push(@activation_cvparam, $cvp); |
979
|
|
|
|
|
|
|
|
980
|
|
|
|
|
|
|
} elsif ( $el6->name eq 'referenceableParamGroupRef' ) { |
981
|
|
|
|
|
|
|
|
982
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el6); |
983
|
|
|
|
|
|
|
push(@activation_reference, $ref); |
984
|
|
|
|
|
|
|
|
985
|
|
|
|
|
|
|
} elsif ( $el6->name eq 'userParam' ) { |
986
|
|
|
|
|
|
|
|
987
|
|
|
|
|
|
|
my $user = get_userParam($el6); |
988
|
|
|
|
|
|
|
push(@activation_user, $user); |
989
|
|
|
|
|
|
|
|
990
|
|
|
|
|
|
|
} |
991
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
}#end el6 |
993
|
|
|
|
|
|
|
|
994
|
|
|
|
|
|
|
$activation->cvParam(\@activation_cvparam); |
995
|
|
|
|
|
|
|
$activation->referenceableParamGroupRef(\@activation_reference); |
996
|
|
|
|
|
|
|
$activation->userParam(\@activation_user); |
997
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'isolationWindow' ) { |
999
|
|
|
|
|
|
|
|
1000
|
|
|
|
|
|
|
$isolation = MzML::IsolationWindow->new(); |
1001
|
|
|
|
|
|
|
|
1002
|
|
|
|
|
|
|
my @subnodes_6 = $el5->children; |
1003
|
|
|
|
|
|
|
|
1004
|
|
|
|
|
|
|
for my $el6 ( @subnodes_6 ) { |
1005
|
|
|
|
|
|
|
#inside activation tag |
1006
|
|
|
|
|
|
|
|
1007
|
|
|
|
|
|
|
if ( $el6->name eq 'cvParam' ) { |
1008
|
|
|
|
|
|
|
|
1009
|
|
|
|
|
|
|
my $cvp = get_cvParam($el6); |
1010
|
|
|
|
|
|
|
push(@activation_cvparam, $cvp); |
1011
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
} elsif ( $el6->name eq 'referenceableParamGroupRef' ) { |
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el6); |
1015
|
|
|
|
|
|
|
push(@activation_reference, $ref); |
1016
|
|
|
|
|
|
|
|
1017
|
|
|
|
|
|
|
} elsif ( $el6->name eq 'userParam' ) { |
1018
|
|
|
|
|
|
|
|
1019
|
|
|
|
|
|
|
my $user = get_userParam($el6); |
1020
|
|
|
|
|
|
|
push(@activation_user, $user); |
1021
|
|
|
|
|
|
|
|
1022
|
|
|
|
|
|
|
} |
1023
|
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
}#end el6 |
1025
|
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
$isolation->cvParam(\@activation_cvparam); |
1027
|
|
|
|
|
|
|
$isolation->referenceableParamGroupRef(\@activation_reference); |
1028
|
|
|
|
|
|
|
$isolation->userParam(\@activation_user); |
1029
|
|
|
|
|
|
|
|
1030
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'selectedIonList' ) { |
1031
|
|
|
|
|
|
|
|
1032
|
|
|
|
|
|
|
$selectedIonList = MzML::SelectedIonList->new(); |
1033
|
|
|
|
|
|
|
$selectedIonList->count($el5->{'att'}->{'count'}); |
1034
|
|
|
|
|
|
|
|
1035
|
|
|
|
|
|
|
my @subnodes_6 = $el5->children; |
1036
|
|
|
|
|
|
|
|
1037
|
|
|
|
|
|
|
for my $el6 ( @subnodes_6 ) { |
1038
|
|
|
|
|
|
|
#inside selectedionlist tag |
1039
|
|
|
|
|
|
|
|
1040
|
|
|
|
|
|
|
if ( $el6->name eq 'selectedIon' ) { |
1041
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
$selectedIon = MzML::SelectedIon->new(); |
1043
|
|
|
|
|
|
|
|
1044
|
|
|
|
|
|
|
my @subnodes_7 = $el6->children; |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
my @cvparam_el7; |
1047
|
|
|
|
|
|
|
my @reference_el7; |
1048
|
|
|
|
|
|
|
my @user_el7; |
1049
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
for my $el7 ( @subnodes_7 ) { |
1051
|
|
|
|
|
|
|
#inside selectedIon tag |
1052
|
|
|
|
|
|
|
|
1053
|
|
|
|
|
|
|
if ( $el7->name eq 'cvParam' ) { |
1054
|
|
|
|
|
|
|
|
1055
|
|
|
|
|
|
|
my $cvp = get_cvParam($el7); |
1056
|
|
|
|
|
|
|
push(@cvparam_el7, $cvp); |
1057
|
|
|
|
|
|
|
|
1058
|
|
|
|
|
|
|
} elsif ( $el7->name eq 'referenceableParamGroupRef' ) { |
1059
|
|
|
|
|
|
|
|
1060
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el7); |
1061
|
|
|
|
|
|
|
push(@reference_el7, $ref); |
1062
|
|
|
|
|
|
|
|
1063
|
|
|
|
|
|
|
} elsif ( $el7->name eq 'userParam' ) { |
1064
|
|
|
|
|
|
|
|
1065
|
|
|
|
|
|
|
my $user = get_userParam($el7); |
1066
|
|
|
|
|
|
|
push(@user_el7, $user); |
1067
|
|
|
|
|
|
|
|
1068
|
|
|
|
|
|
|
} |
1069
|
|
|
|
|
|
|
|
1070
|
|
|
|
|
|
|
}#end el7 |
1071
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
$selectedIon->cvParam(\@cvparam_el7); |
1073
|
|
|
|
|
|
|
|
1074
|
|
|
|
|
|
|
} |
1075
|
|
|
|
|
|
|
|
1076
|
|
|
|
|
|
|
push(@ionlist, $selectedIon); |
1077
|
|
|
|
|
|
|
|
1078
|
|
|
|
|
|
|
}#end el6 |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
$selectedIonList->selectedIon(\@ionlist); |
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
} |
1083
|
|
|
|
|
|
|
|
1084
|
|
|
|
|
|
|
}#end el5 |
1085
|
|
|
|
|
|
|
|
1086
|
|
|
|
|
|
|
|
1087
|
|
|
|
|
|
|
$precursor->activation($activation); |
1088
|
|
|
|
|
|
|
$precursor->isolationWindow($isolation); |
1089
|
|
|
|
|
|
|
$precursor->selectedIonList($selectedIonList); |
1090
|
|
|
|
|
|
|
|
1091
|
|
|
|
|
|
|
push(@precursorlist, $precursor); |
1092
|
|
|
|
|
|
|
} |
1093
|
|
|
|
|
|
|
|
1094
|
|
|
|
|
|
|
}#end el4 |
1095
|
|
|
|
|
|
|
|
1096
|
|
|
|
|
|
|
$precursorlist->precursor(\@precursorlist); |
1097
|
|
|
|
|
|
|
|
1098
|
|
|
|
|
|
|
$spec->precursorList($precursorlist); |
1099
|
|
|
|
|
|
|
|
1100
|
|
|
|
|
|
|
|
1101
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'productList' ) { |
1102
|
|
|
|
|
|
|
|
1103
|
|
|
|
|
|
|
#TODO : no example provided to create this parsing |
1104
|
|
|
|
|
|
|
|
1105
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'binaryDataArrayList' ) { |
1106
|
|
|
|
|
|
|
|
1107
|
|
|
|
|
|
|
$binaryDataArrayList = MzML::BinaryDataArrayList->new(); |
1108
|
|
|
|
|
|
|
$binaryDataArrayList->count($el3->{'att'}->{'count'}); |
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
1111
|
|
|
|
|
|
|
|
1112
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
1113
|
|
|
|
|
|
|
#inside binarydataarraylist |
1114
|
|
|
|
|
|
|
|
1115
|
|
|
|
|
|
|
if ( $el4->name eq 'binaryDataArray' ) { |
1116
|
|
|
|
|
|
|
|
1117
|
|
|
|
|
|
|
$binaryDataArray = MzML::BinaryDataArray->new(); |
1118
|
|
|
|
|
|
|
$binaryDataArray->encodedLength($el4->{'att'}->{'encodedLength'}); |
1119
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
my @subnodes_5 = $el4->children; |
1121
|
|
|
|
|
|
|
|
1122
|
|
|
|
|
|
|
my @cvparam_el5; |
1123
|
|
|
|
|
|
|
my @reference_el5; |
1124
|
|
|
|
|
|
|
my @user_el5; |
1125
|
|
|
|
|
|
|
|
1126
|
|
|
|
|
|
|
for my $el5 ( @subnodes_5 ) { |
1127
|
|
|
|
|
|
|
#inside binaryDataArray |
1128
|
|
|
|
|
|
|
|
1129
|
|
|
|
|
|
|
if ( $el5->name eq 'cvParam' ) { |
1130
|
|
|
|
|
|
|
|
1131
|
|
|
|
|
|
|
my $cvp = get_cvParam($el5); |
1132
|
|
|
|
|
|
|
push(@cvparam_el5, $cvp); |
1133
|
|
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'referenceableParamGroupRef' ) { |
1135
|
|
|
|
|
|
|
|
1136
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el5); |
1137
|
|
|
|
|
|
|
push(@reference_el5, $ref); |
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'userParam' ) { |
1140
|
|
|
|
|
|
|
|
1141
|
|
|
|
|
|
|
my $user = get_userParam($el5); |
1142
|
|
|
|
|
|
|
push(@user_el5, $user); |
1143
|
|
|
|
|
|
|
|
1144
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'binary' ) { |
1145
|
|
|
|
|
|
|
|
1146
|
|
|
|
|
|
|
$binaryDataArray->binary($el5->text); |
1147
|
|
|
|
|
|
|
} |
1148
|
|
|
|
|
|
|
|
1149
|
|
|
|
|
|
|
}#end el5 |
1150
|
|
|
|
|
|
|
|
1151
|
|
|
|
|
|
|
$binaryDataArray->cvParam(\@cvparam_el5); |
1152
|
|
|
|
|
|
|
|
1153
|
|
|
|
|
|
|
push(@binarylist, $binaryDataArray); |
1154
|
|
|
|
|
|
|
} |
1155
|
|
|
|
|
|
|
|
1156
|
|
|
|
|
|
|
}#end el4 |
1157
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
$binaryDataArrayList->binaryDataArray(\@binarylist); |
1159
|
|
|
|
|
|
|
$spec->binaryDataArrayList($binaryDataArrayList); |
1160
|
|
|
|
|
|
|
|
1161
|
|
|
|
|
|
|
} |
1162
|
|
|
|
|
|
|
|
1163
|
|
|
|
|
|
|
|
1164
|
|
|
|
|
|
|
}#end el3 |
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
$spec->cvParam(\@cvparam_el3); |
1167
|
|
|
|
|
|
|
$spec->referenceableParamGroupRef(\@reference_el3); |
1168
|
|
|
|
|
|
|
$spec->userParam(\@user_el3); |
1169
|
|
|
|
|
|
|
|
1170
|
|
|
|
|
|
|
push(@spectrum, $spec); |
1171
|
|
|
|
|
|
|
|
1172
|
|
|
|
|
|
|
} |
1173
|
|
|
|
|
|
|
|
1174
|
|
|
|
|
|
|
$sl->spectrum(\@spectrum); |
1175
|
|
|
|
|
|
|
|
1176
|
|
|
|
|
|
|
}#end el2 |
1177
|
|
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
|
1179
|
|
|
|
|
|
|
} elsif ( $el1->name eq 'chromatogramList' ) { |
1180
|
|
|
|
|
|
|
|
1181
|
|
|
|
|
|
|
$cl = MzML::ChromatogramList->new(); |
1182
|
|
|
|
|
|
|
$cl->count($el1->{'att'}->{'count'}); |
1183
|
|
|
|
|
|
|
$cl->defaultDataProcessingRef($el1->{'att'}->{'defaultDataProcessingRef'}); |
1184
|
|
|
|
|
|
|
|
1185
|
|
|
|
|
|
|
my @subnodes_2 = $el1->children; |
1186
|
|
|
|
|
|
|
|
1187
|
|
|
|
|
|
|
my @chromatogramlist; |
1188
|
|
|
|
|
|
|
my $chromatogram; |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
for my $el2 ( @subnodes_2 ) { |
1191
|
|
|
|
|
|
|
#inside chromatogramlist tag |
1192
|
|
|
|
|
|
|
|
1193
|
|
|
|
|
|
|
if ( $el2->name eq 'chromatogram' ) { |
1194
|
|
|
|
|
|
|
|
1195
|
|
|
|
|
|
|
$chromatogram = MzML::Chromatogram->new(); |
1196
|
|
|
|
|
|
|
|
1197
|
|
|
|
|
|
|
$chromatogram->defaultArrayLength($el2->{'att'}->{'defaultArrayLength'}) if defined ($el2->{'att'}->{'defaultArrayLength'}); |
1198
|
|
|
|
|
|
|
$chromatogram->id($el2->{'att'}->{'id'}) if defined ($el2->{'att'}->{'id'}); |
1199
|
|
|
|
|
|
|
$chromatogram->index($el2->{'att'}->{'index'}) if defined ($el2->{'att'}->{'index'}); |
1200
|
|
|
|
|
|
|
|
1201
|
|
|
|
|
|
|
my @subnodes_3 = $el2->children; |
1202
|
|
|
|
|
|
|
|
1203
|
|
|
|
|
|
|
my @cvparam_el3; |
1204
|
|
|
|
|
|
|
my @reference_el3; |
1205
|
|
|
|
|
|
|
my @user_el3; |
1206
|
|
|
|
|
|
|
|
1207
|
|
|
|
|
|
|
my $binaryDataArrayList; |
1208
|
|
|
|
|
|
|
my $binaryDataArray; |
1209
|
|
|
|
|
|
|
my @binarydata; |
1210
|
|
|
|
|
|
|
|
1211
|
|
|
|
|
|
|
for my $el3 ( @subnodes_3 ) { |
1212
|
|
|
|
|
|
|
#inside chromatogram tag |
1213
|
|
|
|
|
|
|
|
1214
|
|
|
|
|
|
|
if ( $el3->name eq 'cvParam' ) { |
1215
|
|
|
|
|
|
|
|
1216
|
|
|
|
|
|
|
my $cvp = get_cvParam($el3); |
1217
|
|
|
|
|
|
|
push(@cvparam_el3, $cvp); |
1218
|
|
|
|
|
|
|
|
1219
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'referenceableParamGroupRef' ) { |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el3); |
1222
|
|
|
|
|
|
|
push(@reference_el3, $ref); |
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'userParam' ) { |
1225
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
my $user = get_userParam($el3); |
1227
|
|
|
|
|
|
|
push(@user_el3, $user); |
1228
|
|
|
|
|
|
|
|
1229
|
|
|
|
|
|
|
} elsif ( $el3->name eq 'binaryDataArrayList' ) { |
1230
|
|
|
|
|
|
|
|
1231
|
|
|
|
|
|
|
$binaryDataArrayList = MzML::BinaryDataArrayList->new(); |
1232
|
|
|
|
|
|
|
$binaryDataArrayList->count($el3->{'att'}->{'count'}); |
1233
|
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
|
my @subnodes_4 = $el3->children; |
1235
|
|
|
|
|
|
|
|
1236
|
|
|
|
|
|
|
for my $el4 ( @subnodes_4 ) { |
1237
|
|
|
|
|
|
|
#inside binarydataarraylist tag |
1238
|
|
|
|
|
|
|
|
1239
|
|
|
|
|
|
|
if ( $el4->name eq 'binaryDataArray' ) { |
1240
|
|
|
|
|
|
|
|
1241
|
|
|
|
|
|
|
$binaryDataArray = MzML::BinaryDataArray->new(); |
1242
|
|
|
|
|
|
|
$binaryDataArray->encodedLength($el4->{'att'}->{'encodedLength'}) if defined ($el4->{'att'}->{'encodedLength'}); |
1243
|
|
|
|
|
|
|
push(@binarydata, $binaryDataArray); |
1244
|
|
|
|
|
|
|
|
1245
|
|
|
|
|
|
|
my @subnodes_5 = $el4->children; |
1246
|
|
|
|
|
|
|
|
1247
|
|
|
|
|
|
|
my @cvparam_el5; |
1248
|
|
|
|
|
|
|
my @reference_el5; |
1249
|
|
|
|
|
|
|
my @user_el5; |
1250
|
|
|
|
|
|
|
|
1251
|
|
|
|
|
|
|
for my $el5 ( @subnodes_5 ) { |
1252
|
|
|
|
|
|
|
#inside binarydataarray |
1253
|
|
|
|
|
|
|
|
1254
|
|
|
|
|
|
|
if ( $el5->name eq 'cvParam' ) { |
1255
|
|
|
|
|
|
|
|
1256
|
|
|
|
|
|
|
my $cvp = get_cvParam($el5); |
1257
|
|
|
|
|
|
|
push (@cvparam_el5, $cvp); |
1258
|
|
|
|
|
|
|
|
1259
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'referenceableParamGroupRef' ) { |
1260
|
|
|
|
|
|
|
|
1261
|
|
|
|
|
|
|
my $ref = get_referenceableParamGroupRef($el5); |
1262
|
|
|
|
|
|
|
push(@reference_el5, $ref); |
1263
|
|
|
|
|
|
|
|
1264
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'userParam' ) { |
1265
|
|
|
|
|
|
|
|
1266
|
|
|
|
|
|
|
my $user = get_userParam($el5); |
1267
|
|
|
|
|
|
|
push(@user_el5, $user); |
1268
|
|
|
|
|
|
|
|
1269
|
|
|
|
|
|
|
} elsif ( $el5->name eq 'binary' ) { |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
$binaryDataArray->binary($el5->text); |
1272
|
|
|
|
|
|
|
|
1273
|
|
|
|
|
|
|
} |
1274
|
|
|
|
|
|
|
|
1275
|
|
|
|
|
|
|
}#end el5 |
1276
|
|
|
|
|
|
|
|
1277
|
|
|
|
|
|
|
$binaryDataArray->cvParam(\@cvparam_el5); |
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
} |
1280
|
|
|
|
|
|
|
|
1281
|
|
|
|
|
|
|
|
1282
|
|
|
|
|
|
|
}#el4 end |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
$binaryDataArrayList->binaryDataArray(\@binarydata); |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
} |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
}#end el3 |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
$chromatogram->cvParam(\@cvparam_el3); |
1291
|
|
|
|
|
|
|
$chromatogram->referenceableParamGroupRef(\@reference_el3); |
1292
|
|
|
|
|
|
|
$chromatogram->userParam(\@user_el3); |
1293
|
|
|
|
|
|
|
$chromatogram->binaryDataArrayList($binaryDataArrayList); |
1294
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
push(@chromatogramlist, $chromatogram); |
1296
|
|
|
|
|
|
|
|
1297
|
|
|
|
|
|
|
} |
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
}#end el2 |
1300
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
$cl->chromatogram(\@chromatogramlist); |
1302
|
|
|
|
|
|
|
|
1303
|
|
|
|
|
|
|
} |
1304
|
|
|
|
|
|
|
|
1305
|
|
|
|
|
|
|
}#end el1 |
1306
|
|
|
|
|
|
|
|
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
#$run->sourceFileRefList($sfrl); |
1309
|
|
|
|
|
|
|
$run->spectrumList($sl); |
1310
|
|
|
|
|
|
|
$run->chromatogramList($cl); |
1311
|
|
|
|
|
|
|
|
1312
|
|
|
|
|
|
|
$reg->run($run); |
1313
|
|
|
|
|
|
|
} |
1314
|
|
|
|
|
|
|
|
1315
|
|
|
|
|
|
|
sub get_cvParam { |
1316
|
|
|
|
|
|
|
my $el = shift; |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
my $cvp = MzML::CvParam->new(); |
1319
|
|
|
|
|
|
|
|
1320
|
|
|
|
|
|
|
$cvp->accession($el->{'att'}->{'accession'}); |
1321
|
|
|
|
|
|
|
$cvp->cvRef($el->{'att'}->{'cvRef'}); |
1322
|
|
|
|
|
|
|
$cvp->name($el->{'att'}->{'name'}); |
1323
|
|
|
|
|
|
|
$cvp->unitAccession($el->{'att'}->{'unitAccession'}) if defined ($el->{'att'}->{'unitAccession'}); |
1324
|
|
|
|
|
|
|
$cvp->unitName($el->{'att'}->{'unitName'}) if defined ($el->{'att'}->{'unitName'}); |
1325
|
|
|
|
|
|
|
$cvp->value($el->{'att'}->{'value'}) if defined ($el->{'att'}->{'value'}); |
1326
|
|
|
|
|
|
|
|
1327
|
|
|
|
|
|
|
return $cvp; |
1328
|
|
|
|
|
|
|
} |
1329
|
|
|
|
|
|
|
|
1330
|
|
|
|
|
|
|
sub get_referenceableParamGroupRef { |
1331
|
|
|
|
|
|
|
my $el = shift; |
1332
|
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
|
my $ref = MzML::ReferenceableParamGroupRef->new(); |
1334
|
|
|
|
|
|
|
$ref->ref($el->{'att'}->{'ref'}); |
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
return $ref; |
1337
|
|
|
|
|
|
|
} |
1338
|
|
|
|
|
|
|
|
1339
|
|
|
|
|
|
|
|
1340
|
|
|
|
|
|
|
sub get_userParam { |
1341
|
|
|
|
|
|
|
my $el = shift; |
1342
|
|
|
|
|
|
|
|
1343
|
|
|
|
|
|
|
my $user = MzML::UserParam->new(); |
1344
|
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
|
$user->name($el->{'att'}->{'name'}); |
1346
|
|
|
|
|
|
|
$user->type($el->{'att'}->{'type'}) if defined ($el->{'att'}->{'type'}); |
1347
|
|
|
|
|
|
|
$user->unitAccession($el->{'att'}->{'unitAccession'}) if defined ($el->{'att'}->{'unitAccession'}); |
1348
|
|
|
|
|
|
|
$user->unitCvRef($el->{'att'}->{'unitCvRef'}) if defined ($el->{'att'}->{'unitCvRef'}); |
1349
|
|
|
|
|
|
|
$user->unitName($el->{'att'}->{'unitName'}) if defined ($el->{'att'}->{'unitName'}); |
1350
|
|
|
|
|
|
|
$user->value($el->{'att'}->{'value'}) if defined ($el->{'att'}->{'value'}); |
1351
|
|
|
|
|
|
|
|
1352
|
|
|
|
|
|
|
return $user; |
1353
|
|
|
|
|
|
|
} |
1354
|
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
|
1; |