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));
256int main(
int argc,
char* argv[])
262 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
int main(int argc, char *argv[])
const char * anal(const CVParam &cvParam)
void initializeSpectrumList(SpectrumListSimple &spectrumList)
void testIteratorEquality(const SpectrumList &spectrumList)
int getScanNumber(const Spectrum &spectrum)
void testForEach(const SpectrumList &spectrumList)
void testIntegerSet(const SpectrumList &spectrumList)
void testMSDataConstruction()
void printSpectrumList(ostream &os, const SpectrumList &sl)
void doSomething(const Spectrum &spectrum)
void testSieve(const SpectrumList &spectrumList)
virtual bool accept(const Spectrum &spectrum) const
interface for filtering based on ScanInfo
SpectrumIterator provides convenient iteration through a set of scans in a SpectrumList.
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
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
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
void insert(Interval interval)
insert an interval of integers into the virtual container
MS_intensity_array
intensity array: A data array of intensity values.
MS_mass_analyzer
mass analyzer: Terms used to describe the Analyzer.
MS_FT_ICR
FT_ICR (fourier transform ion cyclotron resonance mass spectrometer): A mass spectrometer based on th...
MS_mass_analyzer_type
mass analyzer type: Mass analyzer separates the ions according to their mass-to-charge ratio.
MS_m_z_array
m/z array: A data array of m/z values.
MS_ion_trap
ion trap: A device for spatially confining ions using electric and magnetic fields alone or in combin...
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
boost::shared_ptr< Spectrum > SpectrumPtr
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
represents a tag-value pair, where the tag comes from the controlled vocabulary
CVParam cvParamChild(CVID cvid) const
finds child of cvid in the container:
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
The structure that captures the generation of a peak list (including the underlying acquisitions)
void getMZIntensityPairs(std::vector< MZIntensityPair > &output) const
copy binary data arrays into m/z-intensity pair array
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
SpectrumIterator configuration – note that constructors allow automatic conversion from IntegerSet or...
Simple writeable in-memory implementation of SpectrumList.
std::vector< SpectrumPtr > spectra
#define TEST_PROLOG(argc, argv)