ProteoWizard
IDemultiplexer.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 _IDEMULTIPLEXER_HPP
21 #define _IDEMULTIPLEXER_HPP
22 
23 #include "IPrecursorMaskCodec.hpp"
24 
25 namespace pwiz{
26 namespace analysis{
27 
28  /// Interface for calculating demultiplexing scheme.
30  {
31  public:
32 
33  /// Shared pointer definition
34  typedef boost::shared_ptr<IDemultiplexer> ptr;
35 
36  /// Constant shared pointer definition
37  typedef boost::shared_ptr<const IDemultiplexer> const_ptr;
38 
39  /// Initializes the demultiplexer using the demux scheme provided by an IPrecursorMaskCodec
41 
42  /// Translates a spectrum into a set of matrices to be solved by NNLS
43  /// @param[in] index Index of the requested spectrum to be demultiplexed
44  /// @param[in] muxIndices The indices to mulitplexed spectra to use for demultiplexing. These spectra should be near in time to the spectrum
45  /// to demultiplex and there should be enough to provide a unique solution.
46  /// @param[out] masks The design matrix with rows corresponding to individual spectra and columns corresponding to MS1 isolation windows
47  /// @param[out] signal A transition (MS1 isolation -> MS2 point/centroid) to be deconvolved formatted as a column vector
48  /// (or a set of transitions formatted as a matrix)
49  virtual void BuildDeconvBlock(size_t index,
50  const std::vector<size_t>& muxIndices,
51  DemuxTypes::MatrixPtr& masks,
52  DemuxTypes::MatrixPtr& signal) = 0;
53 
54  /// Figures out which spectra to include in the system of equations to demux. This skips over MS1 spectra and returns the indices
55  /// of a range of MS2 spectra that can be used to demultiplex the chosen spectrum. This handles the case where the chosen spectrum
56  /// is at the beginning or end of a file and chooses a sufficient number of nearby MS2 spectra accordingly. More indices will be
57  /// included if the user has chosen to add additional demux blocks.
58  /// \post The returned indices are sorted
59  /// @param[in] indexToDemux Index of the requested spectrum
60  /// @param[out] muxIndices Indices of the multiplexed MS2 spectra to be used for demultiplexing
61  /// @param[in] demuxBlockExtra Amount to pad the block size by
62  virtual void GetMatrixBlockIndices(size_t indexToDemux, std::vector<size_t> &muxIndices, double demuxBlockExtra=0.0) const = 0;
63 
64  /// Returns the indices to the demultiplexed windows in the solution matrix corresponding to the windows extracted from the spectrum
65  /// whose index was provided to BuildDeconvBlock()
66  /// @return Returns the demux indices for the solved spectrum
67  virtual const std::vector<size_t>& SpectrumIndices() const = 0;
68 
69  virtual ~IDemultiplexer() {}
70  };
71 } // namespace analysis
72 } // namespace pwiz
73 
74 #endif // _IDEMULTIPLEXER_HPP
IPrecursorMaskCodec.hpp
pwiz::analysis::IDemultiplexer::const_ptr
boost::shared_ptr< const IDemultiplexer > const_ptr
Constant shared pointer definition.
Definition: IDemultiplexer.hpp:37
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::analysis::IDemultiplexer
Interface for calculating demultiplexing scheme.
Definition: IDemultiplexer.hpp:29
DemuxTypes::MatrixPtr
boost::shared_ptr< MatrixType > MatrixPtr
Definition: DemuxTypes.hpp:39
pwiz::msdata::SpectrumList_const_ptr
boost::shared_ptr< const msdata::SpectrumList > SpectrumList_const_ptr
Definition: DemuxTypes.hpp:28
pwiz::analysis::IDemultiplexer::GetMatrixBlockIndices
virtual void GetMatrixBlockIndices(size_t indexToDemux, std::vector< size_t > &muxIndices, double demuxBlockExtra=0.0) const =0
Figures out which spectra to include in the system of equations to demux.
pwiz::analysis::IPrecursorMaskCodec::const_ptr
boost::shared_ptr< const IPrecursorMaskCodec > const_ptr
Constant shared pointer definition.
Definition: IPrecursorMaskCodec.hpp:199
pwiz::analysis::IDemultiplexer::BuildDeconvBlock
virtual void BuildDeconvBlock(size_t index, const std::vector< size_t > &muxIndices, DemuxTypes::MatrixPtr &masks, DemuxTypes::MatrixPtr &signal)=0
Translates a spectrum into a set of matrices to be solved by NNLS.
pwiz::analysis::IDemultiplexer::Initialize
virtual void Initialize(msdata::SpectrumList_const_ptr slc, IPrecursorMaskCodec::const_ptr pmc)=0
Initializes the demultiplexer using the demux scheme provided by an IPrecursorMaskCodec.
pwiz::analysis::IDemultiplexer::ptr
boost::shared_ptr< IDemultiplexer > ptr
Shared pointer definition.
Definition: IDemultiplexer.hpp:34
pwiz::analysis::IDemultiplexer::SpectrumIndices
virtual const std::vector< size_t > & SpectrumIndices() const =0
Returns the indices to the demultiplexed windows in the solution matrix corresponding to the windows ...
pwiz::analysis::IDemultiplexer::~IDemultiplexer
virtual ~IDemultiplexer()
Definition: IDemultiplexer.hpp:69