16#include <OpenMS/OpenMSConfig.h>
162 bool empty()
const {
return annotations.empty(); }
165 size_t size()
const {
return annotations.size(); }
215 const char* function,
217 size_t error_position,
subpage TOPP_TargetedFileConverter Converts targeted feature or consensus feature files subpage TOPP_FileInfo Shows basic information about the file
Definition TOPP.doxygen:44
Representation of a peptide/protein sequence.
Definition AASequence.h:88
Parse Error exception.
Definition Exception.h:593
Parse error for mzPAF notation.
Definition MzPAF.h:210
MzPAFErrorCode getErrorCode() const noexcept
Definition MzPAF.h:222
size_t position_
Definition MzPAF.h:228
void extractContext_(const String &input, size_t pos)
MzPAFParseError(const char *file, int line, const char *function, MzPAFErrorCode error_code, size_t error_position, const String &input, const String &message) noexcept
size_t getPosition() const noexcept
Definition MzPAF.h:223
String context_before_
Definition MzPAF.h:229
MzPAFErrorCode code_
Definition MzPAF.h:227
String context_after_
Definition MzPAF.h:230
String getFormattedMessage() const
Parser and writer for mzPAF (Peak Annotation Format) notation.
Definition MzPAF.h:271
static String toString(const MzPAFPeakAnnotations &anns)
Convert multiple annotations to mzPAF string.
static MzPAFPeakAnnotations parseMultiple(const String &input)
Parse an mzPAF string with potentially multiple annotations.
static MzPAFAnnotation parse(const String &input)
Parse an mzPAF string into a single annotation.
static bool charToIonSeries(char c, MzPAFIonSeries &series)
Parse ion series from character.
static std::optional< MzPAFAnnotation > tryParse(const String &input)
Try to parse an mzPAF string (non-throwing)
static PeptideHit::PeakAnnotation toPeakAnnotation(const MzPAFAnnotation &mzpaf, double mz, double intensity)
Create a PeptideHit::PeakAnnotation from mzPAF data.
static bool isStandardFragmentIon(MzPAFIonSeries series)
Check if ion series is a standard fragment ion (a, b, c, x, y, z)
static std::optional< MzPAFPeakAnnotations > tryParseMultiple(const String &input)
Try to parse multiple annotations (non-throwing)
static std::optional< double > calculateTheoreticalMZ(const MzPAFAnnotation &ann, const AASequence &sequence)
Calculate theoretical m/z for an annotation.
static bool isMzPAFFormat(const String &annotation)
Check if a string appears to be in mzPAF format.
static MzPAFPeakAnnotations fromPeakAnnotation(const PeptideHit::PeakAnnotation &peak_annotation)
Parse mzPAF annotations from a PeptideHit::PeakAnnotation.
static String toString(const MzPAFAnnotation &ann)
Convert an annotation to mzPAF string.
static char ionSeriesToChar(MzPAFIonSeries series)
Get the ion series character for an annotation.
A more convenient string class.
Definition String.h:34
MzPAFIonSeries
Ion series types for mzPAF peak annotations.
Definition MzPAF.h:38
MzPAFErrorCode
Error codes for mzPAF parsing errors.
Definition MzPAF.h:182
MzPAFDeltaUnit
Unit for mass delta values in mzPAF annotations.
Definition MzPAF.h:60
@ C
c-ion (N-terminal, ETD)
@ INTERNAL
Internal fragment (m)
@ Z
z-ion (C-terminal, ETD)
@ UNKNOWN
Unknown or unrecognized ion type.
@ NAMED
Named compound (_)
@ A
a-ion (N-terminal, loses CO)
@ REPORTER
Reporter ion (r)
@ IMMONIUM
Immonium ion (I)
@ FORMULA
Chemical formula ion (f)
@ PRECURSOR
Precursor ion (p)
@ INVALID_NUMBER
Invalid numeric value.
@ UNEXPECTED_CHARACTER
Unexpected character encountered.
@ EMPTY_INPUT
Empty input string.
@ INVALID_ION_SERIES
Invalid ion series character.
@ INVALID_CONFIDENCE
Invalid confidence score.
@ UNEXPECTED_END_OF_INPUT
Unexpected end of input.
@ INVALID_DELTA
Invalid mass delta specification.
@ UNCLOSED_BRACKET
Opening bracket without matching close.
@ INTERNAL_ERROR
Internal parser error.
@ INVALID_CHARGE
Invalid charge specification.
@ INVALID_FORMULA
Invalid chemical formula.
@ DALTON
Mass delta in Daltons (Da)
@ PPM
Mass delta in parts per million.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
const char * mzPAFErrorCodeToString(MzPAFErrorCode code)
Convert error code to human-readable string.
A single mzPAF peak annotation.
Definition MzPAF.h:121
std::optional< String > named_compound
Name for named compound ions (_[name])
Definition MzPAF.h:129
std::optional< char > immonium_residue
Residue for immonium ions (Y in IY)
Definition MzPAF.h:125
bool isValid() const
Check if this annotation has minimal valid data.
std::vector< MzPAFNeutralLoss > neutral_losses
Neutral losses (-H2O, -NH3, etc.)
Definition MzPAF.h:130
std::optional< String > embedded_sequence
Embedded ProForma sequence string ({LC[Carbamidomethyl]})
Definition MzPAF.h:136
std::optional< int > charge
Charge state (^2, ^3)
Definition MzPAF.h:133
std::optional< double > confidence
Confidence score (*0.75)
Definition MzPAF.h:135
std::optional< String > reporter_name
Name for reporter ions (r[TMT127N])
Definition MzPAF.h:127
std::optional< MzPAFMassDelta > mass_delta
Mass delta (/0.001, /-1.4ppm)
Definition MzPAF.h:134
std::optional< int > ordinal
Position/ordinal (4 in y4)
Definition MzPAF.h:124
bool operator!=(const MzPAFAnnotation &other) const
Definition MzPAF.h:143
std::optional< EmpiricalFormula > formula
Chemical formula for formula ions (f{C16H22O})
Definition MzPAF.h:128
std::optional< int > analyte_index
Analyte index (0@, 1@, etc.) for multi-analyte spectra.
Definition MzPAF.h:122
std::optional< EmpiricalFormula > adduct
Adduct ion (+Na, +K, etc.)
Definition MzPAF.h:132
std::optional< std::pair< int, int > > internal_range
Range for internal fragments (m3:6 -> {3,6})
Definition MzPAF.h:126
std::optional< int > isotope_offset
Isotope offset (+1i, +2i for M+1, M+2)
Definition MzPAF.h:131
bool operator==(const MzPAFAnnotation &other) const
Equality comparison.
Mass delta in an mzPAF annotation.
Definition MzPAF.h:89
bool operator!=(const MzPAFMassDelta &other) const
Definition MzPAF.h:94
bool operator==(const MzPAFMassDelta &other) const
Neutral loss in an mzPAF annotation.
Definition MzPAF.h:73
bool operator==(const MzPAFNeutralLoss &other) const
bool operator!=(const MzPAFNeutralLoss &other) const
Definition MzPAF.h:77
EmpiricalFormula formula
Parsed chemical formula of the loss.
Definition MzPAF.h:74
Multiple mzPAF annotations for a single peak.
Definition MzPAF.h:158
size_t size() const
Get number of annotations.
Definition MzPAF.h:165
bool empty() const
Check if there are any annotations.
Definition MzPAF.h:162
std::vector< MzPAFAnnotation > annotations
List of alternative annotations.
Definition MzPAF.h:159
bool operator!=(const MzPAFPeakAnnotations &other) const
Definition MzPAF.h:169
bool operator==(const MzPAFPeakAnnotations &other) const
Equality comparison.
Contains annotations of a peak.
Definition PeptideHit.h:87