Go to the documentation of this file.
44 os <<
"Spectrum cache indices (from MRU to LRU):";
45 for (SpectrumListCache::CacheType::iterator itr = cache.
begin(); itr != cache.
end(); ++itr)
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]);
446 int main(
int argc,
char* argv[])
452 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
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...
int main(int argc, char *argv[])
a cache mapping spectrum indices to SpectrumPtrs
CacheType & spectrumCache()
returns a reference to the cache, to enable clearing it or changing the mode
The structure that captures the generation of a peak list (including the underlying acquisitions)
void testModeBinaryDataOnly()
std::vector< UserParam > userParams
a collection of uncontrolled user terms
bool insert(const item_type &item)
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
SpectrumPtr makeSpectrumPtr(size_t index, const string &id)
void testFileReads(const char *filename)
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
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
pwiz::util::BinaryData< double > data
the binary data.
MSData <-> MGF stream serialization.
#define unit_assert_operator_equal(expected, actual)
void testModeMetaDataOnly()
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,...
MemoryMRUCacheMode_BinaryDataOnly
void testMemoryMRUCache()
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
std::size_t max_size() const
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
MemoryMRUCacheMode_MetaDataOnly
void push_back(const T &value)
boost::shared_ptr< Spectrum > SpectrumPtr
const item_type & lru() const
Simple writeable in-memory implementation of SpectrumList.
ScanList scanList
list of scans
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
#define TEST_PROLOG(argc, argv)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
MSData object plus file I/O.
void testModeMetaDataAndBinaryData()
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
bool spectrumHasBinaryData(const Spectrum &s)
const item_type & mru() const
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...
The method of precursor ion selection and activation.
adds a level of flexible MRU caching to a SpectrumList processor chain
bool spectrumHasMetadata(const Spectrum &s)
bool hasBinaryData() const
returns true iff has nonnull and nonempty BinaryDataArrayPtr
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms