Go to the documentation of this file.
50 for (
int i=0; i<=10; i++)
53 spectrum->id = lexical_cast<string>(i*5);
55 spectrum->cvParams.push_back(i%2 ?
61 spectrum->binaryDataArrayPtrs.push_back(bdMZ);
65 spectrum->binaryDataArrayPtrs.push_back(bdIntensity);
67 for (
int j=1; j<=i; j++)
69 bdMZ->data.push_back(j);
70 bdIntensity->data.push_back(100*j);
73 spectrum->defaultArrayLength = i;
74 spectrumList.
spectra.push_back(spectrum);
92 if (
os_) *
os_ <<
"printSpectrumList()\n";
94 for (
unsigned int i=0; i<sl.
size(); i++)
97 os << spectrum->id <<
" "
100 vector<MZIntensityPair> mziPairs;
101 spectrum->getMZIntensityPairs(mziPairs);
102 copy(mziPairs.begin(), mziPairs.end(), ostream_iterator<MZIntensityPair>(os,
""));
110 if (
os_) *
os_ <<
"testBasic()\n";
118 ++it; ++it; ++it; ++it; ++it;
129 if (
os_) *
os_ <<
"spectrum: " << spectrum.
id <<
" "
132 vector<MZIntensityPair> pairs;
137 copy(pairs.begin(), pairs.end(), ostream_iterator<MZIntensityPair>(*
os_,
""));
141 unit_assert((
int)pairs.size()*5 == lexical_cast<int>(spectrum.
id));
147 if (
os_) *
os_ <<
"testForEach(): \n";
156 if (
os_) *
os_ <<
"testIntegerSet():\n";
159 for (
int i=2; i<=50; i+=2)
174 return lexical_cast<int>(spectrum.
id);
190 vector<int> ftScanNumbers;
197 back_inserter(ftScanNumbers),
202 *
os_ <<
"testSieve():\n";
203 copy(ftScanNumbers.begin(), ftScanNumbers.end(), ostream_iterator<int>(*
os_,
" "));
218 if (
os_) *
os_ <<
"testIteratorEquality()\n";
236 if (
os_) *
os_ <<
"testMSDataConstruction()\n";
248 if (
os_) *
os_ << it->id <<
" "
251 unit_assert(it->id == lexical_cast<string>(5+i*10));
256 int main(
int argc,
char* argv[])
262 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
int getScanNumber(const Spectrum &spectrum)
void testIteratorEquality(const SpectrumList &spectrumList)
The structure that captures the generation of a peak list (including the underlying acquisitions)
MS_m_z_array
m/z array: A data array of m/z values.
void testForEach(const SpectrumList &spectrumList)
virtual size_t size() const =0
returns the number of spectra
MS_mass_analyzer
mass analyzer: Terms used to describe the Analyzer.
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
MS_FT_ICR
FT_ICR (fourier transform ion cyclotron resonance mass spectrometer): A mass spectrometer based on th...
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
virtual bool accept(const Spectrum &spectrum) const
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
interface for filtering based on ScanInfo
void insert(Interval interval)
insert an interval of integers into the virtual container
const char * anal(const CVParam &cvParam)
void initializeSpectrumList(SpectrumListSimple &spectrumList)
boost::shared_ptr< Spectrum > SpectrumPtr
MS_intensity_array
intensity array: A data array of intensity values.
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
void doSomething(const Spectrum &spectrum)
CVParam cvParamChild(CVID cvid) const
finds child of cvid in the container:
Simple writeable in-memory implementation of SpectrumList.
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
#define TEST_PROLOG(argc, argv)
int main(int argc, char *argv[])
void testIntegerSet(const SpectrumList &spectrumList)
void testMSDataConstruction()
SpectrumIterator provides convenient iteration through a set of scans in a SpectrumList.
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
MS_ion_trap
ion trap: A device for spatially confining ions using electric and magnetic fields alone or in combin...
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
void getMZIntensityPairs(std::vector< MZIntensityPair > &output) const
copy binary data arrays into m/z-intensity pair array
void testBasic(const SpectrumList &sl)
SpectrumIterator configuration – note that constructors allow automatic conversion from IntegerSet ...
void testSieve(const SpectrumList &spectrumList)
std::vector< SpectrumPtr > spectra
represents a tag-value pair, where the tag comes from the controlled vocabulary
MS_mass_analyzer_type
mass analyzer type: Mass analyzer separates the ions according to their mass-to-charge ratio.
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
void printSpectrumList(ostream &os, const SpectrumList &sl)
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
a virtual container of integers, accessible via an iterator interface, stored as union of intervals