Go to the documentation of this file.
36 TryGetScanIDTokenTest();
37 TryGetDemuxIndexTest();
38 TryGetOriginalIndexTest();
40 TryGetNumPrecursorsTest();
41 TryGetStartTimeTest();
42 FindNearbySpectraTest();
53 auto spectrumListPtr = _msd.run.spectrumListPtr;
55 _s10 = spectrumListPtr->spectrum(MS1_INDEX_0,
true);
56 _s20 = spectrumListPtr->spectrum(MS2_INDEX_0,
true);
57 _s11 = spectrumListPtr->spectrum(MS1_INDEX_1,
true);
58 _s21 = spectrumListPtr->spectrum(MS2_INDEX_1,
true);
82 shared_ptr<SpectrumListSimple> spectrumListPtr = boost::dynamic_pointer_cast<SpectrumListSimple>(msd.
run.
spectrumListPtr);
84 throw std::runtime_error(
"initializeLarge() spectrumList from initializeTiny was not of the expected type");
86 auto dppwiz = spectrumListPtr->dp;
88 auto pg1 = spectrumListPtr->spectra[0]->paramGroupPtrs[0];
89 auto pg2 = spectrumListPtr->spectra[1]->paramGroupPtrs[0];
91 auto instrumentConfigurationPtr = spectrumListPtr->spectra[0]->scanList.scans.back().instrumentConfigurationPtr;
93 auto dpCompassXtract = spectrumListPtr->spectra[0]->binaryDataArrayPtrs[0]->dataProcessingPtr;
96 spectrumListPtr->spectra.clear();
99 for (
size_t cycleIndex = 0; cycleIndex < numCycles; ++cycleIndex)
103 Spectrum& ms1 = *spectrumListPtr->spectra[scanNum];
106 ms1.
id = scanfmt.str();
122 ms1scan.instrumentConfigurationPtr = instrumentConfigurationPtr;
126 ms1scan.scanWindows.resize(1);
132 ms1_mz->dataProcessingPtr = dpCompassXtract;
134 ms1_mz->data.resize(15);
135 for (
int i = 0; i < 15; i++)
139 ms1_intensity->dataProcessingPtr = dpCompassXtract;
141 ms1_intensity->data.resize(15);
142 for (
int i = 0; i < 15; i++)
143 ms1_intensity->data[i] = 15 - i;
153 for (
size_t ms2Index = 0; ms2Index < cycleSize; ++ms2Index)
156 Spectrum& ms2 = *spectrumListPtr->spectra[scanNum];
161 ms2.
id = scanfmt.str();
190 ms2scan.instrumentConfigurationPtr = instrumentConfigurationPtr;
192 ms2scan.set(
MS_filter_string,
"+ c d Full ms2 445.35@cid35.00 [ 110.00-905.00]");
194 ms2scan.scanWindows.resize(1);
195 ScanWindow& window2 = ms2scan.scanWindows.front();
200 ms2_mz->dataProcessingPtr = dpCompassXtract;
202 ms2_mz->data.resize(10);
203 for (
int i = 0; i < 10; i++)
204 ms2_mz->data[i] = i * 2;
207 ms2_intensity->dataProcessingPtr = dpCompassXtract;
209 ms2_intensity->data.resize(10);
210 for (
int i = 0; i < 10; i++)
211 ms2_intensity->data[i] = (10 - i) * 2;
230 emptySpectrum.
id = emptySpectrum.
id +
" demux=0";
294 vector<size_t> spectraIndices;
297 success =
FindNearbySpectra(spectraIndices, _msd.run.spectrumListPtr, MS2_INDEX_0, 2);
304 success =
FindNearbySpectra(spectraIndices, _msd.run.spectrumListPtr, MS2_INDEX_1, 2);
311 success =
FindNearbySpectra(spectraIndices, _msd.run.spectrumListPtr, MS2_INDEX_0, 1);
317 success =
FindNearbySpectra(spectraIndices, _msd.run.spectrumListPtr, MS2_INDEX_0, 3);
322 success =
FindNearbySpectra(spectraIndices, _msd.run.spectrumListPtr, MS1_INDEX_0, 2),
324 "Center index must be an MS2 spectrum")
327 size_t tooLargeOfIndex = _msd.run.spectrumListPtr->size() + 1;
329 success =
FindNearbySpectra(spectraIndices, _msd.run.spectrumListPtr, tooLargeOfIndex, 2),
331 "Spectrum index not in range of the given spectrum list")
335 size_t cycleSize = 4;
336 size_t numCycles = 5;
337 initializeLarge(msd, cycleSize, numCycles);
342 size_t centerIndex = 2 * (cycleSize + 1);
363 const size_t MS1_INDEX_0 = 0;
364 const size_t MS2_INDEX_0 = 1;
365 const size_t MS1_INDEX_1 = 2;
366 const size_t MS2_INDEX_1 = 3;
377 int main(
int argc,
char* argv[])
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
void TryGetDemuxIndexTest()
MS_charge_state
charge state: The charge state of the ion, single or multiple and positive or negatively charged.
MS_number_of_detector_counts
number of detector counts: The number of counted events observed in one or a group of elements of a d...
The structure that captures the generation of a peak list (including the underlying acquisitions)
#define unit_assert_throws_what(x, exception, whatStr)
MS_m_z_array
m/z array: A data array of m/z values.
#define unit_assert_equal(x, y, epsilon)
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
MS_base_peak_m_z
base peak m/z: M/z value of the signal of highest intensity in the mass spectrum.
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run.
PWIZ_API_DECL std::string value(const std::string &id, const std::string &name)
convenience function to extract a named value from an id string
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
MS_total_ion_current
total ion current: The sum of all the separate ion currents carried by the ions of different m/z cont...
void TryGetNumPrecursorsTest()
#define unit_assert_operator_equal(expected, actual)
void FindNearbySpectraTest()
void TryGetOriginalIndexTest()
bool TryGetNumPrecursors(const msdata::Spectrum &spectrum, int &numPrecursors)
Tries to get the number of precursors contributing to a multiplexed spectrum.
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
MS_scan_window_upper_limit
scan window upper limit: The lower m/z bound of a mass spectrometer scan window.
int main(int argc, char *argv[])
MS_isolation_window_target_m_z
isolation window target m/z: The primary or reference m/z about which the isolation window is defined...
UO_electronvolt
electronvolt: A non-SI unit of energy (eV) defined as the energy acquired by a single unbound electro...
MS_collision_energy
collision energy: Energy for an ion experiencing collision with a stationary gas particle resulting i...
boost::shared_ptr< const msdata::Spectrum > Spectrum_const_ptr
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
bool TryGetScanIDToken(const msdata::SpectrumIdentity &spectrumIdentity, const std::string &tokenName, std::string &value)
Tries to read the given token from a spectrum identity id.
MS_no_combination
no combination: Use this term if only one scan was recorded or there is no information about scans av...
PWIZ_API_DECL Reader_Bruker_Format format(const std::string &path)
returns Bruker format of 'path' if it is a Bruker directory; otherwise returns empty string
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
MS_isolation_window_lower_offset
isolation window lower offset: The extent of the isolation window in m/z below the isolation window t...
MS_scan_window_lower_limit
scan window lower limit: The upper m/z bound of a mass spectrometer scan window.
boost::shared_ptr< Spectrum > SpectrumPtr
Activation activation
the type and energy level used for activation.
MS_intensity_array
intensity array: A data array of intensity values.
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
MS_selected_ion_m_z
selected ion m/z: Mass-to-charge ratio of an selected ion.
MS_filter_string
filter string: A string unique to Thermo instrument describing instrument settings for the scan.
ScanList scanList
list of scans
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
std::vector< Scan > scans
#define TEST_PROLOG(argc, argv)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
MS_profile_spectrum
profile spectrum: A profile mass spectrum is created when data is recorded with ion current (counts p...
MS_m_z
m/z: Three-character symbol m/z is used to denote the quantity formed by dividing the mass of an ion ...
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
MS_centroid_spectrum
centroid spectrum: Processing of profile data to produce spectra that contains discrete peaks of zero...
bool TryGetOriginalIndex(const msdata::SpectrumIdentity &spectrumIdentity, size_t &index)
Tries to read the original index of the spectrum before demultiplexing using the SpectrumIdentity of ...
MS_peak_intensity
peak intensity: Intensity of ions as measured by the height or area of a peak in a mass spectrum.
void TryGetScanIDTokenTest()
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
void TryGetStartTimeTest()
MS_highest_observed_m_z
highest observed m/z: Highest m/z value observed in the m/z array.
MS_base_peak_intensity
base peak intensity: The intensity of the greatest peak in the mass spectrum.
bool TryGetStartTime(const msdata::Spectrum &spectrum, double &startTime)
Tries to get the start time of the scan.
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
bool TryGetDemuxIndex(const msdata::SpectrumIdentity &spectrumIdentity, size_t &index)
Tries to read the index of the demultiplexed spectrum relative to the multiplexed spectrum it was der...
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
MS_collision_induced_dissociation
collision-induced dissociation: The dissociation of an ion after collisional excitation....
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
MS_lowest_observed_m_z
lowest observed m/z: Lowest m/z value observed in the m/z array.
bool FindNearbySpectra(std::vector< size_t > &spectraIndices, pwiz::msdata::SpectrumList_const_ptr slPtr, size_t centerIndex, size_t numSpectraToFind, size_t stride=1)
Tries to find a given number of ms2 spectra near the given spectrum index.
MS_preset_scan_configuration
preset scan configuration: A user-defined scan configuration that specifies the instrumental settings...
The method of precursor ion selection and activation.
UO_minute
minute: A time unit which is equal to 60 seconds.
size_t defaultArrayLength
default length of binary data arrays contained in this element.
MS_isolation_window_upper_offset
isolation window upper offset: The extent of the isolation window in m/z above the isolation window t...
void initializeLarge(MSData &msd, size_t cycleSize=4, size_t numCycles=5)
bool TryGetMSLevel(const msdata::Spectrum &spectrum, int &msLevel)
Tries to read MS level from spectrum.