Go to the documentation of this file.
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;
156 return center >= this->mzLow && center <= this->
mzHigh;
196 typedef boost::shared_ptr<IPrecursorMaskCodec>
ptr;
199 typedef boost::shared_ptr<const IPrecursorMaskCodec>
const_ptr;
257 #endif // _IPRECURSORMASKCODEC_HPP
IsolationWindow(double mzLow, double mzHigh)
Constructs an IsolationWindow from a given mass range.
DemuxWindow demuxWindow
Set of isolation window boundaries that provides useful operations for sorting and comparing differen...
virtual int GetSpectraPerCycle() const =0
Returns the number of spectra required to cover all precursor isolation windows.
bool Contains(const DemuxWindow &inner) const
Can be used to find whether the mass range of another DemuxWindow is a subset of this one.
static MZHash Hash(double mz)
Hash a floating-point m/z value to an integer.
DemuxWindow(MZHash mzLow, MZHash mzHigh)
Constructs a DemuxWindow for a given mass range.
virtual void SpectrumToIndices(msdata::Spectrum_const_ptr sPtr, std::vector< size_t > &indices) const =0
Identifies the precursor windows within a spectrum and returns the indices to the design matrix colum...
Description of the default peak processing method. This element describes the base method used in the...
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< IPrecursorMaskCodec > ptr
Shared pointer definition.
IsolationWindow(const msdata::Precursor &p)
Constructs an IsolationWindow from a Precursor.
double precursor_target(const msdata::Precursor &p)
bool stringToFloatCompare(std::string i, std::string j)
MZHash mzLow
Start m/z of the window range.
double precursor_upper_offset(const msdata::Precursor &p)
double precursor_mz_low(const msdata::Precursor &p)
Matrix< DemuxScalar, Dynamic, Dynamic > MatrixType
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
boost::shared_ptr< const IPrecursorMaskCodec > const_ptr
Constant shared pointer definition.
double precursor_mz_high(const msdata::Precursor &p)
virtual IsolationWindow GetIsolationWindow(size_t i) const =0
Returns the precursor window for a given index.
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 precursor_lower_offset(const msdata::Precursor &p)
boost::shared_ptr< const msdata::Spectrum > Spectrum_const_ptr
Interface for generating and accessing precursor masks for a demultiplexing scheme.
std::string prec_to_string(const msdata::Precursor &p)
static double UnHash(MZHash hashed)
Unhash an integer to a floating-point m/z value.
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
virtual int GetOverlapsPerCycle() const =0
Returns the number of overlap repeats per cycle. So for no overlap, this returns 1....
MS_isolation_window_lower_offset
isolation window lower offset: The extent of the isolation window in m/z below the isolation window t...
A container for describing the isolation windows that are dedicated to columns of the design matrix f...
double lowMz
Full precision lower m/z bound.
virtual size_t GetDemuxBlockSize() const =0
Returns the number of windows required to demultiplex.
double highMz
Full precision upper m/z bound.
A container that wraps DemuxWindow to preserve the full precision window boundaries.
bool operator==(const DemuxWindow &rhs) const
Can be used to find whether two windows are identical within the error of the hash.
double precursor_iso_center(const msdata::Precursor &p)
virtual msdata::ProcessingMethod GetProcessingMethod() const =0
Returns a descriptor of the processing done by this PrecursorMaskCodec.
MZHash mzHigh
End m/z of the window range.
virtual size_t GetNumDemuxWindows() const =0
Returns the total number of demux'd precursor windows. This is the number of possible indices returne...
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
A method of hashing an isolation window to a unique long value mz is and m/z of a unique point in the...
bool ContainsCenter(const DemuxWindow &inner) const
Used to find whether a window's center is contained within this window.
virtual ~IPrecursorMaskCodec()
bool operator<(const IsolationWindow &rhs) const
Isolation windows are sorted by their start value.
double precursor_iso_width(const msdata::Precursor &p)
The method of precursor ion selection and activation.
bool operator<(const DemuxWindow &rhs) const
Isolation windows are sorted by their start value.
DemuxWindow(const msdata::Precursor &p)
Constructs a DemuxWindow from a Precursor by using its isolation window.
virtual int GetPrecursorsPerSpectrum() const =0
Returns the number of precursor isolations per spectrum. This is verified to be constant for all spec...
MS_isolation_window_upper_offset
isolation window upper offset: The extent of the isolation window in m/z above the isolation window t...
virtual Eigen::VectorXd GetMask(msdata::Spectrum_const_ptr sPtr, double weight=1.0) const =0
Generates a design matrix row describing which precursor isolation windows are present in the given s...