Go to the documentation of this file.
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)
69 spectrum->id =
"scan=" + lexical_cast<string>(100+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;
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;
boost::shared_ptr< SpectrumList > SpectrumListPtr
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...
Identifying information for a spectrum.
The structure that captures the generation of a peak list (including the underlying acquisitions)
void testScanTimeRange(SpectrumListPtr sl)
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 testMZPresentFilter(SpectrumListPtr sl)
virtual size_t size() const =0
returns the number of spectra
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
virtual size_t size() const
returns the number of spectra
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run.
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
MSData <-> mzML stream serialization.
struct for expressing m/z tolerance in either amu or ppm
MS_emission_spectrum
emission spectrum: A plot of the relative intensity of electromagnetic radiation emitted by atoms or ...
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
client-implemented filter predicate – called during construction of SpectrumList_Filter to create the...
virtual string describe() const
MS_MS1_spectrum
MS1 spectrum: Mass spectrum created by a single-stage MS experiment or the first stage of a multi-sta...
PWIZ_API_DECL void initializeTiny(MSData &msd)
UO_second
second: A time unit which is equal to the duration of 9 192 631 770 periods of the radiation correspo...
#define unit_assert_operator_equal(expected, actual)
virtual bool done() const
return true iff done accepting chromatograms; this allows early termination of the iteration through ...
void testIndexSet(SpectrumListPtr sl)
void testMassAnalyzerFilter(SpectrumListPtr sl)
value_type valueAs() const
templated value access with type conversion
MS_radial_ejection_linear_ion_trap
radial ejection linear ion trap: A linear ion trap mass spectrometer where ions are ejected along the...
@ DetailLevel_FullMetadata
MS_IRMPD
IRMPD (infrared multiphoton dissociation): Multiphoton ionization where the reactant ion dissociates ...
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
void testEven(SpectrumListPtr sl)
MS_mass_spectrum
mass spectrum: A plot of the relative abundance of a beam or other collection of ions as a function o...
void testScanNumberSet(SpectrumListPtr sl)
void testHasBinaryData(SpectrumListPtr sl)
CVParam cvParam(CVID cvid) const
finds cvid in the container:
MS_electron_transfer_dissociation
electron transfer dissociation: A process to fragment ions in a mass spectrometer by inducing fragmen...
void printSpectrumList(const SpectrumList &sl, ostream &os)
virtual tribool accept(const msdata::SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
void testThermoFilterFilter(SpectrumListPtr sl)
void insert(Interval interval)
insert an interval of integers into the virtual container
int main(int argc, char *argv[])
virtual string describe() const
return a string describing how the predicate filters
SpectrumList filter, for creating Spectrum sub-lists.
virtual tribool accept(const Spectrum &spectrum) const
return true iff Spectrum is accepted
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i....
virtual DetailLevel suggestedDetailLevel() const
can be overridden in subclasses that know they will need a certain detail level; it must be overridde...
boost::shared_ptr< Spectrum > SpectrumPtr
virtual string describe() const
return a string describing how the predicate filters
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
void testScanEventSet(SpectrumListPtr sl)
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,...
HasBinaryDataPredicate(DetailLevel suggestedDetailLevel)
CVParam cvParamChild(CVID cvid) const
finds child of cvid in the container:
virtual string describe() const
MS_filter_string
filter string: A string unique to Thermo instrument describing instrument settings for the scan.
Simple writeable in-memory implementation of SpectrumList.
MS_spectrum_type
spectrum type: Spectrum type.
PWIZ_API_DECL bool cvIsA(CVID child, CVID parent)
returns true iff child IsA parent in the CV
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
SpectrumListPtr createSpectrumList()
#define TEST_PROLOG(argc, argv)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
MS_ion_trap
ion trap: A device for spatially confining ions using electric and magnetic fields alone or in combin...
MS_orbitrap
orbitrap: An ion trapping device that consists of an outer barrel-like electrode and a coaxial inner ...
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
virtual tribool accept(const Spectrum &spectrum) const
return true iff Spectrum is accepted
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
void testSelectedIndices(SpectrumListPtr sl)
MS_HCD
HCD (beam-type collision-induced dissociation): A collision-induced dissociation process that occurs ...
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
The data point type of a mass spectrum.
MS_collision_induced_dissociation
collision-induced dissociation: The dissociation of an ion after collisional excitation....
void testEvenMS2(SpectrumListPtr sl)
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
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.
MS_quadrupole
quadrupole: A mass spectrometer that consists of four parallel rods whose centers form the corners of...
virtual const msdata::SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
represents a tag-value pair, where the tag comes from the controlled vocabulary
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...
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
void testMS2Activation(SpectrumListPtr sl)
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
MS_fourier_transform_ion_cyclotron_resonance_mass_spectrometer
fourier transform ion cyclotron resonance mass spectrometer: A mass spectrometer based on the princip...
void testMSLevelSet(SpectrumListPtr sl)