|
OpenMS
2.5.0
|
Go to the documentation of this file.
37 #include <OpenMS/config.h>
64 explicit ROCCurve(
const std::vector<std::pair<double,bool>> & pairs);
82 void insertPair(
double score,
bool clas);
91 std::vector<std::pair<double, double> > curve(
UInt resolution = 10);
95 double cutoffPos(
double fraction = 0.95);
99 double cutoffNeg(
double fraction = 0.95);
112 inline double trapezoidal_area(
double x1,
double x2,
double y1,
double y2);
119 bool operator()(
const std::pair<double, bool> & a,
const std::pair<double, bool> & b)
121 return b.first < a.first;
static DateTime now()
Returns the current date and time.
void assignRanks()
Sorts the hits by score and assigns ranks according to the scores.
void addMSLevel(int level)
adds a desired MS level for peaks to load
void addModification(ResidueModification *new_mod)
Add a new modification to ModificationsDB. Will skip adding if modification already exists (based on ...
bool has(Byte byte) const
true if String contains the byte, false otherwise
Normalizes the peak intensities spectrum-wise.
Definition: Normalizer.h:57
double mz
Definition: PeptideHit.h:86
ExitCodes
Exit codes.
Definition: PeptideIndexing.h:130
static String number(double d, UInt n)
returns a string for d with exactly n decimal places
Aligns the peaks of two sorted spectra Method 1: Using a banded (width via 'tolerance' parameter) ali...
Definition: SpectrumAlignment.h:67
Management and storage of parameters / INI files.
Definition: Param.h:73
std::map< String, std::set< String > > mod_combinations
empirical formula -> nucleotide formula(s) (formulas if modifications lead to ambiguities)
Definition: RNPxlModificationsGenerator.h:53
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
void setRT(double rt)
sets the RT of the MS2 spectrum where the identification occurred
void setHits(const std::vector< PeptideHit > &hits)
Sets the peptide hits.
Representation of an empirical formula.
Definition: EmpiricalFormula.h:82
Namespace used to hide implementation details from users.
Definition: CompNovoIdentificationBase.h:244
void setProgress(SignedSize value) const
Sets the current progress.
const Param & getParameters() const
Non-mutable access to the parameters.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Definition: PeptideIndexing.h:136
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
static String concatenate(const std::vector< T > &container, const String &glue="")
Concatenates all elements of the container and puts the glue string between elements.
Definition: ListUtils.h:193
NLargest removes all but the n largest peaks.
Definition: NLargest.h:54
static void load(const String &filename, std::vector< FASTAEntry > &data)
loads a FASTA file given by 'filename' and stores the information in 'data'
String toString(const T &i)
fallback template for general purpose using Boost::Karma; more specializations below
Definition: StringUtils.h:85
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
static ModificationsDB * getInstance()
Returns a pointer to the modifications DB (singleton)
static double compute(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum &exp_spectrum, const PeakSpectrum &theo_spectrum)
compute the (ln transformed) X!Tandem HyperScore 1. the dot product of peak intensities between match...
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:121
void setTermSpecificity(TermSpecificity term_spec)
Sets the term specificity.
String data array class.
Definition: DataArrays.h:59
Contains annotations of a peak.
Definition: PeptideHit.h:82
Size size() const
Definition: MSExperiment.h:127
int charge
Definition: PeptideHit.h:85
void setScore(double score)
sets the PSM score
Definition: ResidueModification.h:98
Definition: PeptideIndexing.h:132
void setEnzyme(const String &name)
Sets the enzyme for the digestion (by name)
ConstAreaIterator areaBeginConst(CoordinateType min_rt, CoordinateType max_rt, CoordinateType min_mz, CoordinateType max_mz) const
Returns a non-mutable area iterator for area.
String charges
The allowed charges for the search.
Definition: ProteinIdentification.h:227
String toString() const
returns the peptide as string with modifications embedded in brackets
Size digestUnmodified(const StringView &sequence, std::vector< StringView > &output, Size min_length=1, Size max_length=0) const
Performs the enzymatic digestion of an unmodified sequence.
void getAllSearchModifications(std::vector< String > &modifications) const
Collects all modifications that can be used for identification searches.
bool operator<(const MultiplexDeltaMasses &dm1, const MultiplexDeltaMasses &dm2)
UInt neg_
Definition: ROCCurve.h:131
void clearMSLevels()
clears the MS levels
StringView provides a non-owning view on an existing string.
Definition: String.h:488
ROCCurves show the trade-off in sensitivity and specificity for binary classifiers using different cu...
Definition: ROCCurve.h:54
void clear(bool clear_meta_data)
Clears all data and meta data.
bool sorted_
Definition: ROCCurve.h:133
String substr(size_t pos=0, size_t n=npos) const
Wrapper for the STL substr() method. Returns a String object with its contents initialized to a subst...
void setCharge(Int charge)
sets the charge of the peptide
Forward iterator for an area of peaks in an experiment.
Definition: AreaIterator.h:57
bool fragment_mass_tolerance_ppm
Mass tolerance unit of fragment ions (true: ppm, false: Dalton)
Definition: ProteinIdentification.h:233
void filterPeakMap(PeakMap &exp)
CoordinateType getRT() const
returns the retention time of the current scan
Definition: AreaIterator.h:198
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
Iterator begin()
Definition: MSExperiment.h:157
const double C13C12_MASSDIFF_U
AASequence getPrefix(Size index) const
returns a peptide sequence of the first index residues
static AASequence fromString(const String &s, bool permissive=true)
create AASequence object by parsing an OpenMS string
create header line
Definition: RNPxlReport.h:79
Base class for TOPP applications.
Definition: TOPPBase.h:144
bool operator()(const std::pair< double, bool > &a, const std::pair< double, bool > &b)
Definition: ROCCurve.h:119
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
Class for the enzymatic digestion of proteins.
Definition: ProteaseDigestion.h:60
Options for loading files containing peak data.
Definition: PeakFileOptions.h:47
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
double precursor_mass_tolerance
Mass tolerance of precursor ions (Dalton or ppm)
Definition: ProteinIdentification.h:234
bool hasPrefix(const String &string) const
true if String begins with string, false otherwise
void sortByPosition()
Lexicographically sorts the peaks by their position.
IntensityType getIntensity() const
Definition: Peak1D.h:110
static void addShiftedPeakFragmentAnnotation_(const std::map< Size, std::vector< FragmentAnnotationDetail_ >> &shifted_b_ions, const std::map< Size, std::vector< FragmentAnnotationDetail_ >> &shifted_y_ions, const std::map< Size, std::vector< FragmentAnnotationDetail_ >> &shifted_a_ions, const std::vector< PeptideHit::PeakAnnotation > &shifted_immonium_ions, const std::vector< PeptideHit::PeakAnnotation > &annotated_marker_ions, const std::vector< PeptideHit::PeakAnnotation > &annotated_precursor_ions, std::vector< PeptideHit::PeakAnnotation > &fas)
CoordinateType getMZ() const
Non-mutable access to m/z.
Definition: Peak1D.h:115
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
Iterator end()
Definition: MSExperiment.h:167
void setHigherScoreBetter(bool value)
sets the peptide score orientation
void endProgress() const
Ends the progress display.
double getMonoWeight(Residue::ResidueType type=Residue::Full, Int charge=0) const
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
String toString() const
returns the formula as a string (charges are not included)
ConstAreaIterator areaEndConst() const
Returns an non-mutable invalid area iterator marking the end of an area.
static std::map< String, PurityScores > computePrecursorPurities(const PeakMap &spectra, double precursor_mass_tolerance, bool precursor_mass_tolerance_unit_ppm)
compute precursor purity metrics for each MS2 spectrum in a PeakMap This is the main function of this...
Representation of a peptide/protein sequence.
Definition: AASequence.h:113
Search parameters of the DB search.
Definition: ProteinIdentification.h:221
String toUnmodifiedString() const
returns the peptide as string without any modifications or (e.g., "PEPTIDER")
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:113
double ratio
Recent ratio of numbers, see TOLERANCE_RELATIVE.
Protease digestion_enzyme
The cleavage site information in details (from ProteaseDB)
Definition: ProteinIdentification.h:236
static void applyFixedModifications(const MapToResidueType &fixed_mods, AASequence &peptide)
const StringDataArrays & getStringDataArrays() const
Returns a const reference to the string meta data arrays.
void setScoreType(const String &type)
sets the peptide score type
const double PROTON_MASS_U
String & reverse()
inverts the direction of the string
void setParameters(const Param ¶m)
Sets the parameters.
void setName(const String &name)
sets the name of modification
Size size() const
returns the number of residues
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:470
static Result compute(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum &exp_spectrum, const PeakSpectrum &theo_spectrum)
returns Morpheus Score, #matched ions, #total ions, #matched intensities, #total fragment intensities...
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
void setSequence(const AASequence &sequence)
sets the peptide sequence
std::vector< String > variable_modifications
Allowed variable modifications.
Definition: ProteinIdentification.h:230
Int toInt() const
Conversion to int.
bool precursor_mass_tolerance_ppm
Mass tolerance unit of precursor ions (true: ppm, false: Dalton)
Definition: ProteinIdentification.h:235
void setPeakAnnotations(std::vector< PeptideHit::PeakAnnotation > frag_annotations)
sets the fragment annotations
FASTA entry type (identifier, description and sequence)
Definition: FASTAFile.h:76
bool hasSubstring(const String &string) const
true if String contains the string, false otherwise
static std::vector< RNPxlReportRow > annotate(const PeakMap &spectra, std::vector< PeptideIdentification > &peptide_ids, double marker_ions_tolerance)
void addLine(const StringType &line)
Definition: TextFile.h:112
void store(const String &filename, const PeakMap &map) const
Stores a map in an MzML file.
static void deisotopeAndSingleCharge(MSSpectrum &spectrum, double fragment_tolerance, bool fragment_unit_ppm, int min_charge=1, int max_charge=3, bool keep_only_deisotoped=false, unsigned int min_isopeaks=3, unsigned int max_isopeaks=10, bool make_single_charged=true, bool annotate_charge=false, bool annotate_iso_peak_count=false, bool use_decreasing_model=true, unsigned int start_intensity_check=2, bool add_up_intensity=false)
Detect isotopic clusters in a mass spectrum.
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
static RNPxlModificationMassesResult initModificationMassesRNA(StringList target_nucleotides, StringList nt_groups, std::set< char > can_xl, StringList mappings, StringList modifications, String sequence_restriction, bool cysteine_adduct, Int max_length=4)
double intensity
Definition: PeptideHit.h:87
std::map< String, double > mod_masses
empirical formula -> mass
Definition: RNPxlModificationsGenerator.h:52
static String shiftedIonsToString(const std::vector< PeptideHit::PeakAnnotation > &as)
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
const IntegerDataArrays & getIntegerDataArrays() const
Returns a const reference to the integer meta data arrays.
String sequence
Definition: FASTAFile.h:80
Single fragment annotation.
Definition: RNPxlFragmentAnnotationHelper.h:62
Definition: RNPxlModificationsGenerator.h:50
void setId(const String &id)
set the identifier of the modification
predicate for sort()
Definition: ROCCurve.h:115
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...
std::vector< std::pair< double, bool > > score_clas_pairs_
Definition: ROCCurve.h:127
Used to load and store idXML files.
Definition: IdXMLFile.h:63
double fragment_mass_tolerance
Mass tolerance of fragment ions (Dalton or ppm)
Definition: ProteinIdentification.h:232
void getAllNames(std::vector< String > &all_names) const
returns all the enzyme names (does NOT include synonym names)
Definition: DigestionEnzymeDB.h:122
File adapter for MzML files.
Definition: MzMLFile.h:55
void setMissedCleavages(Size missed_cleavages)
Sets the number of missed cleavages for the digestion (default is 0). This setting is ignored when lo...
AASequence getSuffix(Size index) const
returns a peptide sequence of the last index residues
Refreshes the protein references for all peptide hits in a vector of PeptideIdentifications and adds ...
Definition: PeptideIndexing.h:124
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
Generates theoretical spectra for peptides with various options.
Definition: TheoreticalSpectrumGenerator.h:67
static ProteaseDB * getInstance()
this member function serves as a replacement of the constructor
Definition: DigestionEnzymeDB.h:69
Integer data array class.
Definition: DataArrays.h:52
ExitCodes run(std::vector< FASTAFile::FASTAEntry > &proteins, std::vector< ProteinIdentification > &prot_ids, std::vector< PeptideIdentification > &pep_ids)
forward for old interface and pyOpenMS; use run<T>() for more control
Definition: PeptideIndexing.h:147
A more convenient string class.
Definition: String.h:58
void filterPeakSpectrum(PeakSpectrum &spectrum)
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
Representation of a peptide hit.
Definition: PeptideHit.h:54
void store(const String &filename, const std::vector< ProteinIdentification > &protein_ids, const std::vector< PeptideIdentification > &peptide_ids, const String &document_id="")
Stores the data in an idXML file.
double getMonoWeight() const
returns the mono isotopic weight of the formula (includes proton charges)
String annotation
Definition: PeptideHit.h:84
void store(const String &filename)
Writes the data to a file.
UInt missed_cleavages
The number of allowed missed cleavages.
Definition: ProteinIdentification.h:231
UInt pos_
Definition: ROCCurve.h:129
ThresholdMower removes all peaks below a threshold.
Definition: ThresholdMower.h:51
String db
The used database.
Definition: ProteinIdentification.h:224
static MapToResidueType getModifications(const StringList &modNames)
Retrieve modifications from strings.
Calculates false discovery rates (FDR) from identifications.
Definition: FalseDiscoveryRate.h:77
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
static String getAnnotatedImmoniumIon(char c, const String &fragment_shift_name)
virtual void getSpectrum(PeakSpectrum &spec, const AASequence &peptide, Int min_charge, Int max_charge) const
Generates a spectrum for a peptide sequence, with the ion types that are set in the tool parameters.
Definition: PeptideIndexing.h:134
Definition: PeptideIndexing.h:133
#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
String & substitute(char from, char to)
Replaces all occurrences of the character from by the character to.
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
void getSpectrumAlignment(std::vector< std::pair< Size, Size > > &alignment, const SpectrumType1 &s1, const SpectrumType2 &s2) const
Definition: SpectrumAlignment.h:88
static String getVersion()
Return the version number of OpenMS.
std::vector< Int > IntList
Vector of signed integers.
Definition: ListUtils.h:55
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
void setDiffMonoMass(double mass)
sets the difference monoisotopic mass
Representation of a modification.
Definition: ResidueModification.h:76
const DigestionEnzymeType * getEnzyme(const String &name) const
Definition: DigestionEnzymeDB.h:98
void setFullId(const String &full_id="")
Sets the full identifier (Unimod Accession + origin, if available)
#define OPENMS_POSTCONDITION(condition, message)
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/Macros.h:48
This class serves for reading in and writing FASTA files.
Definition: FASTAFile.h:64
void filterPeakMap(PeakMap &exp) const
WindowMower augments the highest peaks in a sliding or jumping window.
Definition: WindowMower.h:54
Definition: ModifiedPeptideGenerator.h:58
static void applyVariableModifications(const MapToResidueType &var_mods, const AASequence &peptide, Size max_variable_mods_per_peptide, std::vector< AASequence > &all_modified_peptides, bool keep_original=true)
static std::vector< PeptideHit::PeakAnnotation > fragmentAnnotationDetailsToPHFA(const String &ion_type, std::map< Size, std::vector< FragmentAnnotationDetail_ > > ion_annotation_details)
conversion of RNPxl annotations to PeptideHit::PeakAnnotation
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
Definition: ResidueModification.h:99
void setMZ(double mz)
sets the MZ of the MS2 spectrum
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
void apply(std::vector< PeptideIdentification > &fwd_ids, std::vector< PeptideIdentification > &rev_ids) const
Calculates the FDR of two runs, a forward run and a decoy run on peptide level.
void startProgress(SignedSize begin, SignedSize end, const String &label) const
Initializes the progress display.
void filterPeakSpectrum(PeakSpectrum &spectrum)
String identifier
Definition: FASTAFile.h:78
std::vector< String > fixed_modifications
Used fixed modifications.
Definition: ProteinIdentification.h:229