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];
104 boost::format scanfmt(
"scan=%1%");
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];
159 boost::format scanfmt(
"scan=%1%");
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;
324 "Center index must be an MS2 spectrum")
331 "Spectrum index not in range of the given spectrum list")
335 size_t cycleSize = 4;
336 size_t numCycles = 5;
342 size_t centerIndex = 2 * (cycleSize + 1);
377int main(
int argc,
char* argv[])
Helper functions for demultiplexing Helper functions include nice methods of accessing CV parameters ...
int main(int argc, char *argv[])
void FindNearbySpectraTest()
void TryGetStartTimeTest()
void initializeLarge(MSData &msd, size_t cycleSize=4, size_t numCycles=5)
void TryGetScanIDTokenTest()
void TryGetDemuxIndexTest()
void TryGetOriginalIndexTest()
void TryGetNumPrecursorsTest()
MS_no_combination
no combination: Use this term if only one scan was recorded or there is no information about scans av...
MS_intensity_array
intensity array: A data array of intensity values.
UO_minute
minute: A time unit which is equal to 60 seconds.
MS_highest_observed_m_z
highest observed m/z: Highest m/z value observed in the m/z array.
MS_scan_window_lower_limit
scan window lower limit: The upper m/z bound of a mass spectrometer scan window.
MS_collision_induced_dissociation
collision-induced dissociation: The dissociation of an ion after collisional excitation....
UO_electronvolt
electronvolt: A non-SI unit of energy (eV) defined as the energy acquired by a single unbound electro...
MS_lowest_observed_m_z
lowest observed m/z: Lowest m/z value observed in the m/z array.
MS_scan_window_upper_limit
scan window upper limit: The lower m/z bound of a mass spectrometer scan window.
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_centroid_spectrum
centroid spectrum: Processing of profile data to produce spectra that contains discrete peaks of zero...
MS_profile_spectrum
profile spectrum: A profile mass spectrum is created when data is recorded with ion current (counts p...
MS_isolation_window_lower_offset
isolation window lower offset: The extent of the isolation window in m/z below the isolation window t...
MS_m_z_array
m/z array: A data array of m/z values.
MS_filter_string
filter string: A string unique to Thermo instrument describing instrument settings for the scan.
MS_m_z
m/z: Three-character symbol m/z is used to denote the quantity formed by dividing the mass of an ion ...
MS_preset_scan_configuration
preset scan configuration: A user-defined scan configuration that specifies the instrumental settings...
MS_charge_state
charge state: The charge state of the ion, single or multiple and positive or negatively charged.
MS_isolation_window_target_m_z
isolation window target m/z: The primary or reference m/z about which the isolation window is defined...
MS_isolation_window_upper_offset
isolation window upper offset: The extent of the isolation window in m/z above the isolation window t...
MS_total_ion_current
total ion current: The sum of all the separate ion currents carried by the ions of different m/z cont...
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_number_of_detector_counts
number of detector counts: The number of counted events observed in one or a group of elements of a d...
MS_base_peak_intensity
base peak intensity: The intensity of the greatest peak in the mass spectrum.
MS_base_peak_m_z
base peak m/z: M/z value of the signal of highest intensity in the mass spectrum.
MS_peak_intensity
peak intensity: Intensity of ions as measured by the height or area of a peak in a mass spectrum.
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...
bool TryGetNumPrecursors(const msdata::Spectrum &spectrum, int &numPrecursors)
Tries to get the number of precursors contributing to a multiplexed spectrum.
bool TryGetMSLevel(const msdata::Spectrum &spectrum, int &msLevel)
Tries to read MS level from spectrum.
bool TryGetOriginalIndex(const msdata::SpectrumIdentity &spectrumIdentity, size_t &index)
Tries to read the original index of the spectrum before demultiplexing using the SpectrumIdentity of ...
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.
bool TryGetScanIDToken(const msdata::SpectrumIdentity &spectrumIdentity, const std::string &tokenName, std::string &value)
Tries to read the given token from a spectrum identity id.
bool TryGetStartTime(const msdata::Spectrum &spectrum, double &startTime)
Tries to get the start time of the scan.
PWIZ_API_DECL void initializeTiny(MSData &msd)
boost::shared_ptr< const msdata::Spectrum > Spectrum_const_ptr
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
boost::shared_ptr< Spectrum > SpectrumPtr
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
The method of precursor ion selection and activation.
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
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.
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
std::vector< Scan > scans
The structure that captures the generation of a peak list (including the underlying acquisitions)
size_t defaultArrayLength
default length of binary data arrays contained in this element.
ScanList scanList
list of scans
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
#define unit_assert_equal(x, y, epsilon)
#define unit_assert_operator_equal(expected, actual)
#define unit_assert_throws_what(x, exception, whatStr)
#define TEST_PROLOG(argc, argv)