Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes

PSLPFormulation Class Reference

Implements ILP formulation of precursor selection problems. More...

#include <OpenMS/ANALYSIS/TARGETED/PSLPFormulation.h>

Inheritance diagram for PSLPFormulation:
DefaultParamHandler

List of all members.

Classes

struct  IndexLess
struct  IndexTriple
 Struct that holds the indices of the precursors in the feature map and the ilp formulation. More...
struct  ScanLess
struct  VariableIndexLess

Public Member Functions

 PSLPFormulation ()
virtual ~PSLPFormulation ()
template<typename InputPeakType >
void createAndSolveILPForKnownLCMSMapFeatureBased (const FeatureMap<> &features, const MSExperiment< InputPeakType > &experiment, std::vector< IndexTriple > &variable_indices, std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, std::set< Int > &charges_set, UInt ms2_spectra_per_rt_bin, std::vector< int > &solution_indices)
 Encode ILP formulation for a given LC-MS map, but unknown protein sample.
void createAndSolveILPForInclusionListCreation (PrecursorIonSelectionPreprocessing &preprocessing, UInt ms2_spectra_per_rt_bin, UInt max_list_size, FeatureMap<> &precursors, bool solve_ILP=true)
 Find a set of precursors, so that the protein coverage is maximal and that the number of precursors per bin is not exceeded.
template<typename InputPeakType >
void createAndSolveCombinedLPForKnownLCMSMapFeatureBased (const FeatureMap<> &features, const MSExperiment< InputPeakType > &experiment, std::vector< IndexTriple > &variable_indices, std::vector< int > &solution_indices, std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, std::set< Int > &charges_set, UInt ms2_spectra_per_rt_bin, Size step_size=0, bool sequential_order=false)
void updateStepSizeConstraint (Size iteration, UInt step_size)
void updateFeatureILPVariables (FeatureMap<> &new_features, std::vector< IndexTriple > &variable_indices, std::map< Size, std::vector< String > > &feature_constraints_map)
void updateRTConstraintsForSequentialILP (Size &rt_index, UInt ms2_spectra_per_rt_bin, Size max_rt_index)
void updateCombinedILP (FeatureMap<> &features, PrecursorIonSelectionPreprocessing &preprocessed_db, std::vector< IndexTriple > &variable_indices, std::vector< String > &new_protein_accs, std::vector< String > &protein_accs, PSProteinInference &prot_inference, Size &variable_counter, std::map< String, std::vector< Size > > &protein_feature_map, Feature &new_feature, std::map< String, Size > &protein_variable_index_map, std::map< String, std::set< String > > &prot_id_counter)
void solveILP (std::vector< int > &solution_indices)
 Solve the ILP.
void setLPSolver (LPWrapper::SOLVER solver)
LPWrapper::SOLVER getLPSolver ()
template<typename InputPeakType >
void createAndSolveCombinedLPForKnownLCMSMapFeatureBased (const FeatureMap<> &features, const MSExperiment< InputPeakType > &experiment, std::vector< IndexTriple > &variable_indices, std::vector< Int > &solution_indices, std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, std::set< Int > &charges_set, UInt ms2_spectra_per_rt_bin, Size step_size, bool sequential_order)

Protected Member Functions

template<typename InputPeakType >
void getXIC_ (const std::vector< std::pair< Size, Size > > &end_points, std::vector< DoubleReal > &weights, const MSExperiment< InputPeakType > &experiment, const bool normalize)
template<typename InputPeakType >
void calculateXICs_ (std::vector< std::vector< DoubleReal > > &xics, const FeatureMap<> &features, const MSExperiment< InputPeakType > &experiment, const std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, const bool normalize)
 Calculates the XICs for all features.
void createAndSolveILP_ (const FeatureMap<> &features, std::vector< std::vector< DoubleReal > > &intensity_weights, std::set< Int > &charges_set, std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, std::vector< IndexTriple > &variable_indices, std::vector< int > &solution_indices, UInt ms2_spectra_per_rt_bin, Size number_of_scans)
 Creates and solves the ILP.
