41{
42 if (
os_) *
os_ <<
"test(): indexed=\"" << boolalpha << indexed <<
"\"\n";
43
46
50
51 ostringstream oss;
52 serializer.write(oss, tiny);
53
54 if (
os_) *
os_ <<
"oss:\n" << oss.str() << endl;
55
56 shared_ptr<istream> is(new istringstream(oss.str()));
57
58
59
61
64
66 pg1->id = "CommonMS1SpectrumParams";
69
71 pg2->id = "CommonMS2SpectrumParams";
74
75
78
81
82
83
87 IndexList indexList = sl->findNameValue(
"scan",
"19");
88 unit_assert(indexList.size()==1 && indexList[0]==0);
90 indexList = sl->findNameValue("scan", "20");
91 unit_assert(indexList.size()==1 && indexList[0]==1);
93 indexList = sl->findNameValue("scan", "21");
94 unit_assert(indexList.size()==1 && indexList[0]==2);
95 unit_assert(sl->find(
"sample=1 period=1 cycle=23 experiment=1") == 4);
96 indexList = sl->findNameValue("sample", "1");
97 unit_assert(indexList.size()==1 && indexList[0]==4);
98 indexList = sl->findNameValue("period", "1");
99 unit_assert(indexList.size()==1 && indexList[0]==4);
100 indexList = sl->findNameValue("cycle", "23");
101 unit_assert(indexList.size()==1 && indexList[0]==4);
102 indexList = sl->findNameValue("experiment", "1");
103 unit_assert(indexList.size()==1 && indexList[0]==4);
104
106 IndexList spotIndexList = sl->findSpotID(
"A1,42x42,4242x4242");
109
110
111
112
119
121 unit_assert(sl->spectrumIdentity(0).id ==
"scan=19");
122 unit_assert(sl->spectrumIdentity(0).spotID.empty());
123
124 s = sl->spectrum(0, true);
125
126 vector<MZIntensityPair> pairs;
127 s->getMZIntensityPairs(pairs);
129 for (int i=0; i<15; i++)
130 unit_assert(pairs[i].mz==i && pairs[i].intensity==15-i);
131
134 unit_assert(s->paramGroupPtrs.back()->id ==
"CommonMS1SpectrumParams");
135 unit_assert(s->paramGroupPtrs.back()->cvParams.size() == 1);
136
137
138
139 s = sl->spectrum(1, true);
144
146 unit_assert(sl->spectrumIdentity(1).id ==
"scan=20");
147 unit_assert(sl->spectrumIdentity(1).spotID.empty());
148
149 pairs.clear();
150 s->getMZIntensityPairs(pairs);
152 for (int i=0; i<10; i++)
153 unit_assert(pairs[i].mz==2*i && pairs[i].intensity==(10-i)*2);
154
157 unit_assert(s->paramGroupPtrs.back()->id ==
"CommonMS2SpectrumParams");
158 unit_assert(s->paramGroupPtrs.back()->cvParams.size() == 1);
159
160
161 s = sl->spectrum(4, true);
163 unit_assert(s->id ==
"sample=1 period=1 cycle=23 experiment=1");
166
168 unit_assert(sl->spectrumIdentity(4).id ==
"sample=1 period=1 cycle=23 experiment=1");
169 unit_assert(sl->spectrumIdentity(4).spotID ==
"A1,42x42,4242x4242");
170}
MSData <-> mzML stream serialization.
static SpectrumListPtr create(boost::shared_ptr< std::istream > is, const MSData &msd, const Index_mzML_Ptr &indexPtr)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
MS_positive_scan
positive scan: Polarity of the scan is positive.
boost::shared_ptr< ParamGroup > ParamGroupPtr
PWIZ_API_DECL void initializeTiny(MSData &msd)
boost::shared_ptr< DataProcessing > DataProcessingPtr
boost::shared_ptr< SpectrumList > SpectrumListPtr
boost::shared_ptr< Spectrum > SpectrumPtr
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
boost::shared_ptr< Index_mzML > Index_mzML_Ptr
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Description of the way in which a particular software was used.
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from.
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Serializer_mzML configuration.
bool indexed
(indexed==true): read/write with <indexedmzML> wrapper
Description of the source file, including location and type.