ProteoWizard
SpectrumList_Demux.hpp
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 //
5 // Original author: Jarrett Egertson <jegertso .@. uw.edu>
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 
20 #ifndef _SPECTRUMLIST_DEMUX_HPP
21 #define _SPECTRUMLIST_DEMUX_HPP
22 
24 #include <boost/smart_ptr/scoped_ptr.hpp>
26 
27 namespace pwiz {
28 namespace analysis {
29 
30  /// SpectrumList decorator implementation that can demultiplex spectra of several precursor windows acquired in the same scan.
31  /**
32  * SpectrumList_Demux can separate multiplexed spectra into several demultiplexed spectra by inferring from adjacent multiplexed spectra. This method
33  * can handle variable fill times, requiring that the user specify whether the fill times have varied.
34  */
36  {
37  public:
38 
39  /// User-defined options for demultiplexing
40  struct Params
41  {
42  /// Optimization methods available
43  enum class Optimization
44  {
45  NONE,
46  OVERLAP_ONLY
47  };
48 
49  /// Converts an optimization enum to a string
50  static const std::string& optimizationToString(Optimization opt);
51 
52  /// Converts a string to an optimization enum (returns NONE enum if no enum matches the string)
53  static Optimization stringToOptimization(const std::string& s);
54 
55  Params() :
56  massError(10, pwiz::chemistry::MZTolerance::PPM),
57  demuxBlockExtra(0.0),
58  nnlsMaxIter(50),
59  nnlsEps(1e-10),
60  applyWeighting(true),
61  regularizeSums(true),
62  variableFill(false),
63  optimization(Optimization::NONE)
64 
65  {}
66 
67  /// Error scalar for extracting MS/MS peaks.
69 
70  /// Multiplier to expand or reduce the # of spectra considered when demux'ing.
71  /// If 0, a fully determined system of equation is built. If > 1.0, the number
72  /// of rows included in the system is extended demuxBlockExtra * (# scans in 1 duty cycle)
73 
75 
76  /// Maximum iterations for NNLS solve
78 
79  /// Epsilon value for convergence criterion of NNLS solver
80  double nnlsEps;
81 
82  /// Weight the spectra nearby to the input spectrum more heavily in the solve
83  /// than the outer ones
85 
86  /// After demux solve, scale the sum of the intensities contributed form each
87  /// of the input windows to match the non-demux'd intensity
89 
90  /// Set to true if fill times are allowed to vary for each scan window
92 
93  /// Optimizations can be chosen when experimental design is known
95  };
96 
97  /// Generates an abstract SpectrumList_Demux decorator from inner SpectrumList
98  /// @param inner The inner SpectrumList
99  /// @param p User-defined options
100  SpectrumList_Demux(const msdata::SpectrumListPtr& inner, const Params& p = Params());
101 
102  virtual ~SpectrumList_Demux();
103 
104  /// \name SpectrumList Interface
105  ///@{
106 
107  msdata::SpectrumPtr spectrum(size_t index, bool getBinaryData = false) const;
108  msdata::SpectrumPtr spectrum(size_t index, msdata::DetailLevel detailLevel) const;
109  size_t size() const;
110  const msdata::SpectrumIdentity& spectrumIdentity(size_t index) const;
111  ///@}
112 
113  private:
114  class Impl;
115  boost::scoped_ptr<Impl> impl_;
116  };
117 
119 
120 } // namespace analysis
121 } // namespace pwiz
122 
123 #endif // _SPECTRUMLIST_DEMUX_HPP
pwiz::analysis::SpectrumList_Demux::Params::optimization
Optimization optimization
Optimizations can be chosen when experimental design is known.
Definition: SpectrumList_Demux.hpp:94
pwiz::msdata::SpectrumListPtr
boost::shared_ptr< SpectrumList > SpectrumListPtr
Definition: MSData.hpp:711
pwiz::analysis::SpectrumList_Demux
SpectrumList decorator implementation that can demultiplex spectra of several precursor windows acqui...
Definition: SpectrumList_Demux.hpp:35
pwiz::msdata::SpectrumIdentity
Identifying information for a spectrum.
Definition: MSData.hpp:470
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::msdata::SpectrumListWrapper
Inheritable pass-through implementation for wrapping a SpectrumList.
Definition: SpectrumListWrapper.hpp:37
pwiz::chemistry::MZTolerance
struct for expressing m/z tolerance in either amu or ppm
Definition: MZTolerance.hpp:38
pwiz::analysis::SpectrumList_Demux::impl_
boost::scoped_ptr< Impl > impl_
Definition: SpectrumList_Demux.hpp:114
pwiz::analysis::SpectrumList_Demux::Params::Params
Params()
Definition: SpectrumList_Demux.hpp:55
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
pwiz::analysis::SpectrumList_Demux::Params::variableFill
bool variableFill
Set to true if fill times are allowed to vary for each scan window.
Definition: SpectrumList_Demux.hpp:91
pwiz::analysis::SpectrumList_Demux::Params::regularizeSums
bool regularizeSums
After demux solve, scale the sum of the intensities contributed form each of the input windows to mat...
Definition: SpectrumList_Demux.hpp:88
pwiz::analysis::SpectrumList_Demux::Params::nnlsMaxIter
int nnlsMaxIter
Maximum iterations for NNLS solve.
Definition: SpectrumList_Demux.hpp:77
pwiz::analysis::SpectrumList_Demux::Params::applyWeighting
bool applyWeighting
Weight the spectra nearby to the input spectrum more heavily in the solve than the outer ones.
Definition: SpectrumList_Demux.hpp:84
pwiz::msdata::SpectrumPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: MSData.hpp:573
pwiz::analysis::SpectrumList_Demux::Params
User-defined options for demultiplexing.
Definition: SpectrumList_Demux.hpp:40
pwiz::analysis::SpectrumList_Demux::Params::massError
pwiz::chemistry::MZTolerance massError
Error scalar for extracting MS/MS peaks.
Definition: SpectrumList_Demux.hpp:68
pwiz::analysis::SpectrumList_Demux::Params::Optimization
Optimization
Optimization methods available.
Definition: SpectrumList_Demux.hpp:43
pwiz::msdata::DetailLevel
DetailLevel
Definition: MSData.hpp:630
pwiz::analysis::SpectrumList_Demux::Params::demuxBlockExtra
double demuxBlockExtra
Multiplier to expand or reduce the # of spectra considered when demux'ing.
Definition: SpectrumList_Demux.hpp:74
MZTolerance.hpp
pwiz::analysis::SpectrumList_Demux::Params::nnlsEps
double nnlsEps
Epsilon value for convergence criterion of NNLS solver.
Definition: SpectrumList_Demux.hpp:80
pwiz::analysis::DemuxOptimization
SpectrumList_Demux::Params::Optimization DemuxOptimization
Definition: SpectrumList_Demux.hpp:118
SpectrumListWrapper.hpp