43 if (
os_) *
os_ <<
"testMetadata()\n";
45 if (
os_) *
os_ <<
"spectrumCount: " << cache.size() << endl;
99 os <<
"cached binary data:\n";
100 for (vector<SpectrumInfo>::const_iterator it=cache.begin(); it!=cache.end(); ++it)
102 os << it->index <<
" " 103 << it->data.size() <<
"/" 104 << it->data.capacity() << endl;
112 if (
os_) *
os_ <<
"testMRU()\n";
114 vector<MZIntensityPair> pairs(100);
117 for (
size_t i=0; i<10; i++)
123 sl->spectra.push_back(spectrum);
135 if (
os_) *
os_ <<
"update: 0 1 2\n";
136 cache.
update(msd, *sl->spectrum(0,
true));
137 cache.
update(msd, *sl->spectrum(1,
true));
138 cache.
update(msd, *sl->spectrum(2,
true));
146 if (
os_) *
os_ <<
"update: 3\n";
147 cache.
update(msd, *sl->spectrum(3,
true));
155 if (
os_) *
os_ <<
"update: 1\n";
156 cache.
update(msd, *sl->spectrum(1,
true));
164 if (
os_) *
os_ <<
"update: 4\n";
165 cache.
update(msd, *sl->spectrum(4,
true));
181 const SpectrumIdentity& spectrumIdentity)
const 190 if (
os_) *
os_ <<
"testUpdateRequest()\n";
192 vector<MZIntensityPair> pairs(100);
195 for (
size_t i=0; i<10; i++)
201 sl->spectra.push_back(spectrum);
209 analyzers.push_back(cache);
215 for (
size_t i=0, end=cache->size(); i<end; i++)
223 i%2==1 && info.
index==(
size_t)-1&& info.
id.empty());
232 if (
os_) *
os_ <<
"testAutomaticUpdate()\n";
234 vector<MZIntensityPair> pairs(100);
237 for (
size_t i=0; i<10; i++)
243 sl->spectra.push_back(spectrum);
253 for (
size_t i=0; i<cache.size(); i++)
267 for (
size_t i=0; i<cache.size(); i++)
268 *
os_ << i <<
" " << cache[i].index <<
" " << cache[i].
id <<
" " 269 << cache[i].data.size() << endl;
276 unit_assert(cache[5].index==5 && cache[5].
id==
"scan=5");
278 unit_assert(cache[7].index==7 && cache[7].
id==
"scan=7");
280 for (
size_t i=0; i<cache.size(); i++)
286 int main(
int argc,
char* argv[])
292 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
simple memory cache for common MSData info
boost::shared_ptr< Spectrum > SpectrumPtr
boost::shared_ptr< MSDataAnalyzer > MSDataAnalyzerPtr
#define unit_assert_equal(x, y, epsilon)
void testMetadata(MSDataCache &cache)
Status analyze(const MSDataAnalyzer::DataInfo &dataInfo, ProgressCallback *progressCallback=0) const
analyze a single MSData object, calling back to client if requested
void testAutomaticUpdate()
float lexical_cast(const std::string &str)
container of MSDataAnalyzer (composite pattern)
size_t binaryDataCacheSize
void printCache(ostream &os, const MSDataCache &cache)
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
event generator for MSDataAnalyzer
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
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.
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
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 void open(const DataInfo &dataInfo)
start analysis of the data
MS_QIT
QIT (quadrupole ion trap): Quadrupole Ion Trap mass analyzer captures the ions in a three dimensional...
information about the data to be analyzed
#define TEST_PROLOG(argc, argv)
virtual void update(const DataInfo &dataInfo, const Spectrum &spectrum)
analyze a single spectrum
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
MSDataCache configuration.
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
std::vector< MZIntensityPair > data
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
virtual UpdateRequest updateRequested(const DataInfo &dataInfo, const SpectrumIdentity &spectrumIdentity) const
Simple writeable in-memory implementation of SpectrumList.
Interface for MSData analyzers.
int main(int argc, char *argv[])
const SpectrumInfo & spectrumInfo(size_t index, bool getBinaryData=false)
access to SpectrumInfo with automatic update (open() must be called first)
simple structure for holding Spectrum info