void createAndSolveCombinedLPFeatureBased_ (const FeatureMap<> &features, std::vector< std::vector< DoubleReal > > &intensity_weights, std::set< Int > &charges_set, std::vector< std::vector< std::pair< Size, Size > > > &mass_ranges, std::vector< IndexTriple > &variable_indices, std::vector< Int > &solution_indices, UInt ms2_spectra_per_rt_bin, Size number_of_scans, Size step_size=0, bool sequential_order=false)
void addProteinToILP_ (PrecursorIonSelectionPreprocessing &preprocessing, std::map< String, std::vector< DoubleReal > >::const_iterator map_iter, Size &counter, Size &pep_counter, Size &feature_counter, std::vector< IndexTriple > &variable_indices, std::map< String, Size > &protein_penalty_index_map, FeatureMap<> &precursors)
void addPrecursorAcquisitionNumberConstraint_ (std::vector< IndexTriple > &variable_indices, Size number_of_features, UInt number_of_msms_per_precursor)
void addMaxInclusionListSizeConstraints_ (std::vector< IndexTriple > &variable_indices, UInt max_list_size)
void addRTBinCapacityConstraint_ (std::vector< IndexTriple > &variable_indices, Size max_rt_index, UInt ms2_spectra_per_rt_bin, bool sequential_order=false)
void addProteinCoverageConstraint_ (std::vector< IndexTriple > &variable_indices, PrecursorIonSelectionPreprocessing &preprocessing, std::map< String, Size > protein_variable_index_map)
void addStepSizeConstraint_ (std::vector< IndexTriple > &variable_indices, UInt step_size)
void assembleInclusionListForProteinBasedLP_ (std::vector< IndexTriple > &variable_indices, FeatureMap<> &precursors, std::vector< int > &solution_indices, PrecursorIonSelectionPreprocessing &preprocessing)
void updateObjFunction_ (String acc, FeatureMap<> &features, PrecursorIonSelectionPreprocessing &preprocessed_db, std::vector< IndexTriple > &variable_indices)
Int getNumberOfPrecsInSpectrum_ (Int constr_idx)

Protected Attributes

LPWrappermodel_
LPWrapper::SOLVER solver_

Detailed Description

Implements ILP formulation of precursor selection problems.


Constructor & Destructor Documentation

PSLPFormulation (  ) 
virtual ~PSLPFormulation (  )  [virtual]

Member Function Documentation

void addMaxInclusionListSizeConstraints_ ( std::vector< IndexTriple > &  variable_indices,
UInt  max_list_size 
) [protected]
void addPrecursorAcquisitionNumberConstraint_ ( std::vector< IndexTriple > &  variable_indices,
Size  number_of_features,
UInt  number_of_msms_per_precursor 
) [protected]
void addProteinCoverageConstraint_ ( std::vector< IndexTriple > &  variable_indices,
PrecursorIonSelectionPreprocessing preprocessing,
std::map< String, Size protein_variable_index_map 
) [protected]
void addProteinToILP_ ( PrecursorIonSelectionPreprocessing preprocessing,
std::map< String, std::vector< DoubleReal > >::const_iterator  map_iter,
Size counter,
Size pep_counter,
Size feature_counter,
std::vector< IndexTriple > &  variable_indices,
std::map< String, Size > &  protein_penalty_index_map,
FeatureMap<> &  precursors 
) [protected]
void addRTBinCapacityConstraint_ ( std::vector< IndexTriple > &  variable_indices,
Size  max_rt_index,
UInt  ms2_spectra_per_rt_bin,
bool  sequential_order = false 
) [protected]
void addStepSizeConstraint_ ( std::vector< IndexTriple > &  variable_indices,
UInt  step_size 
) [protected]
void assembleInclusionListForProteinBasedLP_ ( std::vector< IndexTriple > &  variable_indices,
FeatureMap<> &  precursors,
std::vector< int > &  solution_indices,
PrecursorIonSelectionPreprocessing preprocessing 
) [protected]
void calculateXICs_ ( std::vector< std::vector< DoubleReal > > &  xics,
const FeatureMap<> &  features,
const MSExperiment< InputPeakType > &  experiment,
const std::vector< std::vector< std::pair< Size, Size > > > &  mass_ranges,
const bool  normalize 
) [protected]
void createAndSolveCombinedLPFeatureBased_ ( const FeatureMap<> &  features,
std::vector< std::vector< DoubleReal > > &  intensity_weights,
std::set< Int > &  charges_set,
std::vector< std::vector< std::pair< Size, Size > > > &  mass_ranges,
std::vector< IndexTriple > &  variable_indices,
std::vector< Int > &  solution_indices,
UInt  ms2_spectra_per_rt_bin,
Size  number_of_scans,
Size  step_size = 0,
bool  sequential_order = false 
) [protected]
void createAndSolveCombinedLPForKnownLCMSMapFeatureBased ( const FeatureMap<> &  features,
const MSExperiment< InputPeakType > &  experiment,
std::vector< IndexTriple > &  variable_indices,
std::vector< Int > &  solution_indices,
std::vector< std::vector< std::pair< Size, Size > > > &  mass_ranges,
std::set< Int > &  charges_set,
UInt  ms2_spectra_per_rt_bin,
Size  step_size,
bool  sequential_order 
)
void createAndSolveCombinedLPForKnownLCMSMapFeatureBased ( const FeatureMap<> &  features,
const MSExperiment< InputPeakType > &  experiment,
std::vector< IndexTriple > &  variable_indices,
std::vector< int > &  solution_indices,
std::vector< std::vector< std::pair< Size, Size > > > &  mass_ranges,
std::set< Int > &  charges_set,
UInt  ms2_spectra_per_rt_bin,
Size  step_size = 0,
bool  sequential_order = false 
)
void createAndSolveILP_ ( const FeatureMap<> &  features,
std::vector< std::vector< DoubleReal > > &  intensity_weights,
std::set< Int > &  charges_set,
std::vector< std::vector< std::pair< Size, Size > > > &  mass_ranges,
std::vector< IndexTriple > &  variable_indices,
std::vector< int > &  solution_indices,
UInt  ms2_spectra_per_rt_bin,
Size  number_of_scans 
) [protected]

