OpenMS  2.6.0
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
PrecursorIonSelection Class Reference

This class implements different precursor ion selection strategies. More...

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

Inheritance diagram for PrecursorIonSelection:
[legend]
Collaboration diagram for PrecursorIonSelection:
[legend]

Classes

struct  SeqTotalScoreMore
 Compare by score. More...
 
struct  TotalScoreMore
 Compare by score. More...
 

Public Types

enum  Type {
  IPS, ILP_IPS, SPS, UPSHIFT,
  DOWNSHIFT, DEX
}
 Precursor ion selection type (iterative, static, upshift, downshift, dynamic exclusion). More...
 

Public Member Functions

 PrecursorIonSelection ()
 
 PrecursorIonSelection (const PrecursorIonSelection &source)
 
 ~PrecursorIonSelection () override
 
const doublegetMaxScore () const
 
void setMaxScore (const double &max_score)
 
void sortByTotalScore (FeatureMap &features)
 Sort features by total score. More...
 
void getNextPrecursors (FeatureMap &features, FeatureMap &next_features, UInt number)
 Returns features with highest score for MS/MS. More...
 
void getNextPrecursorsSeq (FeatureMap &features, FeatureMap &next_features, UInt number, double &rt)
 
void getNextPrecursors (std::vector< Int > &solution_indices, std::vector< PSLPFormulation::IndexTriple > &variable_indices, std::set< Int > &measured_variables, FeatureMap &features, FeatureMap &new_features, UInt step_size, PSLPFormulation &ilp)
 
void rescore (FeatureMap &features, std::vector< PeptideIdentification > &new_pep_ids, std::vector< ProteinIdentification > &prot_ids, PrecursorIonSelectionPreprocessing &preprocessed_db, bool check_meta_values=true)
 Change scoring of features using peptide identifications only from spectra of the last iteration. More...
 
void simulateRun (FeatureMap &features, std::vector< PeptideIdentification > &pep_ids, std::vector< ProteinIdentification > &prot_ids, PrecursorIonSelectionPreprocessing &preprocessed_db, String path, PeakMap &experiment, String precursor_path="")
 Simulate the iterative precursor ion selection. More...
 
void setLPSolver (LPWrapper::SOLVER solver)
 
LPWrapper::SOLVER getLPSolver ()
 
void reset ()
 
const std::map< String, std::set< String > > & getPeptideProteinCounter ()
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Private Member Functions

void simulateILPBasedIPSRun_ (FeatureMap &features, PeakMap &experiment, std::vector< PeptideIdentification > &pep_ids, std::vector< ProteinIdentification > &prot_ids, PrecursorIonSelectionPreprocessing &preprocessed_db, String output_path, String precursor_path="")
 
void simulateRun_ (FeatureMap &features, std::vector< PeptideIdentification > &pep_ids, std::vector< ProteinIdentification > &prot_ids, PrecursorIonSelectionPreprocessing &preprocessed_db, String path, String precursor_path="")
 
void shiftDown_ (FeatureMap &features, PrecursorIonSelectionPreprocessing &preprocessed_db, String protein_acc)
 
void shiftUp_ (FeatureMap &features, PrecursorIonSelectionPreprocessing &preprocessed_db, String protein_acc)
 
void updateMembers_ () override
 update members method from DefaultParamHandler to update the members More...
 
void rescore_ (FeatureMap &features, std::vector< PeptideIdentification > &new_pep_ids, PrecursorIonSelectionPreprocessing &preprocessed_db, PSProteinInference &protein_inference)
 
void checkForRequiredUserParams_ (FeatureMap &features)
 Adds user params, required for the use of IPS, to a feature map using default values. More...
 
UInt filterProtIds_ (std::vector< ProteinIdentification > &prot_ids)
 Groups protein identifications that cannot be distinguished by their peptide identifications. More...
 
std::vector< PeptideIdentificationfilterPeptideIds_ (std::vector< PeptideIdentification > &pep_ids)
 
void convertPeptideIdScores_ (std::vector< PeptideIdentification > &pep_ids)
 

Private Attributes

