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() <<
" " 64 for (
size_t i=0; i<10; ++i)
72 vector<MZIntensityPair> mzint(i*2);
73 for (
size_t j=1.0; j<i*2; ++j)
84 spectrum->scanList.scans.push_back(
Scan());
101 spectrum->precursors.push_back(
Precursor(500, 3));
114 spectrum->precursors[0].activation.set(
MS_HCD);
118 spectrum->precursors[0].activation.set(
MS_IRMPD);
126 spectrum->scanList.scans.push_back(
Scan());
129 sl->spectra.push_back(spectrum);
134 *
os_ <<
"original spectrum list:\n";
147 return spectrumIdentity.
index%2 == 0;
154 if (
os_) *
os_ <<
"testEven:\n";
166 for (
size_t i=0, end=filter.
size(); i<end; i++)
170 unit_assert(
id.
id ==
"scan=" + lexical_cast<string>(100+i*2));
174 unit_assert(spectrum->id ==
"scan=" + lexical_cast<string>(100+i*2));
183 if (spectrumIdentity.
index%2 != 0)
return false;
184 return boost::logic::indeterminate;
197 return (param.
valueAs<
int>() == 2);
204 if (
os_) *
os_ <<
"testEvenMS2:\n";
223 mutable bool pastMaxIndex;
229 if (spectrumIdentity.
index>5) pastMaxIndex =
true;
231 return (spectrumIdentity.
index==1 ||
232 spectrumIdentity.
index==3 ||
233 spectrumIdentity.
index==5);
245 if (
os_) *
os_ <<
"testSelectedIndices:\n";
271 return boost::logic::indeterminate;
277 return boost::logic::indeterminate;
285 if (
os_) *
os_ <<
"testHasBinaryData:\n";
290 shared_ptr<stringstream> ss(
new stringstream);
292 serializer.
write(*ss, msd);
295 serializer.
read(ss, msd2);
320 if (
os_) *
os_ <<
"testIndexSet:\n";
346 if (
os_) *
os_ <<
"testScanNumberSet:\n";
349 scanNumberSet.
insert(102,104);
350 scanNumberSet.
insert(107);
370 if (
os_) *
os_ <<
"testScanEventSet:\n";
397 if (
os_) *
os_ <<
"testScanTimeRange:\n";
399 const double low = 422.5;
400 const double high = 427.5;
421 if (
os_) *
os_ <<
"testMSLevelSet:\n";
462 if (
os_) *
os_ <<
"testMS2Activation:\n";
546 if (
os_) *
os_ <<
"testMassAnalyzerFilter:\n";
583 if (
os_) *
os_ <<
"testMZPresentFilter:\n";
588 std::set<double> mzSet;
592 double threshold = 10;
594 ThresholdFilter tf(ThresholdFilter::ThresholdingBy_Count, threshold, ThresholdFilter::Orientation_MostIntense, msLevels);
611 std::set<double> mzSet1;
612 mzSet1.insert(200.0);
613 mzSet1.insert(300.0);
614 double threshold1 = 5;
615 ThresholdFilter tf1(ThresholdFilter::ThresholdingBy_Count, threshold1, ThresholdFilter::Orientation_MostIntense, msLevels);
647 int main(
int argc,
char* argv[])
653 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
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 t...
void testMS2Activation(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...
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)