Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_imputation Class Reference

#include <ms_imputation.hpp>

Inheritance diagram for ms_imputation:
Collaboration diagram for ms_imputation:

Public Types

enum  IMPUTATION_VARIABLE {
  IMPUTE_PROTEIN_RATIO ,
  IMPUTE_PEPTIDE_RATIO ,
  IMPUTE_RETENTION_TIME
}
 What type of data is being imputed. More...
 

Public Member Functions

 ms_imputation (const ms_ms1quantitation *ms1quantitation, ms_imputation_method &m, IMPUTATION_VARIABLE imputationVariableChoice)
 Use this contructor to create an object to impute missing ms1 ratio values.
 
 ms_imputation (const ms_ms2quantitation *ms2quantitation, ms_imputation_method &m, IMPUTATION_VARIABLE imputationVariableChoice)
 Use this contructor to create an object to impute missing ms2 ratio values.
 
 ~ms_imputation ()
 Imputation Destructor.
 
void appendErrors (const ms_errors &src)
 Copies all errors from another instance and appends them at the end of own list.
 
void clearAllErrors ()
 Remove all errors from the current list of errors.
 
void copyFrom (const ms_errors *right)
 Use this member to make a copy of another instance.
 
const ms_errsgetErrorHandler () const
 Retrive the error object using this function to get access to all errors and error parameters.
 
const IMPUTATION_VARIABLE getImputationVariableChoice () const
 Get what the imputation object is currently imputing. I.e. protein/peptide ratios from ms1 or ms2 quantitation, or retention times for label free quantitation.
 
bool getImputeExcludedMs2PeptideRatios ()
 Get how the imputation object is currently treating ms2 excluded ratios. I.e. are excluded ratios treated as missing. Not used when imputing ms1 quantitation results.
 
bool getImputeMs1PeptideExcludedByCorrelationThr ()
 Get how the imputation object is currently treating ms1 peptide ratios excluded because of the fraction threshold. Not used when imputing ms2 quantitation results.
 
bool getImputeMs1PeptideExcludedByFractionThr ()
 Get how the imputation object is currently treating ms1 peptide ratios excluded because of the fraction threshold. Not used when imputing ms2 quantitation results.
 
bool getImputeMs1PeptideExcludedByStdErrThr ()
 Get how the imputation object is currently treating ms1 peptide ratios excluded because of the std err threshold. Not used when imputing ms2 quantitation results.
 
bool getImputeMs1PeptideNegativeRatio ()
 Get how the imputation object is currently treating negative ms1 peptide ratios. Not used when imputing ms2 quantitation results.
 
int getLastError () const
 Return the error description of the last error that occurred.
 
std::string getLastErrorString () const
 Return the error description of the last error that occurred.
 
std::vector< std::vector< double > > impute ()
 Returns a 2D (m,n) array of doubles. m is the number of variables, implemented so far is quantitation ratios or subprojects n is the number of observations, implemented so far is the number of protein or peptides.
 
bool isValid () const
 Call this function to determine if there have been any errors.
 
void setImputationVariableChoice (const IMPUTATION_VARIABLE imputationVariableChoiceIn)
 Set the imputation object to impute protein/peptide ratios from ms1 or ms2 quantitation, or retention times for label free quantitation.
 
void setImputeExcludedMs2PeptideRatios (bool imputationMs2PeptideChoiceIn)
 Set the imputation object to treat excluded ms2 ratios as missing Not used when imputing ms1 quantitation results.
 
void setImputeMs1PeptideExcludedByCorrelationThr (bool imputeMs1PeptideExcludedByCorrelationThr)
 Set the imputation object behaviour of ms1 peptide ratios excluded because of the fraction threshold. Not used when imputing ms2 quantitation results.
 
void setImputeMs1PeptideExcludedByFractionThr (bool imputeMs1PeptideExcludedByFractionThr)
 Set the imputation object behaviour of ms1 peptide ratios excluded because of the fraction threshold. Not used when imputing ms2 quantitation results.
 
void setImputeMs1PeptideExcludedByStdErrThr (bool imputeMs1PeptideExcludedByStdErrThr)
 Set the imputation object behaviour of ms1 peptide ratios excluded because of the std err threshold. Not used when imputing ms2 quantitation results.
 
void setImputeMs1PeptideNegativeRatio (bool imputeMs1PeptideNegativeRatio)
 Set the imputation object behaviour of negative ms1 peptide ratios. Not used when imputing ms2 quantitation results.
 

Detailed Description

This class is the main conduit to execute numerical methods used to predict or impute missing values within incomplete arrays of data.

EXPERIMENTAL
This class is EXPERIMENTAL. Both the API and the implementation may change in a future version of Parser.

Data is set using the supplied quantitation objects on ratio or retention time values.

Member Enumeration Documentation

◆ IMPUTATION_VARIABLE

What type of data is being imputed.

Use in the ms1 and ms2 ms_imputation constructors to declare the choice of ratios being imputed.

See Using enumerated values and static const ints in Perl, Java, Python and C#.

Enumerator
IMPUTE_PROTEIN_RATIO 

Missing protein ratios are imputed.

IMPUTE_PEPTIDE_RATIO 

Missing peptide ratios are imputed. How to treat excluded peptide ratios is set via setImputeMs1PeptideExcludedByFractionThr and similarly named get/setters or by setImputeExcludedMs2PeptideRatios.

IMPUTE_RETENTION_TIME 

Missing peptide retention times are being imputed.

Constructor & Destructor Documentation

◆ ms_imputation() [1/2]

ms_imputation ( const ms_ms1quantitation ms1quantitation,
ms_imputation_method m,
IMPUTATION_VARIABLE  imputationVariableChoice 
)