UInt min_pep_ids_
 minimal number of peptides identified for a protein to be declared identified More...
 
double max_score_
 maximal score in the FeatureMap More...
 
Type type_
 precursor ion selection strategy More...
 
std::map< String, std::set< String > > prot_id_counter_
 stores the peptide sequences for all protein identifications More...
 
std::vector< Sizefraction_counter_
 stores the number of selected precursors per fraction More...
 
double mz_tolerance_
 precursor ion error tolerance More...
 
String mz_tolerance_unit_
 precursor ion error tolerance unit (ppm or Da) More...
 
UInt max_iteration_
 maximal number of iterations More...
 
Size x_variable_number_
 
LPWrapper::SOLVER solver_
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &prefix="")
 Writes all parameters to meta values. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

This class implements different precursor ion selection strategies.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
type stringIPS ILP_IPS, IPS, SPS, Upshift, Downshift, DEXStrategy for precursor ion selection.
max_iteration int100 min: 1Maximal number of iterations.
rt_bin_capacity int10 min: 1Maximal number of precursors per rt bin.
step_size int1 min: 1Maximal number of precursors per iteration.
peptide_min_prob float0.2  Minimal peptide probability.
sequential_spectrum_order stringfalse true, falseIf true, precursors are selected sequentially with respect to their RT.
MIPFormulation:thresholds:min_protein_probability float0.2 min: 0.0 max: 1.0Minimal protein probability for a protein to be considered in the ILP
MIPFormulation:thresholds:min_protein_id_probability float0.95 min: 0.0 max: 1.0Minimal protein probability for a protein to be considered identified.
MIPFormulation:thresholds:min_pt_weight float0.5 min: 0.0 max: 1.0Minimal pt weight of a precursor
MIPFormulation:thresholds:min_mz float500.0 min: 0.0Minimal mz to be considered in protein based LP formulation.
MIPFormulation:thresholds:max_mz float5000.0 min: 0.0Minimal mz to be considered in protein based LP formulation.
MIPFormulation:thresholds:min_pred_pep_prob float0.5 min: 0.0 max: 1.0Minimal predicted peptide probability of a precursor
MIPFormulation:thresholds:min_rt_weight float0.5 min: 0.0 max: 1.0Minimal rt weight of a precursor
MIPFormulation:thresholds:use_peptide_rule stringfalse true, falseUse peptide rule instead of minimal protein id probability
MIPFormulation:thresholds:min_peptide_ids int2 min: 1If use_peptide_rule is true, this parameter sets the minimal number of peptide ids for a protein id
MIPFormulation:thresholds:min_peptide_probability float0.95 min: 0.0 max: 1.0If use_peptide_rule is true, this parameter sets the minimal probability for a peptide to be safely identified
MIPFormulation:combined_ilp:k1 float0.2 min: 0.0combined ilp: weight for z_i
MIPFormulation:combined_ilp:k2 float0.2 min: 0.0combined ilp: weight for x_j,s*int_j,s
MIPFormulation:combined_ilp:k3 float0.4 min: 0.0combined ilp: weight for -x_j,s*w_j,s
MIPFormulation:combined_ilp:scale_matching_probs stringtrue true, falseflag if detectability * rt_weight shall be scaled to cover all [0,1]
MIPFormulation:feature_based:no_intensity_normalization stringfalse true, falseFlag indicating if intensities shall be scaled to be in [0,1]. This is done for each feature separately, so that the feature's maximal intensity in a spectrum is set to 1.
MIPFormulation:feature_based:max_number_precursors_per_feature int1 min: 1The maximal number of precursors per feature.
Preprocessing:precursor_mass_tolerance float10.0 min: 0.0Precursor mass tolerance which is used to query the peptide database for peptides
Preprocessing:precursor_mass_tolerance_unit stringppm ppm, DaPrecursor mass tolerance unit.
Preprocessing:preprocessed_db_path string  Path where the preprocessed database should be stored
Preprocessing:preprocessed_db_pred_rt_path string  Path where the predicted rts of the preprocessed database should be stored
Preprocessing:preprocessed_db_pred_dt_path string  Path where the predicted rts of the preprocessed database should be stored
Preprocessing:max_peptides_per_run int100000 min: 1Number of peptides for that the pt and rt are parallely predicted.
Preprocessing:missed_cleavages int1 min: 0Number of allowed missed cleavages.
Preprocessing:taxonomy string  Taxonomy
Preprocessing:tmp_dir string  Absolute path to tmp data directory used to store files needed for rt and dt prediction.
Preprocessing:store_peptide_sequences stringfalse  Flag if peptide sequences should be stored.
Preprocessing:rt_settings:min_rt float960.0 min: 1.0Minimal RT in the experiment (in seconds)
Preprocessing:rt_settings:max_rt float3840.0  Maximal RT in the experiment (in seconds)
Preprocessing:rt_settings:rt_step_size float30.0  Time between two consecutive spectra (in seconds)
Preprocessing:rt_settings:gauss_mean float-1.0  mean of the gauss curve
Preprocessing:rt_settings:gauss_sigma float3.0  std of the gauss curve

