ProteoWizard
Classes | Public Member Functions | Static Protected Member Functions | Private Attributes | List of all members
pwiz::analysis::OverlapDemultiplexer Class Reference

Implementation of the IDemultiplexer interface that is able to handle overlap experiments. More...

#include <OverlapDemultiplexer.hpp>

Inheritance diagram for pwiz::analysis::OverlapDemultiplexer:
pwiz::analysis::IDemultiplexer

Classes

struct  Params
 User-defined options for demultiplexing. More...
 

Public Member Functions

 OverlapDemultiplexer (Params p=Params())
 Constructs an OverlapDemultiplexer with optional user-specified parameters. More...
 
virtual ~OverlapDemultiplexer ()
 
IDemultiplexer interface
void Initialize (msdata::SpectrumList_const_ptr sl, IPrecursorMaskCodec::const_ptr pmc) override
 Initializes the demultiplexer using the demux scheme provided by an IPrecursorMaskCodec. More...
 
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. More...
 
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. More...
 
const std::vector< size_t > & SpectrumIndices () const override
 Returns the indices to the demultiplexed windows in the solution matrix corresponding to the windows extracted from the spectrum whose index was provided to BuildDeconvBlock() More...
 
- Public Member Functions inherited from pwiz::analysis::IDemultiplexer
virtual ~IDemultiplexer ()
 

Static Protected Member Functions

static void InterpolateMuxRegion (Eigen::Ref< Eigen::MatrixXd, 0, Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > > interpolatedIntensities, double timeToInterpolate, Eigen::Ref< const Eigen::MatrixXd > intensities, Eigen::Ref< const Eigen::VectorXd > scanTimes)
 Performs interpolation on a matrix of intensities using a vector of scanTimes and outputs them to a row vector of interpolated intensities. More...
 
static double InterpolateMatrix (double pointToInterpolate, Eigen::Ref< const Eigen::VectorXd > points, Eigen::Ref< const Eigen::VectorXd > values)
 Takes two vectors of equal length and solves an interpolation for the given point. More...
 

Private Attributes

size_t overlapRegionsInApprox_
 The number of mux spectra nearby the spectrum to demux (in both retention time and m/z space) to use for demuxing. More...
 
size_t cyclesInBlock_
 The number of spectra with identical isolation parameters to use for interpolation. More...
 
msdata::SpectrumList_const_ptr sl_
 A SpectrumList that provides access to the spectra specified in the muxIndices list provided to BuildDeconvBlock() More...
 
IPrecursorMaskCodec::const_ptr pmc_
 An IPrecursorMaskCodec that provides information about the experiment's scheme and can generate the masks for given mux spectra. More...
 
Params params_
 A set of user-defined options. More...
 
std::vector< size_t > spectrumIndices_
 A cache of the indices provided by SpectrumIndices() More...
 

Additional Inherited Members

- Public Types inherited from pwiz::analysis::IDemultiplexer
typedef boost::shared_ptr< IDemultiplexerptr
 Shared pointer definition. More...
 
typedef boost::shared_ptr< const IDemultiplexerconst_ptr
 Constant shared pointer definition. More...
 

Detailed Description

Implementation of the IDemultiplexer interface that is able to handle overlap experiments.

Definition at line 30 of file OverlapDemultiplexer.hpp.

Constructor & Destructor Documentation

◆ OverlapDemultiplexer()

pwiz::analysis::OverlapDemultiplexer::OverlapDemultiplexer ( Params  p = Params())
explicit

Constructs an OverlapDemultiplexer with optional user-specified parameters.

Parameters
pOptions to use in demultiplexing (see Params for available options)

◆ ~OverlapDemultiplexer()

virtual pwiz::analysis::OverlapDemultiplexer::~OverlapDemultiplexer ( )
virtual

Member Function Documentation

◆ Initialize()

void pwiz::analysis::OverlapDemultiplexer::Initialize ( msdata::SpectrumList_const_ptr  slc,
IPrecursorMaskCodec::const_ptr  pmc 
)
overridevirtual

Initializes the demultiplexer using the demux scheme provided by an IPrecursorMaskCodec.

Implements pwiz::analysis::IDemultiplexer.

◆ BuildDeconvBlock()

void pwiz::analysis::OverlapDemultiplexer::BuildDeconvBlock ( size_t  index,
const std::vector< size_t > &  muxIndices,
DemuxTypes::MatrixPtr masks,
DemuxTypes::MatrixPtr signal 
)
overridevirtual

Translates a spectrum into a set of matrices to be solved by NNLS.

Parameters
[in]indexIndex of the requested spectrum to be demultiplexed
[in]muxIndicesThe indices to mulitplexed spectra to use for demultiplexing. These spectra should be near in time to the spectrum to demultiplex and there should be enough to provide a unique solution.
[out]masksThe design matrix with rows corresponding to individual spectra and columns corresponding to MS1 isolation windows
[out]signalA transition (MS1 isolation -> MS2 point/centroid) to be deconvolved formatted as a column vector (or a set of transitions formatted as a matrix)

