20 #ifndef _IPRECURSORMASKCODEC_HPP 21 #define _IPRECURSORMASKCODEC_HPP 24 #include <boost/format.hpp> 32 if (upperOffsetParam.value.empty())
33 throw std::runtime_error(
"precursor_upper_offset() No isolation window upper offset m/z specified");
34 double upperOffset = upperOffsetParam.valueAs<
double>();
35 if (upperOffset <= 0.0)
36 throw std::runtime_error(
"precursor_upper_offset() Positive values expected for isolation window m/z offsets");
43 if (lowerOffsetParam.value.empty())
44 throw std::runtime_error(
"precursor_lower_offset() No isolation window lower offset m/z specified");
45 double lowerOffset = lowerOffsetParam.valueAs<
double>();
46 if (lowerOffset <= 0.0)
47 throw std::runtime_error(
"precursor_lower_offset() Positive values expected for isolation window m/z offsets");
54 if (targetParam.value.empty())
55 throw std::runtime_error(
"precursor_target() No isolation window target m/z specified");
56 return targetParam.valueAs<
double>();
74 return (mzLow + mzHigh) / 2.0;
106 auto mult = mz * 100000000.0;
107 auto rounded = llround(mult);
108 return static_cast<MZHash
>(rounded);
114 return hashed / 100000000.0;
139 explicit DemuxWindow(MZHash mzLow, MZHash mzHigh) : mzLow(mzLow), mzHigh(mzHigh)
149 return inner.
mzLow >= this->mzLow && inner.
mzHigh <= this->mzHigh;
155 auto center =
static_cast<size_t>(llround(inner.
mzLow + (inner.
mzHigh - inner.
mzLow) / 2.0));
156 return center >= this->mzLow && center <= this->mzHigh;
196 typedef boost::shared_ptr<IPrecursorMaskCodec>
ptr;
199 typedef boost::shared_ptr<const IPrecursorMaskCodec>
const_ptr;
230 virtual size_t GetNumDemuxWindows()
const = 0;
233 virtual int GetSpectraPerCycle()
const = 0;
236 virtual int GetPrecursorsPerSpectrum()
const = 0;
239 virtual int GetOverlapsPerCycle()
const = 0;
242 virtual size_t GetDemuxBlockSize()
const = 0;
257 #endif // _IPRECURSORMASKCODEC_HPP A method of hashing an isolation window to a unique long value mz is and m/z of a unique point in the...
IsolationWindow(const msdata::Precursor &p)
Constructs an IsolationWindow from a Precursor.
bool stringToFloatCompare(std::string i, std::string j)
MS_isolation_window_lower_offset
isolation window lower offset: The extent of the isolation window in m/z below the isolation window t...
boost::shared_ptr< IPrecursorMaskCodec > ptr
Shared pointer definition.
virtual ~IPrecursorMaskCodec()
IsolationWindow(double mzLow, double mzHigh)
Constructs an IsolationWindow from a given mass range.
The method of precursor ion selection and activation.
A container for describing the isolation windows that are dedicated to columns of the design matrix f...
bool operator==(const DemuxWindow &rhs) const
Can be used to find whether two windows are identical within the error of the hash.
A container that wraps DemuxWindow to preserve the full precision window boundaries.
bool ContainsCenter(const DemuxWindow &inner) const
Used to find whether a window's center is contained within this window.
double precursor_iso_center(const msdata::Precursor &p)
double precursor_mz_high(const msdata::Precursor &p)
MZHash mzHigh
End m/z of the window range.
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
double precursor_lower_offset(const msdata::Precursor &p)
double precursor_target(const msdata::Precursor &p)
double precursor_upper_offset(const msdata::Precursor &p)
std::string prec_to_string(const msdata::Precursor &p)
Interface for generating and accessing precursor masks for a demultiplexing scheme.
Description of the default peak processing method. This element describes the base method used in the...
DemuxWindow(const msdata::Precursor &p)
Constructs a DemuxWindow from a Precursor by using its isolation window.
bool operator<(const DemuxWindow &rhs) const
Isolation windows are sorted by their start value.
static MZHash Hash(double mz)
Hash a floating-point m/z value to an integer.
double lowMz
Full precision lower m/z bound.
DemuxWindow(MZHash mzLow, MZHash mzHigh)
Constructs a DemuxWindow for a given mass range.
MS_isolation_window_target_m_z
isolation window target m/z: The primary or reference m/z about which the isolation window is defined...
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
double precursor_mz_low(const msdata::Precursor &p)
PWIZ_API_DECL Reader_Bruker_Format format(const std::string &path)
returns Bruker format of 'path' if it is a Bruker directory; otherwise returns empty string ...
bool Contains(const DemuxWindow &inner) const
Can be used to find whether the mass range of another DemuxWindow is a subset of this one...
boost::shared_ptr< const IPrecursorMaskCodec > const_ptr
Constant shared pointer definition.
Matrix< DemuxScalar, Dynamic, Dynamic > MatrixType
bool operator!=(const DemuxWindow &rhs) const
Can be used to find whether two windows are identical within the error of the hash.
boost::shared_ptr< const msdata::Spectrum > Spectrum_const_ptr
MZHash mzLow
Start m/z of the window range.
double precursor_iso_width(const msdata::Precursor &p)
double highMz
Full precision upper m/z bound.
static double UnHash(MZHash hashed)
Unhash an integer to a floating-point m/z value.
MS_isolation_window_upper_offset
isolation window upper offset: The extent of the isolation window in m/z above the isolation window t...
DemuxWindow demuxWindow
Set of isolation window boundaries that provides useful operations for sorting and comparing differen...
bool operator<(const IsolationWindow &rhs) const
Isolation windows are sorted by their start value.