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<10; ++i)
73 vector<MZIntensityPair> mzint(i*2);
74 for (
size_t j=1.0; j<i*2; ++j)
85 spectrum->scanList.scans.push_back(
Scan());
103 if (i == 0 || i == 6)
105 spectrum->scanList.scans[0].set(
MS_filter_string,
"FTMS + p NSI SIM ms [595.0000-655.0000]");
107 else if (i == 3 || i == 9)
109 spectrum->scanList.scans[0].set(
MS_filter_string,
"FTMS + p NSI SIM ms [395.0000-1005.0000]");
113 spectrum->precursors.push_back(
Precursor((i+4)*100, 3));
116 ostringstream filterLine;
120 filterLine <<
"FTMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@etd30.00 [100.0000-2000.0000]";
125 filterLine <<
"ITMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@cid30.00 [100.0000-2000.0000]";
129 spectrum->precursors[0].activation.set(
MS_HCD);
130 filterLine <<
"ITMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@hcd30.00 [100.0000-2000.0000]";
134 spectrum->precursors[0].activation.set(
MS_IRMPD);
135 filterLine <<
"ITMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@irmpd30.00 [100.0000-2000.0000]";
141 filterLine <<
"FTMS + c NSI Full ms2 " << (i + 4) * 100 <<
".0000@irmpd30.00 [100.0000-2000.0000]";
144 spectrum->scanList.scans.push_back(
Scan());
149 sl->spectra.push_back(spectrum);
154 *
os_ <<
"original spectrum list:\n";
167 return spectrumIdentity.
index%2 == 0;
174 if (
os_) *
os_ <<
"testEven:\n";
186 for (
size_t i=0, end=filter.
size(); i<end; i++)
190 unit_assert(
id.
id ==
"scan=" + lexical_cast<string>(100+i*2));
194 unit_assert(spectrum->id ==
"scan=" + lexical_cast<string>(100+i*2));
203 if (spectrumIdentity.
index%2 != 0)
return false;
204 return boost::logic::indeterminate;
217 return (param.
valueAs<
int>() == 2);
224 if (
os_) *
os_ <<
"testEvenMS2:\n";
243 mutable bool pastMaxIndex;
249 if (spectrumIdentity.
index>5) pastMaxIndex =
true;
251 return (spectrumIdentity.
index==1 ||
252 spectrumIdentity.
index==3 ||
253 spectrumIdentity.
index==5);
265 if (
os_) *
os_ <<
"testSelectedIndices:\n";
291 return boost::logic::indeterminate;
297 return boost::logic::indeterminate;
305 if (
os_) *
os_ <<
"testHasBinaryData:\n";
310 shared_ptr<stringstream> ss(
new stringstream);
312 serializer.
write(*ss, msd);
315 serializer.
read(ss, msd2);
340 if (
os_) *
os_ <<
"testIndexSet:\n";
366 if (
os_) *
os_ <<
"testScanNumberSet:\n";
369 scanNumberSet.
insert(102,104);
370 scanNumberSet.
insert(107);
390 if (
os_) *
os_ <<
"testScanEventSet:\n";
417 if (
os_) *
os_ <<
"testScanTimeRange:\n";
419 const double low = 422.5;
420 const double high = 427.5;
441 if (
os_) *
os_ <<
"testMSLevelSet:\n";
482 if (
os_) *
os_ <<
"testMS2Activation:\n";
566 if (
os_) *
os_ <<
"testMassAnalyzerFilter:\n";
603 if (
os_) *
os_ <<
"testMZPresentFilter:\n";
608 std::set<double> mzSet;
612 double threshold = 10;
614 ThresholdFilter tf(ThresholdFilter::ThresholdingBy_Count, threshold, ThresholdFilter::Orientation_MostIntense, msLevels);
631 std::set<double> mzSet1;
632 mzSet1.insert(200.0);
633 mzSet1.insert(300.0);
634 double threshold1 = 5;
635 ThresholdFilter tf1(ThresholdFilter::ThresholdingBy_Count, threshold1, ThresholdFilter::Orientation_MostIntense, msLevels);
651 if (
os_) *
os_ <<
"testThermoFilterFilter:\n";
654 string queryString =
"395.0000-1005.0000";
658 *
os_ <<
"Including all spectra that contain " << queryString << endl;
670 *
os_ <<
"Excluding all spectra that contain " << queryString << endl;
675 unit_assert(filter2.spectrumIdentity(0).id ==
"scan=100");
676 unit_assert(filter2.spectrumIdentity(1).id ==
"scan=101");
677 unit_assert(filter2.spectrumIdentity(2).id ==
"scan=102");
678 unit_assert(filter2.spectrumIdentity(3).id ==
"scan=104");
679 unit_assert(filter2.spectrumIdentity(4).id ==
"scan=105");
680 unit_assert(filter2.spectrumIdentity(5).id ==
"scan=106");
681 unit_assert(filter2.spectrumIdentity(6).id ==
"scan=107");
682 unit_assert(filter2.spectrumIdentity(7).id ==
"scan=108");
689 *
os_ <<
"Excluding all spectra that contain " << queryString << endl;
700 queryString =
"FTMS + p NSI SIM ms [395.0000-1005.0000]";
704 *
os_ <<
"Including all spectra that exactly match " << queryString << endl;
713 queryString =
"FTMS + p NSI SIM ms [395.0000-1005.0000]";
717 *
os_ <<
"Excluding all spectra that exactly match " << queryString << endl;
751 int main(
int argc,
char* argv[])
757 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 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
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.
float lexical_cast(const std::string &str)
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...
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)
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 proteins; this allows early termination of the iteration through the o...
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...
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)
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
SpectrumList filter, for creating Spectrum sub-lists.
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)