OpenMS
2.7.0
|
Annotates an MSExperiment, FeatureMap or ConsensusMap with peptide identifications. More...
#include <OpenMS/ANALYSIS/ID/IDMapper.h>
Classes | |
struct | SpectraIdentificationState |
Result of a partitioning by identification state with mapPrecursorsToIdentifications(). More... | |
Public Types | |
enum | Measure { MEASURE_PPM = 0 , MEASURE_DA } |
Public Member Functions | |
IDMapper () | |
Default constructor. More... | |
IDMapper (const IDMapper &cp) | |
Copy C'Tor. More... | |
IDMapper & | operator= (const IDMapper &rhs) |
Assignment. More... | |
void | annotate (PeakMap &map, const std::vector< PeptideIdentification > &peptide_ids, const std::vector< ProteinIdentification > &protein_ids, const bool clear_ids=false, const bool map_ms1=false) |
Mapping method for peak maps. More... | |
void | annotate (PeakMap &map, FeatureMap fmap, const bool clear_ids=false, const bool map_ms1=false) |
Mapping method for peak maps. More... | |
void | annotate (FeatureMap &map, const std::vector< PeptideIdentification > &ids, const std::vector< ProteinIdentification > &protein_ids, bool use_centroid_rt=false, bool use_centroid_mz=false, const PeakMap &spectra=PeakMap()) |
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, bool annotate_ids_with_subelements=false, const PeakMap &spectra=PeakMap()) |
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 DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () 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... | |
Static Public Member Functions | |
static SpectraIdentificationState | mapPrecursorsToIdentifications (const PeakMap &spectra, const std::vector< PeptideIdentification > &ids, double mz_tol=0.001, double rt_tol=0.001) |
Mapping of peptide identifications to spectra This helper function partitions all spectra into those that had: More... | |
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 | |
void | updateMembers_ () override |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
double | getAbsoluteMZTolerance_ (const double mz) const |
bool | isMatch_ (const double rt_distance, const double mz_theoretical, const double 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, double &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 | |
double | rt_tolerance_ |
Allowed RT deviation. More... | |
double | 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< String > | subsections_ |
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... | |
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 as the respective "MZ" and "RT" members.
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.
Name | Type | Default | Restrictions | Description |
---|---|---|---|---|
rt_tolerance | float | 5.0 | min: 0.0 | RT tolerance (in seconds) for the matching |
mz_tolerance | float | 20.0 | min: 0.0 | m/z tolerance (in ppm or Da) for the matching |
mz_measure | string | ppm | ppm, Da | unit of 'mz_tolerance' (ppm or Da) |
mz_reference | string | precursor | precursor, peptide | source of m/z values for peptide identifications |
ignore_charge | string | false | true, false | For feature/consensus maps: Assign an ID independently of whether its charge state matches that of the (consensus) feature. |
struct OpenMS::IDMapper::SpectraIdentificationState |
Result of a partitioning by identification state with mapPrecursorsToIdentifications().
Class Members | ||
---|---|---|
vector< Size > | identified | |
vector< Size > | no_precursors | |
vector< Size > | unidentified |
enum Measure |
IDMapper | ( | ) |
Default constructor.
void annotate | ( | ConsensusMap & | map, |
const std::vector< PeptideIdentification > & | ids, | ||
const std::vector< ProteinIdentification > & | protein_ids, | ||
bool | measure_from_subelements = false , |
||
bool | annotate_ids_with_subelements = false , |
||
const PeakMap & | spectra = PeakMap() |
||
) |
Mapping method for consensus maps.
If several consensus features lie inside the allowed deviation, the peptide identifications are mapped to all the consensus features.
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 |
annotate_ids_with_subelements | Store map index of FeatureHandle in peptide identification? |
spectra | Whether precursors not contained in the identifications are annotated with an empty PeptideIdentification object containing the scan index. |
Exception::MissingInformation | is thrown if the MetaInfoInterface of ids does not contain 'MZ' and 'RT' |
void annotate | ( | FeatureMap & | map, |
const std::vector< PeptideIdentification > & | ids, | ||
const std::vector< ProteinIdentification > & | protein_ids, | ||
bool | use_centroid_rt = false , |
||
bool | use_centroid_mz = false , |
||
const PeakMap & | spectra = PeakMap() |
||
) |
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.
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 |
spectra | Whether precursors not contained in the identifications are annotated with an empty PeptideIdentification object containing the scan index. |
Exception::MissingInformation | is thrown if entries of ids do not contain 'MZ' and 'RT' information. |
void annotate | ( | PeakMap & | map, |
const std::vector< PeptideIdentification > & | peptide_ids, | ||
const std::vector< ProteinIdentification > & | protein_ids, | ||
const bool | clear_ids = false , |
||
const bool | map_ms1 = false |
||
) |
Mapping method for peak maps.
The identifications stored in a PeptideIdentification instance can be added to the corresponding spectrum. Note that a PeptideIdentication is added to ALL spectra which are within the allowed RT and MZ boundaries.
map | MSExperiment to receive the identifications |
peptide_ids | PeptideIdentification for the MSExperiment |
protein_ids | ProteinIdentification for the MSExperiment |
clear_ids | Reset peptide and protein identifications of each scan before annotating |
map_ms1 | Attach Ids to MS1 spectra using RT mapping only (without precursor, without m/z) |
Exception::MissingInformation | is thrown if entries of peptide_ids do not contain 'MZ' and 'RT' information. |
void annotate | ( | PeakMap & | map, |
FeatureMap | fmap, | ||
const bool | clear_ids = false , |
||
const bool | map_ms1 = false |
||
) |
Mapping method for peak maps.
Add peptide identifications stored in a feature map to their corresponding spectrum.
This function converts the feature map to a vector of peptide identifications (all peptide IDs from each feature are taken) and calls the respective annotate() function. RT and m/z are taken from the peptides, or (if missing) from the feature itself.
map | MSExperiment to receive the identifications |
fmap | FeatureMap with PeptideIdentifications for the MSExperiment |
clear_ids | Reset peptide and protein identifications of each scan before annotating |
map_ms1 | attach Ids to MS1 spectra using RT mapping only (without precursor, without m/z) |
|
protected |
helper function that checks if all peptide hits are annotated with RT and MZ meta values
|
protected |
try to determine the type of m/z value reported for features, return whether average peptide masses should be used for matching
|
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
|
protected |
get RT, m/z and charge value(s) of a PeptideIdentification
|
protected |
increase a bounding box by the given RT and m/z tolerances
|
protected |
check if distance constraint is fulfilled (using rt_tolerance_
, mz_tolerance_
and measure_
)
|
inlinestatic |
Mapping of peptide identifications to spectra This helper function partitions all spectra into those that had:
spectra | The mass spectra |
ids | The peptide identifications @mz_tol Tolerance used to map to precursor m/z @rt_tol Tolerance used to map to spectrum retention time |
References PeptideIdentification::getHits(), PeptideIdentification::getMZ(), SpectrumSettings::getPrecursors(), MSSpectrum::getRT(), PeptideIdentification::getRT(), IDMapper::SpectraIdentificationState::identified, IDMapper::SpectraIdentificationState::no_precursors, MSExperiment::size(), and IDMapper::SpectraIdentificationState::unidentified.
|
overrideprotectedvirtual |
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.
|
protected |
Ignore charge states during matching?
|
protected |
Measure used for m/z.
|
protected |
Allowed m/z deviation.
|
protected |
Allowed RT deviation.