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++)
122 spectrum->id =
"scan=" + lexical_cast<string>(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));
190 if (
os_) *
os_ <<
"testUpdateRequest()\n";
192 vector<MZIntensityPair> pairs(100);
195 for (
size_t i=0; i<10; i++)
200 spectrum->id =
"scan=" + lexical_cast<string>(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++)
242 spectrum->id =
"scan=" + lexical_cast<string>(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++)
286int main(
int argc,
char* argv[])
292 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
int main(int argc, char *argv[])
void testAutomaticUpdate()
void testMetadata(MSDataCache &cache)
void printCache(ostream &os, const MSDataCache &cache)
container of MSDataAnalyzer (composite pattern)
event generator for MSDataAnalyzer
Status analyze(const MSDataAnalyzer::DataInfo &dataInfo, ProgressCallback *progressCallback=0) const
analyze a single MSData object, calling back to client if requested
Interface for MSData analyzers.
simple memory cache for common MSData info
virtual void open(const DataInfo &dataInfo)
start analysis of the data
const SpectrumInfo & spectrumInfo(size_t index, bool getBinaryData=false)
access to SpectrumInfo with automatic update (open() must be called first)
virtual void update(const DataInfo &dataInfo, const Spectrum &spectrum)
analyze a single spectrum
MS_QIT
QIT (quadrupole ion trap): Quadrupole Ion Trap mass analyzer captures the ions in a three dimensional...
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...
boost::shared_ptr< MSDataAnalyzer > MSDataAnalyzerPtr
PWIZ_API_DECL void initializeTiny(MSData &msd)
boost::shared_ptr< Spectrum > SpectrumPtr
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
virtual UpdateRequest updateRequested(const DataInfo &dataInfo, const SpectrumIdentity &spectrumIdentity) const
ask analyzer if it wants an update
information about the data to be analyzed
MSDataCache configuration.
size_t binaryDataCacheSize
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)
Identifying information for a spectrum.
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
simple structure for holding Spectrum info
std::vector< MZIntensityPair > data
Simple writeable in-memory implementation of SpectrumList.
#define unit_assert_equal(x, y, epsilon)
#define TEST_PROLOG(argc, argv)