Use this contructor to create an object to impute missing ms1 ratio values.

Use this constructor for when imputing missing ratio values from ms1 quantitation.

Parameters
ms1quantitationis a pointer to the ms1 quantitation object.
mis a reference to the chosen imputation method object.
imputationVariableChoiceis an enum of which values to impute. Only protein or peptide.

◆ ms_imputation() [2/2]

ms_imputation ( const ms_ms2quantitation ms2quantitation,
ms_imputation_method m,
IMPUTATION_VARIABLE  imputationVariableChoice 
)

Use this contructor to create an object to impute missing ms2 ratio values.

Use this constructor for when imputing missing ratio values from ms2 quantitation.

Parameters
ms2quantitationis a pointer to the ms2 quantitation object.
mis a reference to the chosen imputation method object.
imputationVariableChoiceis an enum of which values to impute. Only protein or peptide.

Member Function Documentation

◆ appendErrors()

void appendErrors ( const ms_errors src)
inherited

Copies all errors from another instance and appends them at the end of own list.

Parameters
srcThe object to copy the errors across from. See Maintaining object references: two rules of thumb.

◆ clearAllErrors()

void clearAllErrors ( )
inherited

Remove all errors from the current list of errors.

The list of 'errors' can include fatal errors, warning messages, information messages and different levels of debugging messages.

All messages are accumulated into a list in this object, until clearAllErrors() is called.

See Error Handling.

See also
isValid(), getLastError(), getLastErrorString(), getErrorHandler()
Examples
common_error.cpp, resfile_error.cpp, and resfile_summary.cpp.

◆ copyFrom()

void copyFrom ( const ms_errors right)
inherited

Use this member to make a copy of another instance.

Parameters
rightis the source to initialise from

◆ getErrorHandler()

const ms_errs * getErrorHandler ( ) const
inherited

Retrive the error object using this function to get access to all errors and error parameters.

See Error Handling.

Returns
Constant pointer to the error handler
See also
isValid(), getLastError(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Examples
common_error.cpp, and http_helper_getstring.cpp.

◆ getLastError()

int getLastError ( ) const
inherited

Return the error description of the last error that occurred.

All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.

See Error Handling.

See also
isValid(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Returns
the error number of the last error, or 0 if there have been no errors.

◆ getLastErrorString()

std::string getLastErrorString ( ) const
inherited

Return the error description of the last error that occurred.

All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.

Returns
Most recent error, warning, information or debug message

See Error Handling.

See also
isValid(), getLastError(), clearAllErrors(), getErrorHandler()
Examples
common_error.cpp, config_enzymes.cpp, config_fragrules.cpp, config_license.cpp, config_mascotdat.cpp, config_masses.cpp, config_modfile.cpp, config_procs.cpp, config_quantitation.cpp, config_taxonomy.cpp, http_helper_getstring.cpp, and tools_aahelper.cpp.

◆ impute()

std::vector< std::vector< double > > impute ( )

Returns a 2D (m,n) array of doubles. m is the number of variables, implemented so far is quantitation ratios or subprojects n is the number of observations, implemented so far is the number of protein or peptides.

The 2D array will contain a mixture of real double values and imputed double values where previously there was missing values. The imputation method executed will be the type chosen in the ms_imputation constructor.

Returns
The 2D array of double values.

◆ isValid()

bool isValid ( ) const
inherited

◆ setImputeMs1PeptideExcludedByCorrelationThr()

void setImputeMs1PeptideExcludedByCorrelationThr ( bool  imputeMs1PeptideExcludedByCorrelationThr)

Set the imputation object behaviour of ms1 peptide ratios excluded because of the fraction threshold. Not used when imputing ms2 quantitation results.

Set how the imputation object is currently treating ms1 peptide ratios excluded because of the std err threshold.

Parameters
imputeMs1PeptideExcludedByCorrelationThris a bool to set if ms1 peptide ratio values excluded by fraction threshold are treated as missing values or not.

◆ setImputeMs1PeptideExcludedByFractionThr()

void setImputeMs1PeptideExcludedByFractionThr ( bool  imputeMs1PeptideExcludedByFractionThr)

Set the imputation object behaviour of ms1 peptide ratios excluded because of the fraction threshold. Not used when imputing ms2 quantitation results.

Set how the imputation object is currently treating ms1 peptide ratios excluded because of the fraction threshold.

Parameters
imputeMs1PeptideExcludedByFractionThris a bool to set if ms1 peptide ratio values excluded by fraction threshold are treated as missing values or not.

◆ setImputeMs1PeptideExcludedByStdErrThr()

void setImputeMs1PeptideExcludedByStdErrThr ( bool  imputeMs1PeptideExcludedByStdErrThr)

Set the imputation object behaviour of ms1 peptide ratios excluded because of the std err threshold. Not used when imputing ms2 quantitation results.

Set how the imputation object is currently treating ms1 peptide ratios excluded because of the std err threshold.

Parameters
imputeMs1PeptideExcludedByStdErrThris a bool to set if ms1 peptide ratio values excluded by std err threshold are treated as missing values or not.

◆ setImputeMs1PeptideNegativeRatio()

void setImputeMs1PeptideNegativeRatio ( bool  imputeMs1PeptideNegativeRatio)

Set the imputation object behaviour of negative ms1 peptide ratios. Not used when imputing ms2 quantitation results.

Set how the imputation object is currently treating ms1 peptide ratios excluded because of the std err threshold.

Parameters
imputeMs1PeptideNegativeRatiois a bool to set if negative ms1 peptide ratio values are treated as missing values or not.

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