44 os <<
"Spectrum cache indices (from MRU to LRU):";
46 os <<
" " << itr->spectrum->index;
90 spectrum->index = index;
93 spectrum->precursors.push_back(
Precursor(123.4));
97 for (
size_t i=0; i < (index+1)*10; ++i)
102 spectrum->defaultArrayLength = mzArray.
data.
size();
146 if (
os_) *
os_ << cache << endl;
164 boost::shared_ptr<stringstream> ss(
new stringstream);
166 serializer.
write(*ss, msd, 0);
167 serializer.
read(ss, msd);
187 if (
os_) *
os_ << cache << endl;
195 if (
os_) *
os_ << cache << endl;
208 if (
os_) *
os_ << cache << endl;
217 if (
os_) *
os_ << cache << endl;
227 if (
os_) *
os_ << cache << endl;
250 boost::shared_ptr<stringstream> ss(
new stringstream);
252 serializer.
write(*ss, msd, 0);
253 serializer.
read(ss, msd);
271 if (
os_) *
os_ << cache << endl;
278 if (
os_) *
os_ << cache << endl;
286 if (
os_) *
os_ << cache << endl;
294 if (
os_) *
os_ << cache << endl;
305 if (
os_) *
os_ << cache << endl;
329 boost::shared_ptr<stringstream> ss(
new stringstream);
331 serializer.
write(*ss, msd, 0);
332 serializer.
read(ss, msd);
350 if (
os_) *
os_ << cache << endl;
359 if (
os_) *
os_ << cache << endl;
367 if (
os_) *
os_ << cache << endl;
378 if (
os_) *
os_ << cache << endl;
389 if (
os_) *
os_ << cache << endl;
400 std::string srcparent(__FILE__);
402 size_t pos = srcparent.rfind(
"pwiz");
403 srcparent.resize(pos);
404 std::string example_data_dir = srcparent +
"example_data/";
423 c->binaryDataArrayPtrs[0]->data[0]);
424 unit_assert(!s->binaryDataArrayPtrs[1]->data.empty());
425 unit_assert(!c->binaryDataArrayPtrs[1]->data.empty());
427 c->binaryDataArrayPtrs[1]->data[0]);
446int main(
int argc,
char* argv[])
452 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
MemoryMRUCacheMode_MetaDataOnly
MemoryMRUCacheMode_BinaryDataOnly
void testFileReads(const char *filename)
int main(int argc, char *argv[])
bool spectrumHasBinaryData(const Spectrum &s)
void testModeMetaDataAndBinaryData()
void testMemoryMRUCache()
void testModeBinaryDataOnly()
SpectrumPtr makeSpectrumPtr(size_t index, const string &id)
bool spectrumHasMetadata(const Spectrum &s)
void testModeMetaDataOnly()
MSData <-> MGF stream serialization.
void read(boost::shared_ptr< std::istream > is, MSData &msd) const
read in MSData object from an MGF istream note: istream may be managed by MSData's SpectrumList,...
void write(std::ostream &os, const MSData &msd, const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0) const
write MSData object to ostream as MGF; iterationListenerRegistry may be used to receive progress upda...
adds a level of flexible MRU caching to a SpectrumList processor chain
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const
returns the requested spectrum which may or may not be cached depending on the current cache mode
CacheType & spectrumCache()
returns a reference to the cache, to enable clearing it or changing the mode
void push_back(const T &value)
std::size_t max_size() const
const item_type & mru() const
const item_type & lru() const
item_list::iterator iterator
bool insert(const item_type &item)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
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< Spectrum > SpectrumPtr
ostream & operator<<(ostream &os, SpectrumListCache::CacheType &cache)
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
std::vector< UserParam > userParams
a collection of uncontrolled user terms
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
pwiz::util::BinaryData< double > data
the binary data.
MSData object plus file I/O.
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.
The method of precursor ion selection and activation.
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)
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
bool hasBinaryData() const
returns true iff has nonnull and nonempty BinaryDataArrayPtr
ScanList scanList
list of scans
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
a cache mapping spectrum indices to SpectrumPtrs
Simple writeable in-memory implementation of SpectrumList.
#define unit_assert_operator_equal(expected, actual)
#define TEST_PROLOG(argc, argv)