26#ifndef _DEMUXHELPERS_HPP
27#define _DEMUXHELPERS_HPP
31#include <boost/tokenizer.hpp>
59 for (
auto it = m.begin(); it != m.end(); ++it) {
60 if (it->second.compare(s) == 0)
139 size_t numSpectraToFind,
size_t stride = 1);
An exception class inspired by Java's EnumConstantNotPresentException.
bool TryGetDemuxIndex(const msdata::SpectrumIdentity &spectrumIdentity, size_t &index)
Tries to read the index of the demultiplexed spectrum relative to the multiplexed spectrum it was der...
bool TryGetNumPrecursors(const msdata::Spectrum &spectrum, int &numPrecursors)
Tries to get the number of precursors contributing to a multiplexed spectrum.
bool TryGetMSLevel(const msdata::Spectrum &spectrum, int &msLevel)
Tries to read MS level from spectrum.
boost::tokenizer< boost::char_separator< char > > ScanIdTokenizer
Tool for pulling each scan id attribute and its value from a scan id.
T stringToEnum(const std::string &s, std::map< T, std::string > m)
Converts a string to it's corresponding enum in a prebuilt map.
bool TryGetOriginalIndex(const msdata::SpectrumIdentity &spectrumIdentity, size_t &index)
Tries to read the original index of the spectrum before demultiplexing using the SpectrumIdentity of ...
bool FindNearbySpectra(std::vector< size_t > &spectraIndices, pwiz::msdata::SpectrumList_const_ptr slPtr, size_t centerIndex, size_t numSpectraToFind, size_t stride=1)
Tries to find a given number of ms2 spectra near the given spectrum index.
bool TryGetScanIDToken(const msdata::SpectrumIdentity &spectrumIdentity, const std::string &tokenName, std::string &value)
Tries to read the given token from a spectrum identity id.
const std::string & enumToString(T e, std::map< T, std::string > m)
Converts an enum to it's corresponding string in a prebuilt map.
bool TryGetStartTime(const msdata::Spectrum &spectrum, double &startTime)
Tries to get the start time of the scan.
boost::shared_ptr< const msdata::SpectrumList > SpectrumList_const_ptr
The structure that captures the generation of a peak list (including the underlying acquisitions)
Identifying information for a spectrum.