42{
43 if (
os_) *
os_ <<
"test(): indexed=\"" << boolalpha << indexed <<
"\"\n";
44
47
51
52 ostringstream oss;
53 serializer.write(oss, tiny);
54
55 if (
os_) *
os_ <<
"oss:\n" << oss.str() << endl;
56
57 shared_ptr<istream> is(new istringstream(oss.str()));
58
59
60
74
75
76
77
78
80
82 {
86 }
87
88
89
92
94 IndexList indexList = sl->findNameValue(
"scan",
"19");
95 unit_assert(indexList.size()==1 && indexList[0]==0);
97 indexList = sl->findNameValue("scan", "20");
98 unit_assert(indexList.size()==1 && indexList[0]==1);
100 indexList = sl->findNameValue("scan", "21");
101 unit_assert(indexList.size()==1 && indexList[0]==2);
102
103
104
106 unit_assert(sl->spectrumIdentity(0).id ==
"scan=19");
107 unit_assert(sl->spectrumIdentity(0).sourceFilePosition != -1);
108
110
118 Scan& scan = s->scanList.scans[0];
120
126 unit_assert(s->binaryDataArrayPtrs[0]->data.empty() && s->binaryDataArrayPtrs[1]->data.empty());
127
128 s = sl->spectrum(0, true);
131 unit_assert(!s->binaryDataArrayPtrs[0]->data.empty() && !s->binaryDataArrayPtrs[1]->data.empty());
132
133 vector<MZIntensityPair> pairs;
134 s->getMZIntensityPairs(pairs);
135
137 {
138 *
os_ <<
"scan 19:\n";
139 copy(pairs.begin(), pairs.end(), ostream_iterator<MZIntensityPair>(*
os_,
"\n"));
141 }
142
144 for (int i=0; i<15; i++)
145 unit_assert(pairs[i].mz==i && pairs[i].intensity==15-i);
146
147 Scan& scan19 = s->scanList.scans[0];
152 instrumentConfiguration.
userParams[0].name ==
"doobie");
153
154
155
157 unit_assert(sl->spectrumIdentity(1).id ==
"scan=20");
158
159 s = sl->spectrum(1, true);
165
167
168
169
179
180 pairs.clear();
181 s->getMZIntensityPairs(pairs);
182
184 {
185 *
os_ <<
"scan 20:\n";
186 copy(pairs.begin(), pairs.end(), ostream_iterator<MZIntensityPair>(*
os_,
"\n"));
188 }
189
191 for (int i=0; i<10; i++)
192 unit_assert(pairs[i].mz==2*i && pairs[i].intensity==(10-i)*2);
193
194
195
196
198 unit_assert(sl->spectrumIdentity(2).id ==
"scan=21");
199
200 s = sl->spectrum(2, false);
203 UserParam exampleUserParam = s->userParam(
"example");
208
209
210
212 unit_assert(sl->spectrumIdentity(3).id ==
"scan=22");
213
214 s = sl->spectrum(3, false);
218 Precursor& precursor22 = s->precursors[0];
226}
MSData <-> mzXML stream serialization.
static SpectrumListPtr create(boost::shared_ptr< std::istream > is, const MSData &msd, bool indexed=true)
MS_intensity_array
intensity array: A data array of intensity values.
MS_Bruker_Agilent_YEP_format
Bruker/Agilent YEP format: Bruker/Agilent YEP file format.
MS_collision_energy
collision energy: Energy for an ion experiencing collision with a stationary gas particle resulting i...
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
MS_CID
CID (collision-induced dissociation): The dissociation of an ion after collisional excitation....
MS_Conversion_to_mzML
Conversion to mzML: Conversion of a file format to Proteomics Standards Initiative mzML file format.
MS_ProteoWizard_software
ProteoWizard software: ProteoWizard software for data processing and analysis. Primarily developed by...
MS_ETD
ETD (electron transfer dissociation): A process to fragment ions in a mass spectrometer by inducing f...
MS_m_z_array
m/z array: A data array of m/z values.
MS_charge_state
charge state: The charge state of the ion, single or multiple and positive or negatively charged.
MS_selected_ion_m_z
selected ion m/z: Mass-to-charge ratio of an selected ion.
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run.
MS_LCQ_Deca
LCQ Deca: ThermoFinnigan LCQ Deca.
MS_base_peak_intensity
base peak intensity: The intensity of the greatest peak in the mass spectrum.
MS_Bruker_Agilent_YEP_nativeID_format
Bruker/Agilent YEP nativeID format: Native format defined by scan=xsd:nonNegativeInteger.
MS_positive_scan
positive scan: Polarity of the scan is positive.
MS_peak_intensity
peak intensity: Intensity of ions as measured by the height or area of a peak in a mass spectrum.
PWIZ_API_DECL void write(minimxml::XMLWriter &writer, const CV &cv)
PWIZ_API_DECL void initializeTiny(MSData &msd)
boost::shared_ptr< DataProcessing > DataProcessingPtr
boost::shared_ptr< Software > SoftwarePtr
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.
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
std::vector< UserParam > userParams
a collection of uncontrolled user terms
bool hasCVParam(CVID cvid) const
returns true iff cvParams contains exact cvid (recursive)
Uncontrolled user parameters (essentially allowing free text). Before using these,...
std::string value
the value for the parameter, where appropriate.
bool empty() const
returns true iff name, value, type, and units are all empty
std::string name
the name for the parameter.
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
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...
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file.
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< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
The method of precursor ion selection and activation.
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
Activation activation
the type and energy level used for activation.
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
Description of the default peak processing method. This element describes the base method used in the...
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile.
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
Serializer_mzXML configuration.
bool indexed
(indexed==true): read/write with <index>
Description of the source file, including location and type.