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
pwiz::analysis::MSXDemultiplexer::Params::Params
Params()
Definition: MSXDemultiplexer.hpp:38
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::analysis::IDemultiplexer
Interface for calculating demultiplexing scheme.
Definition: IDemultiplexer.hpp:30
DemuxTypes::MatrixPtr
boost::shared_ptr< MatrixType > MatrixPtr
Definition: DemuxTypes.hpp:39
pwiz::analysis::MSXDemultiplexer::GetMatrixBlockIndices
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::msdata::SpectrumList_const_ptr
boost::shared_ptr< const msdata::SpectrumList > SpectrumList_const_ptr
Definition: DemuxTypes.hpp:28
pwiz::chemistry::MZTolerance
struct for expressing m/z tolerance in either amu or ppm
Definition: MZTolerance.hpp:39
pwiz::analysis::IPrecursorMaskCodec::const_ptr
boost::shared_ptr< const IPrecursorMaskCodec > const_ptr
Constant shared pointer definition.
Definition: IPrecursorMaskCodec.hpp:199
pwiz::analysis::MSXDemultiplexer::BuildDeconvBlock
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.
pwiz::analysis::MSXDemultiplexer::Params::variableFill
bool variableFill
Set to true if fill times are allowed to vary for each scan window.
Definition: MSXDemultiplexer.hpp:52
pwiz::analysis::MSXDemultiplexer::params_
Params params_
A set of user-defined options.
Definition: MSXDemultiplexer.hpp:82
pwiz::analysis::MSXDemultiplexer::SpectrumIndices
const std::vector< size_t > & SpectrumIndices() const override
Returns the indices to the demultiplexed windows in the solution matrix corresponding to the windows ...
pwiz::analysis::MSXDemultiplexer::sl_
msdata::SpectrumList_const_ptr sl_
A SpectrumList that provides access to the spectra specified in the muxIndices list provided to Build...
Definition: MSXDemultiplexer.hpp:76
pwiz::analysis::MSXDemultiplexer
Implementation of the IDemultiplexer interface that is able to handle both MSX experiments,...
Definition: MSXDemultiplexer.hpp:32
pwiz::analysis::MSXDemultiplexer::Params
User-defined options for demultiplexing.
Definition: MSXDemultiplexer.hpp:37
pwiz::analysis::MSXDemultiplexer::Params::massError
pwiz::chemistry::MZTolerance massError
Mass error for extracting MS/MS peaks.
Definition: MSXDemultiplexer.hpp:45
DemuxHelpers.hpp
pwiz::analysis::MSXDemultiplexer::MSXDemultiplexer
MSXDemultiplexer(Params p=Params())
Constructs an MSXDemultiplexer with optional user-specified parameters.
pwiz::analysis::MSXDemultiplexer::spectrumIndices_
std::vector< size_t > spectrumIndices_
A cache of the indices provided by SpectrumIndices()
Definition: MSXDemultiplexer.hpp:85
pwiz::analysis::MSXDemultiplexer::pmc_
IPrecursorMaskCodec::const_ptr pmc_
An IPrecursorMaskCodec that provides information about the experiment's scheme and can generate the m...
Definition: MSXDemultiplexer.hpp:79
pwiz::analysis::MSXDemultiplexer::Params::applyWeighting
bool applyWeighting
Weight the spectra nearby to the input spectrum more heavily in the solve than the outer ones.
Definition: MSXDemultiplexer.hpp:49
pwiz::analysis::MSXDemultiplexer::Initialize
void Initialize(msdata::SpectrumList_const_ptr slc, IPrecursorMaskCodec::const_ptr pmc) override
Initializes the demultiplexer using the demux scheme provided by an IPrecursorMaskCodec.
IDemultiplexer.hpp
pwiz::analysis::MSXDemultiplexer::~MSXDemultiplexer
virtual ~MSXDemultiplexer()