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