OpenMS  3.0.0
MissedCleavages.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Chris Bielow $
32 // $Authors: Swenja Wagner, Patricia Scheil $
33 // --------------------------------------------------------------------------
34 
35 
36 #pragma once
37 
38 #include <OpenMS/QC/QCBase.h>
42 
43 #include <vector>
44 #include <map>
45 namespace OpenMS
46 {
47  class FeatureMap;
58  class OPENMS_DLLAPI MissedCleavages : public QCBase
59  {
60  private:
61  typedef std::map<UInt32, UInt32> MapU32;
63  void get_missed_cleavages_from_peptide_identification_(const ProteaseDigestion& digestor, MapU32& result, const UInt32& max_mc, PeptideIdentification& pep_id);
64  public:
66  MissedCleavages() = default;
67 
69  virtual ~MissedCleavages() = default;
70 
80  void compute(FeatureMap& fmap);
81  void compute(std::vector<ProteinIdentification>& prot_ids, std::vector<PeptideIdentification>& pep_ids);
82 
84  const String& getName() const override;
85 
87  const std::vector<std::map<UInt32, UInt32>>& getResults() const;
88 
93  QCBase::Status requires() const override;
94 
95  private:
97  std::vector<std::map<UInt32, UInt32>> mc_result_;
98  };
99 } // namespace OpenMS
OpenMS::EmpiricalFormula::getNumberOf
SignedSize getNumberOf(const Element *element) const
returns the number of atoms for a certain element (can be negative)
OpenMS::CubicSpline2d
cubic spline interpolation as described in R.L. Burden, J.D. Faires, Numerical Analysis,...
Definition: CubicSpline2d.h:53
OpenMS::IsotopeDistribution::ContainerType
std::vector< MassAbundance > ContainerType
Definition: IsotopeDistribution.h:72
OpenMS::PeptideHit::getCharge
Int getCharge() const
returns the charge of the peptide
OpenMS::ElementDB::getInstance
static ElementDB * getInstance()
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::TextFile::end
ConstIterator end() const
Gives access to the underlying text buffer.
OpenMS::TextFile::addLine
void addLine(const StringType &line)
Definition: TextFile.h:112
TextFile.h
OpenMS::UInt32
OPENMS_UINT32_TYPE UInt32
Unsigned integer type (32bit)
Definition: Types.h:63
OpenMS::Math::sum
static double sum(IteratorType begin, IteratorType end)
Calculates the sum of a range of values.
Definition: StatisticFunctions.h:107
Size
OpenMS::IsotopeDistribution::set
void set(const ContainerType &distribution)
overwrites the container which holds the distribution using distribution
double
MapRateToScoreType
map< double, double > MapRateToScoreType
Definition: MetaProSIP.cpp:84
OpenMS::Param::setValue
void setValue(const std::string &key, const ParamValue &value, const std::string &description="", const std::vector< std::string > &tags=std::vector< std::string >())
Sets a value.
OpenMS::Math::median
static double median(IteratorType begin, IteratorType end, bool sorted=false)
Calculates the median of a range of values.
Definition: StatisticFunctions.h:138
OpenMS::Internal::AreaIterator
Forward iterator for an area of peaks in an experiment.
Definition: AreaIterator.h:57
OpenMS::String::random
static String random(UInt length)
returns a random string of the given length. It consists of [0-9a-zA-Z]
OpenMS::PeptideHit::getSequence
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
IsotopePattern
pair< double, vector< double > > IsotopePattern
Definition: MetaProSIP.cpp:85
OpenMS::PeptideIdentification::insertHit
void insertHit(const PeptideHit &hit)
Appends a peptide hit.
CubicSpline2d.h
OpenMS::Element
Representation of an element.
Definition: Element.h:57
OpenMS::MSExperiment::sortSpectra
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
OpenMS::String::substitute
String & substitute(char from, char to)
Replaces all occurrences of the character from by the character to.
OpenMS::FASTAFile
This class serves for reading in and writing FASTA files If the protein/gene sequence contains unusua...
Definition: FASTAFile.h:60
OpenMS::MissedCleavages::MapU32
std::map< UInt32, UInt32 > MapU32
Definition: MissedCleavages.h:61
OpenMS::MSExperiment::areaEndConst
ConstAreaIterator areaEndConst() const
Returns an non-mutable invalid area iterator marking the end of an area.
OpenMS::Peak1D::setMZ
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:119
OpenMS::Peak2D
A 2-dimensional raw data point or peak.
Definition: Peak2D.h:54
OpenMS::Constants::k
const double k
Definition: Constants.h:153
OpenMS::String::NONE
Definition: String.h:81
OpenMS::CoarseIsotopePatternGenerator::estimateFromPeptideWeight
IsotopeDistribution estimateFromPeptideWeight(double average_weight)
Estimate Peptide Isotopedistribution from weight and number of isotopes that should be reported.
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::String::trim
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
MzMLFile.h
Int
Feature.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::TextFile
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
OpenMS::CoarseIsotopePatternGenerator
Isotope pattern generator for coarse isotope distributions.
Definition: CoarseIsotopePatternGenerator.h:103
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
FeatureXMLFile.h
OpenMS::Internal::ClassTest::ratio
double ratio
Recent ratio of numbers, see TOLERANCE_RELATIVE.
StatisticFunctions.h
OpenMS::Peak1D::setIntensity
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:110
OpenMS::IsotopeDistribution::getContainer
const ContainerType & getContainer() const
returns the container which holds the distribution
OpenMS::AASequence::toString
String toString() const
returns the peptide as string with modifications embedded in brackets
OpenMS::AASequence::toUnmodifiedString
String toUnmodifiedString() const
returns the peptide as string without any modifications or (e.g., "PEPTIDER")
OpenMS::MSExperiment::const_iterator
Base::const_iterator const_iterator
Definition: MSExperiment.h:118
OpenMS::MSExperiment::getMaxRT
CoordinateType getMaxRT() const
returns the maximal retention time value
OpenMS::Constants::PROTON_MASS_U
const double PROTON_MASS_U
Definition: Constants.h:116
OPENMS_LOG_WARN
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
Constants.h
OpenMS::Peak2D::setIntensity
void setIntensity(IntensityType intensity)
Sets data point intensity (height)
Definition: Peak2D.h:172
MassDecomposition.h
OpenMS::BaseFeature::setPeptideIdentifications
void setPeptideIdentifications(const std::vector< PeptideIdentification > &peptides)
sets the PeptideIdentification vector
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:120
OpenMS::PeptideIdentification::setHits
void setHits(const std::vector< PeptideHit > &hits)
Sets the peptide hits.
OpenMS::PeptideIdentification::getHits
const std::vector< PeptideHit > & getHits() const
returns the peptide hits as const
OpenMS::CubicSpline2d::derivatives
double derivatives(double x, unsigned order) const
evaluates derivative of spline at position x
Element.h
OpenMS::Internal::DIntervalBase::maxPosition
PositionType const & maxPosition() const
Accessor to maximum position.
Definition: DIntervalBase.h:130
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS::PeptideIdentification::assignRanks
void assignRanks()
Sorts the hits by score and assigns ranks according to the scores.
OpenMS::Peak2D::setRT
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::FeatureMap::updateRanges
void updateRanges() override
OpenMS::String::number
static String number(double d, UInt n)
returns a string for d with exactly n decimal places
NonNegativeLeastSquaresSolver.h
ProteaseDigestion.h
OpenMS::Matrix< double >
OpenMS::MSExperiment::areaBeginConst
ConstAreaIterator areaBeginConst(CoordinateType min_rt, CoordinateType max_rt, CoordinateType min_mz, CoordinateType max_mz) const
Returns a non-mutable area iterator for area.
OpenMS::MetaInfoInterface::setMetaValue
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
OpenMS::Element::setIsotopeDistribution
void setIsotopeDistribution(const IsotopeDistribution &isotopes)
sets the isotope distribution of the element
OpenMS::MzMLFile::load
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
OpenMS::AASequence::getMZ
double getMZ(Int charge, Residue::ResidueType type=Residue::Full) const
OpenMS::TIC
Definition: TIC.h:55
FASTAFile.h
OpenMS::SVOutStream
Stream class for writing to comma/tab/...-separated values files.
Definition: SVOutStream.h:56
MassDecompositionAlgorithm.h
OpenMS::QCBase
This class serves as an abstract base class for all QC classes.
Definition: QCBase.h:54
CoarseIsotopePatternGenerator.h
QProcess
OpenMS::FeatureXMLFile::load
void load(const String &filename, FeatureMap &feature_map)
loads the file with name filename into map and calls updateRanges().
FeatureMap.h
ProteinIdentification.h
Param.h
OpenMS::AASequence::getFormula
EmpiricalFormula getFormula(Residue::ResidueType type=Residue::Full, Int charge=0) const
returns the formula of the peptide
OpenMS::Peak1D::getMZ
CoordinateType getMZ() const
Non-mutable access to m/z.
Definition: Peak1D.h:113
IsotopePatterns
vector< IsotopePattern > IsotopePatterns
Definition: MetaProSIP.cpp:86
GaussModel.h
OpenMS::MSSpectrum::MZEnd
Iterator MZEnd(CoordinateType mz)
Binary search for peak range end (returns the past-the-end iterator)
OPENMS_LOG_DEBUG
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:470
OpenMS::PeptideIdentification::setHigherScoreBetter
void setHigherScoreBetter(bool value)
sets the peptide score orientation
OpenMS::MSSpectrum::MZBegin
Iterator MZBegin(CoordinateType mz)
Binary search for peak range begin.
OpenMS::MissedCleavages::mc_result_
std::vector< std::map< UInt32, UInt32 > > mc_result_
container that stores results
Definition: MissedCleavages.h:97
OpenMS::DBoundingBox< 2 >
OpenMS::Peak2D::setMZ
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
OpenMS::IsotopeDistribution::insert
void insert(const Peak1D::CoordinateType &mass, const Peak1D::IntensityType &intensity)
Definition: IsotopeDistribution.h:214
OpenMS::MSSpectrum::setMSLevel
void setMSLevel(UInt ms_level)
Sets the MS level.
OpenMS::ElementDB::getElement
const Element * getElement(const std::string &name) const
OpenMS::String::toQString
QString toQString() const
Conversion to Qt QString.
Normalizer.h
OpenMS::PeptideHit::setCharge
void setCharge(Int charge)
sets the charge of the peptide
OpenMS::PeptideHit::extractProteinAccessionsSet
std::set< String > extractProteinAccessionsSet() const
extracts the set of non-empty protein accessions from peptide evidences
OpenMS::MSExperiment::empty
bool empty() const
Definition: MSExperiment.h:130
OpenMS::CubicSpline2d::eval
double eval(double x) const
evaluates the spline at position x
OpenMS::String::toUpper
String & toUpper()
Converts the string to uppercase.
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:53
OpenMS::FeatureMap::getUnassignedPeptideIdentifications
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::MSSpectrum::sortByPosition
void sortByPosition()
Lexicographically sorts the peaks by their position.
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
OpenMS::PeptideHit::setSequence
void setSequence(const AASequence &sequence)
sets the peptide sequence
ModificationsDB.h
SVOutStream.h
OpenMS::EmpiricalFormula::getIsotopeDistribution
IsotopeDistribution getIsotopeDistribution(const IsotopePatternGenerator &method) const
returns the isotope distribution of the formula The details of the calculation of the isotope distrib...
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
OpenMS::TextFile::begin
ConstIterator begin() const
Gives access to the underlying text buffer.
OPENMS_LOG_ERROR
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:98
OpenMS::IsotopeDistribution
Definition: IsotopeDistribution.h:64
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
OpenMS::IsotopeDistribution::clear
void clear()
clears the distribution
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::ThresholdMower::filterPeakMap
void filterPeakMap(PeakMap &exp)
OpenMS::Math::mean
static double mean(IteratorType begin, IteratorType end)
Calculates the mean of a range of values.
Definition: StatisticFunctions.h:120
OpenMS::ProteaseDigestion
Class for the enzymatic digestion of proteins.
Definition: ProteaseDigestion.h:59
OpenMS::PeptideHit::getScore
double getScore() const
returns the PSM score
OpenMS::FlagSet
Stores and handles combinations of enum values, e.g. a set of flags as bits flipped in an UInt64.
Definition: FlagSet.h:53
OpenMS::FASTAFile::load
void load(const String &filename, std::vector< FASTAEntry > &data) const
loads a FASTA file given by 'filename' and stores the information in 'data' This uses more RAM than r...
OpenMS::EmpiricalFormula
Representation of an empirical formula.
Definition: EmpiricalFormula.h:84
ElementDB.h
OpenMS::Internal::DIntervalBase::minPosition
PositionType const & minPosition() const
Accessor to minimum position.
Definition: DIntervalBase.h:124
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:62
OpenMS::ThresholdMower
ThresholdMower removes all peaks below a threshold.
Definition: ThresholdMower.h:51
OpenMS::MSExperiment::updateRanges
void updateRanges() override
OpenMS::TextFile::store
void store(const String &filename)
Writes the data to a file.
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::File::getTempDirectory
static String getTempDirectory()
OpenMS::String::concatenate
void concatenate(StringIterator first, StringIterator last, const String &glue="")
Concatenates all elements from first to last-1 and inserts glue between the elements.
Definition: String.h:468
OpenMS::MSExperiment::clear
void clear(bool clear_meta_data)
Clears all data and meta data.
OpenMS::AASequence
Representation of a peptide/protein sequence.
Definition: AASequence.h:111
OpenMS::MSExperiment::ConstIterator
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:106
OpenMS::AASequence::fromString
static AASequence fromString(const String &s, bool permissive=true)
create AASequence object by parsing an OpenMS string
OPENMS_LOG_INFO
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
OpenMS::PeakFileOptions::setMSLevels
void setMSLevels(const std::vector< Int > &levels)
sets the desired MS levels for peaks to load
OpenMS::Internal::AreaIterator::getRT
CoordinateType getRT() const
returns the retention time of the current scan
Definition: AreaIterator.h:198
SpectrumAlignment.h
PeakPickerHiRes.h
OpenMS::MSSpectrum::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:130
PeptideIdentification.h
OpenMS::MissedCleavages
This class is a metric for the QualityControl TOPP Tool.
Definition: MissedCleavages.h:58
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
OpenMS::TextFile::ConstIterator
std::vector< String >::const_iterator ConstIterator
Non-mutable iterator.
Definition: TextFile.h:56
OpenMS::Peak1D::getIntensity
IntensityType getIntensity() const
Definition: Peak1D.h:108
File.h
OpenMS::NonNegativeLeastSquaresSolver::solve
static Int solve(const Matrix< double > &A, const Matrix< double > &b, Matrix< double > &x)
This is a wrapper for the external nnls library for the non-negative least square problem Ax=b,...
OpenMS::MzMLFile::getOptions
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
ThresholdMower.h
OpenMS::MSExperiment::RTBegin
ConstIterator RTBegin(CoordinateType rt) const
Fast search for spectrum range begin.
OpenMS::MSExperiment::getMinRT
CoordinateType getMinRT() const
returns the minimal retention time value
OpenMS::Math::pearsonCorrelationCoefficient
static double pearsonCorrelationCoefficient(IteratorType1 begin_a, IteratorType1 end_a, IteratorType2 begin_b, IteratorType2 end_b)
Calculates the Pearson correlation coefficient for the values in [begin_a, end_a) and [begin_b,...
Definition: StatisticFunctions.h:521
QCBase.h
OpenMS::PeptideHit
Representation of a peptide hit.
Definition: PeptideHit.h:55