37 using boost::logic::tribool;
45 os <<
"size: " << sl.
size() << endl;
47 for (
size_t i=0, end=sl.
size(); i<end; i++)
50 os << spectrum->index <<
" " 51 << spectrum->id <<
" " 52 <<
"ms" << spectrum->cvParam(
MS_ms_level).value <<
" " 54 <<
"scanTime:" << spectrum->scanList.scans[0].cvParam(
MS_scan_start_time).timeInSeconds() <<
" " 55 <<
"scanFilter:" << spectrum->scanList.scans[0].cvParam(
MS_filter_string).value <<
" " 65 for (
size_t i=0; i<11; ++i)
73 vector<MZIntensityPair> mzint(i*2);
74 for (
size_t j=1.0; j<i*2; ++j)
83 sl->spectra.push_back(spectrum);
92 spectrum->scanList.scans.push_back(
Scan());
113 if (i == 0 || i == 6)
115 spectrum->scanList.scans[0].set(
MS_filter_string,
"FTMS + p NSI SIM ms [595.0000-655.0000]");
117 else if (i == 3 || i == 9)
119 spectrum->scanList.scans[0].set(
MS_filter_string,
"FTMS + p NSI SIM ms [395.0000-1005.0000]");
123 spectrum->precursors.push_back(
Precursor((i+4)*100, 3));
126 ostringstream filterLine;
130 filterLine <<
"FTMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@etd30.00 [100.0000-2000.0000]";
135 filterLine <<
"ITMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@cid30.00 [100.0000-2000.0000]";
139 spectrum->precursors[0].activation.set(
MS_HCD);
140 filterLine <<
"ITMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@hcd30.00 [100.0000-2000.0000]";
144 spectrum->precursors[0].activation.set(
MS_IRMPD);
145 filterLine <<
"ITMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@irmpd30.00 [100.0000-2000.0000]";
151 filterLine <<
"FTMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@irmpd30.00 [100.0000-2000.0000]";
154 spectrum->scanList.scans.push_back(
Scan());
159 sl->spectra.push_back(spectrum);
164 *
os_ <<
"original spectrum list:\n";
177 return spectrumIdentity.
index%2 == 0;
186 if (
os_) *
os_ <<
"testEven:\n";
198 for (
size_t i=0, end=filter.
size(); i<end; i++)
202 unit_assert(
id.
id ==
"scan=" + lexical_cast<string>(100+i*2));
206 unit_assert(spectrum->id ==
"scan=" + lexical_cast<string>(100+i*2));
215 if (spectrumIdentity.
index%2 != 0)
return false;
216 return boost::logic::indeterminate;
229 return (param.
valueAs<
int>() == 2);
238 if (
os_) *
os_ <<
"testEvenMS2:\n";
257 mutable bool pastMaxIndex;
263 if (spectrumIdentity.
index>5) pastMaxIndex =
true;
265 return (spectrumIdentity.
index==1 ||
266 spectrumIdentity.
index==3 ||
267 spectrumIdentity.
index==5);
281 if (
os_) *
os_ <<
"testSelectedIndices:\n";
307 return boost::logic::indeterminate;
313 return boost::logic::indeterminate;
323 if (
os_) *
os_ <<
"testHasBinaryData:\n";
328 shared_ptr<stringstream> ss(
new stringstream);
330 serializer.
write(*ss, msd);
333 serializer.
read(ss, msd2);
358 if (
os_) *
os_ <<
"testIndexSet:\n";
384 if (
os_) *
os_ <<
"testScanNumberSet:\n";
387 scanNumberSet.
insert(102,104);
388 scanNumberSet.
insert(107);
408 if (
os_) *
os_ <<
"testScanEventSet:\n";
435 if (
os_) *
os_ <<
"testScanTimeRange:\n";
437 const double low = 422.5;
438 const double high = 427.5;
459 if (
os_) *
os_ <<
"testMSLevelSet:\n";
520 if (
os_) *
os_ <<
"testMS2Activation:\n";
604 if (
os_) *
os_ <<
"testMassAnalyzerFilter:\n";
641 if (
os_) *
os_ <<
"testMZPresentFilter:\n";
646 std::set<double> mzSet;
650 double threshold = 10;
652 ThresholdFilter tf(ThresholdFilter::ThresholdingBy_Count, threshold, ThresholdFilter::Orientation_MostIntense, msLevels);
669 std::set<double> mzSet1;
670 mzSet1.insert(200.0);
671 mzSet1.insert(300.0);
672 double threshold1 = 5;
673 ThresholdFilter tf1(ThresholdFilter::ThresholdingBy_Count, threshold1, ThresholdFilter::Orientation_MostIntense, msLevels);
689 if (
os_) *
os_ <<
"testThermoFilterFilter:\n";
692 string queryString =
"395.0000-1005.0000";
696 *
os_ <<
"Including all spectra that contain " << queryString << endl;
708 *
os_ <<
"Excluding all spectra that contain " << queryString << endl;
713 unit_assert(filter2.spectrumIdentity(0).id ==
"scan=100");
714 unit_assert(filter2.spectrumIdentity(1).id ==
"scan=101");
715 unit_assert(filter2.spectrumIdentity(2).id ==
"scan=102");
716 unit_assert(filter2.spectrumIdentity(3).id ==
"scan=104");
717 unit_assert(filter2.spectrumIdentity(4).id ==
"scan=105");
718 unit_assert(filter2.spectrumIdentity(5).id ==
"scan=106");
719 unit_assert(filter2.spectrumIdentity(6).id ==
"scan=107");
720 unit_assert(filter2.spectrumIdentity(7).id ==
"scan=108");
727 *
os_ <<
"Excluding all spectra that contain " << queryString << endl;
738 queryString =
"FTMS + p NSI SIM ms [395.0000-1005.0000]";
742 *
os_ <<
"Including all spectra that exactly match " << queryString << endl;
751 queryString =
"FTMS + p NSI SIM ms [395.0000-1005.0000]";
755 *
os_ <<
"Excluding all spectra that exactly match " << queryString << endl;
789 int main(
int argc,
char* argv[])
795 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
void testThermoFilterFilter(SpectrumListPtr sl)
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
void testEvenMS2(SpectrumListPtr sl)
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
CVParam cvParam(CVID cvid) const
finds cvid in the container:
MS_mass_spectrum
mass spectrum: A plot of the relative abundance of a beam or other collection of ions as a function o...
MSData <-> mzML stream serialization.
void read(boost::shared_ptr< std::istream > is, MSData &msd) const
read in MSData object from an mzML istream note: istream may be managed by MSData's SpectrumList...
a virtual container of integers, accessible via an iterator interface, stored as union of intervals ...
The method of precursor ion selection and activation.
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i...
void testScanNumberSet(SpectrumListPtr sl)
virtual string describe() const
return a string describing how the predicate filters
virtual msdata::SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const
retrieve a spectrum by index
boost::shared_ptr< Spectrum > SpectrumPtr
void write(std::ostream &os, const MSData &msd, const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0) const
write MSData object to ostream as mzML; iterationListenerRegistry may be used to receive progress upd...
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run...
void testMSLevelSet(SpectrumListPtr sl)
virtual tribool accept(const msdata::SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
MS_fourier_transform_ion_cyclotron_resonance_mass_spectrometer
fourier transform ion cyclotron resonance mass spectrometer: A mass spectrometer based on the princip...
virtual size_t size() const
returns the number of spectra
virtual string describe() const
return a string describing how the predicate filters
SpectrumListPtr createSpectrumList()
MS_collision_induced_dissociation
collision-induced dissociation: The dissociation of an ion after collisional excitation. The term collisional-activated dissociation is not recommended.
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
PWIZ_API_DECL void initializeTiny(MSData &msd)
virtual size_t size() const =0
returns the number of spectra
void testScanTimeRange(SpectrumListPtr sl)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW...
UO_second
second: A time unit which is equal to the duration of 9 192 631 770 periods of the radiation correspo...
client-implemented filter predicate – called during construction of SpectrumList_Filter to create th...
void testMS2Activation(SpectrumListPtr sl)
MS_filter_string
filter string: A string unique to Thermo instrument describing instrument settings for the scan...
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
MS_electron_transfer_dissociation
electron transfer dissociation: A process to fragment ions in a mass spectrometer by inducing fragmen...
void testScanEventSet(SpectrumListPtr sl)
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
toType lexical_cast(const std::string &str, bool &success)
MS_radial_ejection_linear_ion_trap
radial ejection linear ion trap: A linear ion trap mass spectrometer where ions are ejected along the...
MS_IRMPD
IRMPD (infrared multiphoton dissociation): Multiphoton ionization where the reactant ion dissociates ...
The data point type of a mass spectrum.
#define unit_assert_operator_equal(expected, actual)
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
MS_MS1_spectrum
MS1 spectrum: Mass spectrum created by a single-stage MS experiment or the first stage of a multi-sta...
boost::shared_ptr< SpectrumList > SpectrumListPtr
void testSelectedIndices(SpectrumListPtr sl)
MS_emission_spectrum
emission spectrum: A plot of the relative intensity of electromagnetic radiation emitted by atoms or ...
virtual DetailLevel suggestedDetailLevel() const
can be overridden in subclasses that know they will need a certain detail level; it must be overridde...
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
virtual tribool accept(const Spectrum &spectrum) const
return true iff Spectrum is accepted
virtual bool done() const
return true iff done accepting chromatograms; this allows early termination of the iteration through ...
MS_spectrum_type
spectrum type: Spectrum type.
MS_preset_scan_configuration
preset scan configuration: A user-defined scan configuration that specifies the instrumental settings...
void testMZPresentFilter(SpectrumListPtr sl)
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
void testHasBinaryData(SpectrumListPtr sl)
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here. Subsidiary data arrays are also both described and attached here.
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
Identifying information for a spectrum.
void printSpectrumList(const SpectrumList &sl, ostream &os)
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...
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
virtual string describe() const
return a string describing how the predicate filters
void testMassAnalyzerFilter(SpectrumListPtr sl)
struct for expressing m/z tolerance in either amu or ppm
MS_ion_trap
ion trap: A device for spatially confining ions using electric and magnetic fields alone or in combin...
HasBinaryDataPredicate(DetailLevel suggestedDetailLevel)
#define TEST_PROLOG(argc, argv)
MS_quadrupole
quadrupole: A mass spectrometer that consists of four parallel rods whose centers form the corners of...
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
SpectrumList filter, for creating Spectrum sub-lists.
virtual string describe() const
return a string describing how the predicate filters
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
virtual tribool accept(const Spectrum &spectrum) const
return true iff Spectrum is accepted
CVParam cvParamChild(CVID cvid) const
finds child of cvid in the container:
value_type valueAs() const
templated value access with type conversion
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
virtual const msdata::SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
void insert(Interval interval)
insert an interval of integers into the virtual container
Simple writeable in-memory implementation of SpectrumList.
MS_orbitrap
orbitrap: An ion trapping device that consists of an outer barrel-like electrode and a coaxial inner ...
int main(int argc, char *argv[])
void testEven(SpectrumListPtr sl)
PWIZ_API_DECL bool cvIsA(CVID child, CVID parent)
returns true iff child IsA parent in the CV
MS_HCD
HCD (beam-type collision-induced dissociation): A collision-induced dissociation process that occurs ...
represents a tag-value pair, where the tag comes from the controlled vocabulary
void filter(const TContainer &data, const TContainer &filter, TContainer &result, bool circular=false, uint32_t sides=2)
Applies linear convolution (filtering) to a univariate time series.
void testIndexSet(SpectrumListPtr sl)