Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IDMapper Class Reference

Annotates an MSExperiment, FeatureMap or ConsensusMap with peptide identifications. More...

#include <OpenMS/ANALYSIS/ID/IDMapper.h>

Inheritance diagram for IDMapper:
DefaultParamHandler

Public Types

enum  Measure { MEASURE_PPM = 0, MEASURE_DA }
 

Public Member Functions

 IDMapper ()
 Default constructor. More...
 
 IDMapper (const IDMapper &cp)
 Copy C'Tor. More...
 
IDMapperoperator= (const IDMapper &rhs)
 Assignment. More...
 
template<typename PeakType >
void annotate (MSExperiment< PeakType > &map, const std::vector< PeptideIdentification > &ids, const std::vector< ProteinIdentification > &protein_ids)
 Mapping method for peak maps. More...
 
template<typename FeatureType >
void annotate (FeatureMap< FeatureType > &map, const std::vector< PeptideIdentification > &ids, const std::vector< ProteinIdentification > &protein_ids, bool use_centroid_rt=false, bool use_centroid_mz=false)
 Mapping method for feature maps. More...
 
void annotate (ConsensusMap &map, const std::vector< PeptideIdentification > &ids, const std::vector< ProteinIdentification > &protein_ids, bool measure_from_subelements=false)
 Mapping method for consensus maps. More...
 
- 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...
 

Protected Member Functions

void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
DoubleReal getAbsoluteMZTolerance_ (const DoubleReal mz) const
 
bool isMatch_ (const DoubleReal rt_distance, const DoubleReal mz_theoretical, const DoubleReal mz_observed) const
 check if distance constraint is fulfilled (using rt_tolerance_, mz_tolerance_ and measure_) More...
 
void checkHits_ (const std::vector< PeptideIdentification > &ids) const
 helper function that checks if all peptide hits are annotated with RT and MZ meta values More...
 
void getIDDetails_ (const PeptideIdentification &id, DoubleReal &rt_pep, DoubleList &mz_values, IntList &charges, bool use_avg_mass=false) const
 
void increaseBoundingBox_ (DBoundingBox< 2 > &box)
 increase a bounding box by the given RT and m/z tolerances More...
 
bool checkMassType_ (const std::vector< DataProcessing > &processing) const
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

DoubleReal rt_tolerance_
 Allowed RT deviation. More...
 
DoubleReal mz_tolerance_
 Allowed m/z deviation. More...
 
Measure measure_
 Measure used for m/z. More...
 
bool ignore_charge_
 Ignore charge states during matching? 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

Annotates an MSExperiment, FeatureMap or ConsensusMap with peptide identifications.

ProteinIdentifications are assigned to the whole map.

The retention time and mass-to-charge ratio of the PeptideIdentification have to be given in the MetaInfoInterface as the values "MZ" and "RT".

m/z-matching on peptide side can be done either with the precursor m/z value of the peptide identification or with the theoretical masses of the peptide hits (see "mz_reference" parameter).

See the documentation of the individual annotate methods for more in-depth information.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
rt_tolerance float5 min: 0RT tolerance (in seconds) for the matching
mz_tolerance float20 min: 0m/z tolerance (in ppm or Da) for the matching
mz_measure stringppm ppm, Daunit of 'mz_tolerance' (ppm or Da)
mz_reference stringprecursor precursor, peptidesource of m/z values for peptide identifications
ignore_charge stringfalse true, falseFor feature/consensus maps: Assign an ID independently of whether its charge state matches that of the (consensus) feature.

Note:

Member Enumeration Documentation

enum Measure
Enumerator
MEASURE_PPM 
MEASURE_DA 

Constructor & Destructor Documentation

IDMapper ( )

Default constructor.

IDMapper ( const IDMapper cp)

Copy C'Tor.

Member Function Documentation

void annotate ( MSExperiment< PeakType > &  map,
const std::vector< PeptideIdentification > &  ids,
const std::vector< ProteinIdentification > &  protein_ids 
)
inline

Mapping method for peak maps.

The identifications stored in a PeptideIdentification instance can be added to the corresponding spectrum.

Parameters
mapMSExperiment to receive the identifications
idsPeptideIdentification for the ConsensusFeatures
protein_idsProteinIdentification for the ConsensusMap
Exceptions
Exception::MissingInformationis thrown if the MetaInfoInterface of ids does not contain 'MZ' and 'RT'.

References MSExperiment< PeakT, ChromatogramPeakT >::empty(), ExperimentalSettings::getProteinIdentifications(), LOG_INFO, and MSExperiment< PeakT, ChromatogramPeakT >::size().

Referenced by TOPPViewBase::annotateWithID().

void annotate ( FeatureMap< FeatureType > &  map,
const std::vector< PeptideIdentification > &  ids,
const std::vector< ProteinIdentification > &  protein_ids,
bool  use_centroid_rt = false,
bool  use_centroid_mz = false 
)
inline

Mapping method for feature maps.

If all features have at least one convex hull, peptide positions are matched against the bounding boxes of the convex hulls by default. If not, the positions of the feature centroids are used. The respective coordinates of the centroids are also used for matching (in place of the corresponding ranges from the bounding boxes) if use_centroid_rt or use_centroid_mz are true.

In any case, tolerance in RT and m/z dimension is applied according to the global parameters rt_tolerance and mz_tolerance. Tolerance is understood as "plus or minus x", so the matching range is actually increased by twice the tolerance value.

If several features (incl. tolerance) overlap the position of a peptide identification, the identification is annotated to all of them.

Parameters
mapFeatureMap to receive the identifications
idsPeptideIdentification for the ConsensusFeatures
protein_idsProteinIdentification for the ConsensusMap
use_centroid_rtWhether to use the RT value of feature centroids even if convex hulls are present
use_centroid_mzWhether to use the m/z value of feature centroids even if convex hulls are present
Exceptions
Exception::MissingInformationis thrown if the MetaInfoInterface of ids does not contain "MZ" and "RT"

References IntList::contains(), DBoundingBox< D >::encloses(), FeatureMap< FeatureT >::getAnnotationStatistics(), BaseFeature::getCharge(), Feature::getConvexHulls(), FeatureMap< FeatureT >::getDataProcessing(), BaseFeature::getPeptideIdentifications(), FeatureMap< FeatureT >::getProteinIdentifications(), Peak2D::getRT(), FeatureMap< FeatureT >::getUnassignedPeptideIdentifications(), LOG_INFO, LOG_WARN, DIntervalBase< D >::maxPosition(), DIntervalBase< D >::minPosition(), DIntervalBase< D >::setMaxX(), DIntervalBase< D >::setMaxY(), DIntervalBase< D >::setMinX(), and DIntervalBase< D >::setMinY().

void annotate ( ConsensusMap map,
const std::vector< PeptideIdentification > &  ids,
const std::vector< ProteinIdentification > &  protein_ids,
bool  measure_from_subelements = false 
)

Mapping method for consensus maps.

If several consensus features lie inside the allowed deviation, the peptide identifications are mapped to all the consensus features.

Parameters
mapConsensusMap to receive the identifications
idsPeptideIdentification for the ConsensusFeatures
protein_idsProteinIdentification for the ConsensusMap
measure_from_subelementsDo distance estimate from FeatureHandles instead of Centroid
Exceptions
Exception::MissingInformationis thrown if the MetaInfoInterface of ids does not contain 'MZ' and 'RT'
void checkHits_ ( const std::vector< PeptideIdentification > &  ids) const
protected

helper function that checks if all peptide hits are annotated with RT and MZ meta values

bool checkMassType_ ( const std::vector< DataProcessing > &  processing) const
protected

try to determine the type of m/z value reported for features, return whether average peptide masses should be used for matching

DoubleReal getAbsoluteMZTolerance_ ( const DoubleReal  mz) const
protected

compute absolute Da tolerance, for a given m/z, when measure is MEASURE_DA, the value is unchanged, for MEASURE_PPM it is computed according to currently allowed ppm tolerance

void getIDDetails_ ( const PeptideIdentification id,
DoubleReal rt_pep,
DoubleList mz_values,
IntList charges,
bool  use_avg_mass = false 
) const
protected

get RT, m/z and charge value(s) of a PeptideIdentification

  • multiple m/z values are returned if "mz_reference" is set to "peptide" (one for each PeptideHit)
  • one m/z value is returned if "mz_reference" is set to "precursor"
void increaseBoundingBox_ ( DBoundingBox< 2 > &  box)
protected

increase a bounding box by the given RT and m/z tolerances

bool isMatch_ ( const DoubleReal  rt_distance,
const DoubleReal  mz_theoretical,
const DoubleReal  mz_observed 
) const
protected

check if distance constraint is fulfilled (using rt_tolerance_, mz_tolerance_ and measure_)

IDMapper& operator= ( const IDMapper rhs)

Assignment.

void updateMembers_ ( )
protectedvirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Member Data Documentation

bool ignore_charge_
protected

Ignore charge states during matching?

Measure measure_
protected

Measure used for m/z.

DoubleReal mz_tolerance_
protected

Allowed m/z deviation.

DoubleReal rt_tolerance_
protected

Allowed RT deviation.


OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:26 using doxygen 1.8.5