Implements pwiz::analysis::IDemultiplexer.

◆ GetMatrixBlockIndices()

void pwiz::analysis::OverlapDemultiplexer::GetMatrixBlockIndices ( size_t  indexToDemux,
std::vector< size_t > &  muxIndices,
double  demuxBlockExtra 
) const
overridevirtual

Figures out which spectra to include in the system of equations to demux.

This skips over MS1 spectra and returns the indices of a range of MS2 spectra that can be used to demultiplex the chosen spectrum. This handles the case where the chosen spectrum is at the beginning or end of a file and chooses a sufficient number of nearby MS2 spectra accordingly. More indices will be included if the user has chosen to add additional demux blocks.

Postcondition
The returned indices are sorted
Parameters
[in]indexToDemuxIndex of the requested spectrum
[out]muxIndicesIndices of the multiplexed MS2 spectra to be used for demultiplexing
[in]demuxBlockExtraAmount to pad the block size by

Implements pwiz::analysis::IDemultiplexer.

◆ SpectrumIndices()

const std::vector<size_t>& pwiz::analysis::OverlapDemultiplexer::SpectrumIndices ( ) const
overridevirtual

Returns the indices to the demultiplexed windows in the solution matrix corresponding to the windows extracted from the spectrum whose index was provided to BuildDeconvBlock()

Returns
Returns the demux indices for the solved spectrum

Implements pwiz::analysis::IDemultiplexer.

◆ InterpolateMuxRegion()

static void pwiz::analysis::OverlapDemultiplexer::InterpolateMuxRegion ( Eigen::Ref< Eigen::MatrixXd, 0, Eigen::Stride< Eigen::Dynamic, Eigen::Dynamic > >  interpolatedIntensities,
double  timeToInterpolate,
Eigen::Ref< const Eigen::MatrixXd >  intensities,
Eigen::Ref< const Eigen::VectorXd >  scanTimes 
)
staticprotected

Performs interpolation on a matrix of intensities using a vector of scanTimes and outputs them to a row vector of interpolated intensities.

Parameters
[out]interpolatedIntensitiesThe row vector of interpolated intensities mapped from timeToInterpolate. The Ref template convinces Eigen that this can be column or row.
[in]timeToInterpolateThe time corresponding to the scan to be demuxed
[in]intensitiesA matrix of intensities of a number of nearby spectra. Each spectrum should have a row of transitions.
[in]scanTimesA vector of scanTimes. Because the same scan times are used for every transition in a given spectrum it is only necessary to pass a vector of scanTimes rather than a matrix. This vector is reused for interpolating every transition.

◆ InterpolateMatrix()

static double pwiz::analysis::OverlapDemultiplexer::InterpolateMatrix ( double  pointToInterpolate,
Eigen::Ref< const Eigen::VectorXd >  points,
Eigen::Ref< const Eigen::VectorXd >  values 
)
staticprotected

Takes two vectors of equal length and solves an interpolation for the given point.

Parameters
pointToInterpolateIndependent variable to interpolate
pointsThe independent values as a monotonically increasing series
valuesThe dependent values
Returns
Returns the solved interpolation value
Precondition
points must be sorted in order of increasing value with no duplicates
points and values must be of the same size

Member Data Documentation

◆ overlapRegionsInApprox_

size_t pwiz::analysis::OverlapDemultiplexer::overlapRegionsInApprox_
private

The number of mux spectra nearby the spectrum to demux (in both retention time and m/z space) to use for demuxing.

Definition at line 99 of file OverlapDemultiplexer.hpp.

◆ cyclesInBlock_

size_t pwiz::analysis::OverlapDemultiplexer::cyclesInBlock_
private

The number of spectra with identical isolation parameters to use for interpolation.

Definition at line 102 of file OverlapDemultiplexer.hpp.

◆ sl_

msdata::SpectrumList_const_ptr pwiz::analysis::OverlapDemultiplexer::sl_
private

A SpectrumList that provides access to the spectra specified in the muxIndices list provided to BuildDeconvBlock()

Definition at line 105 of file OverlapDemultiplexer.hpp.

◆ pmc_

IPrecursorMaskCodec::const_ptr pwiz::analysis::OverlapDemultiplexer::pmc_
private

An IPrecursorMaskCodec that provides information about the experiment's scheme and can generate the masks for given mux spectra.

Definition at line 108 of file OverlapDemultiplexer.hpp.

◆ params_

Params pwiz::analysis::OverlapDemultiplexer::params_
private

A set of user-defined options.

Definition at line 111 of file OverlapDemultiplexer.hpp.

◆ spectrumIndices_

std::vector<size_t> pwiz::analysis::OverlapDemultiplexer::spectrumIndices_
private

A cache of the indices provided by SpectrumIndices()

Definition at line 114 of file OverlapDemultiplexer.hpp.


The documentation for this class was generated from the following file: