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

IDMapper Class Reference

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

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

Inheritance diagram for IDMapper:
DefaultParamHandler

List of all members.

Public Types

enum  Measure { MEASURE_PPM = 0, MEASURE_DA }

Public Member Functions

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

Protected Member Functions

void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method.
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_)
void checkHits_ (const std::vector< PeptideIdentification > &ids) const
 helper function that checks if all peptide hits are annotated with RT and MZ meta values
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
bool checkMassType_ (const std::vector< DataProcessing > &processing) const

Protected Attributes

DoubleReal rt_tolerance_
 Allowed RT deviation.
DoubleReal mz_tolerance_
 Allowed m/z deviation.
Measure measure_
 Measure used for m/z.
bool ignore_charge_
 Ignore charge states during matching?

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:
map MSExperiment to receive the identifications
ids PeptideIdentification for the ConsensusFeatures
protein_ids ProteinIdentification for the ConsensusMap
Exceptions:
Exception::MissingInformation is thrown if the MetaInfoInterface of ids does not contain 'MZ' and 'RT'.

References ExperimentalSettings::getProteinIdentifications(), and LOG_INFO.

Referenced by TOPPViewBase::annotateWithID().

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:
map ConsensusMap to receive the identifications
ids PeptideIdentification for the ConsensusFeatures
protein_ids ProteinIdentification for the ConsensusMap
measure_from_subelements Do distance estimate from FeatureHandles instead of Centroid
Exceptions:
Exception::MissingInformation is thrown if the MetaInfoInterface of ids does not contain 'MZ' and 'RT'
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:
map FeatureMap to receive the identifications
ids PeptideIdentification for the ConsensusFeatures
protein_ids ProteinIdentification for the ConsensusMap
use_centroid_rt Whether to use the RT value of feature centroids even if convex hulls are present
use_centroid_mz Whether to use the m/z value of feature centroids even if convex hulls are present
Exceptions:
Exception::MissingInformation is thrown if the MetaInfoInterface of ids does not contain "MZ" and "RT"

References IntList::contains(), DBoundingBox< D >::encloses(), 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 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_ (  )  [protected, virtual]

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.

Allowed m/z deviation.

Allowed RT deviation.


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