ProteoWizard
MSXDemultiplexer.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 _MSXDEMULTIPLEXER_HPP
21 #define _MSXDEMULTIPLEXER_HPP
22 
23 #include "IDemultiplexer.hpp"
24 #include "DemuxHelpers.hpp"
25 
26 namespace pwiz {
27 namespace analysis {
28 
29  /// Implementation of the IDemultiplexer interface that is able to handle both MSX experiments, including ones with overlap. For analyzing overlap
30  /// data without MSX it is recommended to use the OverlapDemultiplexer instead for better chromatographic interpolation.
32  {
33  public:
34 
35  /// User-defined options for demultiplexing
36  struct Params
37  {
38  Params() :
39  massError(10.0, pwiz::chemistry::MZTolerance::PPM),
40  applyWeighting(true),
41  variableFill(false)
42  {}
43 
44  /// Mass error for extracting MS/MS peaks
46 
47  /// Weight the spectra nearby to the input spectrum more heavily in the solve
48  /// than the outer ones
50 
51  /// Set to true if fill times are allowed to vary for each scan window
53  };
54 
55  /// Constructs an MSXDemultiplexer with optional user-specified parameters
56  /// @param p Options to use in demultiplexing (see Params for available options)
57  explicit MSXDemultiplexer(Params p = Params());
58 
59  virtual ~MSXDemultiplexer();
60 
61  /// \name IDemultiplexer interface
62  ///@{
63 
65  void BuildDeconvBlock(size_t index,
66  const std::vector<size_t>& muxIndices,
67  DemuxTypes::MatrixPtr& masks,
68  DemuxTypes::MatrixPtr& signal) override;
69  void GetMatrixBlockIndices(size_t indexToDemux, std::vector<size_t>& muxIndices, double demuxBlockExtra) const override;
70  const std::vector<size_t>& SpectrumIndices() const override;
71  ///@}
72 
73  private:
74 
75  /// A SpectrumList that provides access to the spectra specified in the muxIndices list provided to BuildDeconvBlock()
77 
78  /// An IPrecursorMaskCodec that provides information about the experiment's scheme and can generate the masks for given mux spectra
80 
81  /// A set of user-defined options
83 
84  /// A cache of the indices provided by SpectrumIndices()
85  std::vector<size_t> spectrumIndices_;
86  };
87 } // namespace analysis
88 } // namespace pwiz
89 #endif // _MSXDEMULTIPLEXER_HPP
msdata::SpectrumList_const_ptr sl_
A SpectrumList that provides access to the spectra specified in the muxIndices list provided to Build...
const std::vector< size_t > & SpectrumIndices() const override
Returns the indices to the demultiplexed windows in the solution matrix corresponding to the windows ...
Params params_
A set of user-defined options.
boost::shared_ptr< MatrixType > MatrixPtr
Definition: DemuxTypes.hpp:39
void Initialize(msdata::SpectrumList_const_ptr slc, IPrecursorMaskCodec::const_ptr pmc) override
Initializes the demultiplexer using the demux scheme provided by an IPrecursorMaskCodec.
Implementation of the IDemultiplexer interface that is able to handle both MSX experiments, including ones with overlap.
bool applyWeighting
Weight the spectra nearby to the input spectrum more heavily in the solve than the outer ones...
Interface for calculating demultiplexing scheme.
void BuildDeconvBlock(size_t index, const std::vector< size_t > &muxIndices, DemuxTypes::MatrixPtr &masks, DemuxTypes::MatrixPtr &signal) override
Translates a spectrum into a set of matrices to be solved by NNLS.
MSXDemultiplexer(Params p=Params())
Constructs an MSXDemultiplexer with optional user-specified parameters.
std::vector< size_t > spectrumIndices_
A cache of the indices provided by SpectrumIndices()
Helper functions for demultiplexing Helper functions include nice methods of accessing CV parameters ...
boost::shared_ptr< const IPrecursorMaskCodec > const_ptr
Constant shared pointer definition.
void GetMatrixBlockIndices(size_t indexToDemux, std::vector< size_t > &muxIndices, double demuxBlockExtra) const override
Figures out which spectra to include in the system of equations to demux.
pwiz::chemistry::MZTolerance massError
Mass error for extracting MS/MS peaks.
bool variableFill
Set to true if fill times are allowed to vary for each scan window.
struct for expressing m/z tolerance in either amu or ppm
Definition: MZTolerance.hpp:38
IPrecursorMaskCodec::const_ptr pmc_
An IPrecursorMaskCodec that provides information about the experiment&#39;s scheme and can generate the m...
User-defined options for demultiplexing.
boost::shared_ptr< const msdata::SpectrumList > SpectrumList_const_ptr
Definition: DemuxTypes.hpp:28