Note:

Member Enumeration Documentation

◆ Type

enum Type

Precursor ion selection type (iterative, static, upshift, downshift, dynamic exclusion).

The iterative strategy changes the ranking of possible precursors based on identification results from previous iterations.

The upshift strategy assigns a higher priority to precursors whose masses are matching peptide masses of potential protein identifications to enable a safe identification in the next iterations.

The downshift strategy assigns a lower priority to precursors whose masses are matching peptide masses of safe protein identifications.

The dynamic exclusion excludes precursors whose masses are matching peptide masses of safe protein identifications.

The static selection uses precomputed scores to rank the precursor, the order of precursors isn't changed throughout the run.

Enumerator
IPS 
ILP_IPS 
SPS 
UPSHIFT 
DOWNSHIFT 
DEX 

Constructor & Destructor Documentation

◆ PrecursorIonSelection() [1/2]

◆ PrecursorIonSelection() [2/2]

◆ ~PrecursorIonSelection()

~PrecursorIonSelection ( )
override

Member Function Documentation

◆ checkForRequiredUserParams_()

void checkForRequiredUserParams_ ( FeatureMap features)
private

Adds user params, required for the use of IPS, to a feature map using default values.

Parameters
featuresFeatureMap with all possible precursors

◆ convertPeptideIdScores_()

void convertPeptideIdScores_ ( std::vector< PeptideIdentification > &  pep_ids)
private

◆ filterPeptideIds_()

std::vector<PeptideIdentification> filterPeptideIds_ ( std::vector< PeptideIdentification > &  pep_ids)
private

◆ filterProtIds_()

UInt filterProtIds_ ( std::vector< ProteinIdentification > &  prot_ids)
private

Groups protein identifications that cannot be distinguished by their peptide identifications.

Parameters
prot_idsAll protein identifications.

◆ getLPSolver()

LPWrapper::SOLVER getLPSolver ( )
inline

◆ getMaxScore()

const double& getMaxScore ( ) const

◆ getNextPrecursors() [1/2]

void getNextPrecursors ( FeatureMap features,
FeatureMap next_features,
UInt  number 
)

Returns features with highest score for MS/MS.

Parameters
featuresFeatureMap with all possible precursors
next_featuresFeatureMap with next precursors
numberNumber of features to be reported

◆ getNextPrecursors() [2/2]

void getNextPrecursors ( std::vector< Int > &  solution_indices,
std::vector< PSLPFormulation::IndexTriple > &  variable_indices,
std::set< Int > &  measured_variables,
FeatureMap features,
FeatureMap new_features,
UInt  step_size,
PSLPFormulation ilp 
)

◆ getNextPrecursorsSeq()

void getNextPrecursorsSeq ( FeatureMap features,
FeatureMap next_features,
UInt  number,
double rt 
)

◆ getPeptideProteinCounter()

const std::map<String, std::set<String> >& getPeptideProteinCounter ( )
inline

◆ rescore()

void rescore ( FeatureMap features,
std::vector< PeptideIdentification > &  new_pep_ids,
std::vector< ProteinIdentification > &  prot_ids,
PrecursorIonSelectionPreprocessing preprocessed_db,
bool  check_meta_values = true 
)