Creates and solves the ILP.

Referenced by PSLPFormulation::createAndSolveILPForKnownLCMSMapFeatureBased().

void createAndSolveILPForInclusionListCreation ( PrecursorIonSelectionPreprocessing preprocessing,
UInt  ms2_spectra_per_rt_bin,
UInt  max_list_size,
FeatureMap<> &  precursors,
bool  solve_ILP = true 
)

Find a set of precursors, so that the protein coverage is maximal and that the number of precursors per bin is not exceeded.

void createAndSolveILPForKnownLCMSMapFeatureBased ( const FeatureMap<> &  features,
const MSExperiment< InputPeakType > &  experiment,
std::vector< IndexTriple > &  variable_indices,
std::vector< std::vector< std::pair< Size, Size > > > &  mass_ranges,
std::set< Int > &  charges_set,
UInt  ms2_spectra_per_rt_bin,
std::vector< int > &  solution_indices 
)

Encode ILP formulation for a given LC-MS map, but unknown protein sample.

Parameters:
features FeatureMap with all possible precursors
experiment Input raw data
variable_indices Assignment of feature indices and ILP variables
mass_ranges Feature borders as indices in the raw data
charges_set Allowed charge states
ms2_spectra_per_rt_bin Allowed number of precursors per rt bin
solution_indices Indices of ILP variables that are in the optimal solution

References PSLPFormulation::calculateXICs_(), and PSLPFormulation::createAndSolveILP_().

Referenced by OfflinePrecursorIonSelection::makePrecursorSelectionForKnownLCMSMap().

LPWrapper::SOLVER getLPSolver (  )  [inline]
Int getNumberOfPrecsInSpectrum_ ( Int  constr_idx  )  [protected]
void getXIC_ ( const std::vector< std::pair< Size, Size > > &  end_points,
std::vector< DoubleReal > &  weights,
const MSExperiment< InputPeakType > &  experiment,
const bool  normalize 
) [protected]
void setLPSolver ( LPWrapper::SOLVER  solver  )  [inline]
void solveILP ( std::vector< int > &  solution_indices  ) 

Solve the ILP.

void updateCombinedILP ( FeatureMap<> &  features,
PrecursorIonSelectionPreprocessing preprocessed_db,
std::vector< IndexTriple > &  variable_indices,
std::vector< String > &  new_protein_accs,
std::vector< String > &  protein_accs,
PSProteinInference prot_inference,
Size variable_counter,
std::map< String, std::vector< Size > > &  protein_feature_map,
Feature new_feature,
std::map< String, Size > &  protein_variable_index_map,
std::map< String, std::set< String > > &  prot_id_counter 
)
void updateFeatureILPVariables ( FeatureMap<> &  new_features,
std::vector< IndexTriple > &  variable_indices,
std::map< Size, std::vector< String > > &  feature_constraints_map 
)
void updateObjFunction_ ( String  acc,
FeatureMap<> &  features,
PrecursorIonSelectionPreprocessing preprocessed_db,
std::vector< IndexTriple > &  variable_indices 
) [protected]
void updateRTConstraintsForSequentialILP ( Size rt_index,
UInt  ms2_spectra_per_rt_bin,
Size  max_rt_index 
)
void updateStepSizeConstraint ( Size  iteration,
UInt  step_size 
)

Member Data Documentation

LPWrapper* model_ [protected]

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:50 using doxygen 1.7.1