Change scoring of features using peptide identifications only from spectra of the last iteration.

Parameters
featuresFeatureMap with all possible precursors
new_pep_idsPeptide identifications
preprocessed_dbInformation from preprocessed database

‍/ void rescoreIncremental(FeatureMap& features,std::vector<PeptideIdentification>& new_pep_ids, std::vector<ProteinIdentification>& prot_ids, PrecursorIonSelectionPreprocessing& preprocessed_db);

/**

Change scoring of features using peptide identifications from all spectra.

Parameters
featuresFeatureMap with all possible precursors
new_pep_idsPeptide identifications
prot_idsProtein identifications
preprocessed_dbInformation from preprocessed database
check_meta_valuesTrue if the FeatureMap should be checked for the presence of required meta values

◆ rescore_()

void rescore_ ( FeatureMap features,
std::vector< PeptideIdentification > &  new_pep_ids,
PrecursorIonSelectionPreprocessing preprocessed_db,
PSProteinInference protein_inference 
)
private

◆ reset()

void reset ( )

◆ setLPSolver()

void setLPSolver ( LPWrapper::SOLVER  solver)
inline

◆ setMaxScore()

void setMaxScore ( const double max_score)

◆ shiftDown_()

void shiftDown_ ( FeatureMap features,
PrecursorIonSelectionPreprocessing preprocessed_db,
String  protein_acc 
)
private

◆ shiftUp_()

void shiftUp_ ( FeatureMap features,
PrecursorIonSelectionPreprocessing preprocessed_db,
String  protein_acc 
)
private

◆ simulateILPBasedIPSRun_()

void simulateILPBasedIPSRun_ ( FeatureMap features,
PeakMap experiment,
std::vector< PeptideIdentification > &  pep_ids,
std::vector< ProteinIdentification > &  prot_ids,
PrecursorIonSelectionPreprocessing preprocessed_db,
String  output_path,
String  precursor_path = "" 
)
private

◆ simulateRun()

void simulateRun ( FeatureMap features,
std::vector< PeptideIdentification > &  pep_ids,
std::vector< ProteinIdentification > &  prot_ids,
PrecursorIonSelectionPreprocessing preprocessed_db,
String  path,
PeakMap experiment,
String  precursor_path = "" 
)

Simulate the iterative precursor ion selection.

Parameters
featuresFeatureMap with all possible precursors
pep_idsPeptide identifications
prot_idsProtein identifications
preprocessed_dbInformation from preprocessed database
step_sizeNumber of MS/MS spectra considered per iteration
pathPath to output file

◆ simulateRun_()

void simulateRun_ ( FeatureMap features,
std::vector< PeptideIdentification > &  pep_ids,
std::vector< ProteinIdentification > &  prot_ids,
PrecursorIonSelectionPreprocessing preprocessed_db,
String  path,
String  precursor_path = "" 
)
private

◆ sortByTotalScore()

void sortByTotalScore ( FeatureMap features)
inline

Sort features by total score.

◆ updateMembers_()

void updateMembers_ ( )
overrideprivatevirtual

update members method from DefaultParamHandler to update the members

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ fraction_counter_

std::vector<Size> fraction_counter_
private

stores the number of selected precursors per fraction

◆ max_iteration_

UInt max_iteration_
private

maximal number of iterations

◆ max_score_

double max_score_
private

maximal score in the FeatureMap

◆ min_pep_ids_

UInt min_pep_ids_
private

minimal number of peptides identified for a protein to be declared identified

◆ mz_tolerance_

double mz_tolerance_
private

precursor ion error tolerance

◆ mz_tolerance_unit_

String mz_tolerance_unit_
private

precursor ion error tolerance unit (ppm or Da)

◆ prot_id_counter_

std::map<String, std::set<String> > prot_id_counter_
private

stores the peptide sequences for all protein identifications

◆ solver_

LPWrapper::SOLVER solver_
private

◆ type_

Type type_
private

precursor ion selection strategy

◆ x_variable_number_

Size x_variable_number_
private