![]() |
OpenMS
|
Writer for ProForma v2 peptidoform notation. More...
#include <OpenMS/CHEMISTRY/ProFormaWriter.h>
Static Public Member Functions | |
| static String | toString (const Peptidoform &peptidoform, ProFormaWriteMode mode=ProFormaWriteMode::LOSSLESS) |
| Convert a Peptidoform to a ProForma string. | |
| static String | toString (const PeptidoformIon &ion, ProFormaWriteMode mode=ProFormaWriteMode::LOSSLESS) |
| Convert a PeptidoformIon to a ProForma string. | |
Static Private Member Functions | |
| static void | writeGlobalMods_ (std::ostream &os, const std::vector< GlobalModEntry > &mods, ProFormaWriteMode mode) |
| Write global modification entries to stream. | |
| static void | writeIsotopeReplacement_ (std::ostream &os, const IsotopeReplacement &isotope) |
| Write an isotope replacement to stream. | |
| static void | writeGlobalModification_ (std::ostream &os, const GlobalModification &mod, ProFormaWriteMode mode) |
| Write a global modification to stream. | |
| static void | writeModification_ (std::ostream &os, const Modification &mod, ProFormaWriteMode mode) |
| Write a modification (with alternatives) to stream. | |
| static void | writeModificationTag_ (std::ostream &os, const ModificationTag &tag, ProFormaWriteMode mode) |
| Write a modification tag (variant) to stream. | |
| static void | writeCvAccession_ (std::ostream &os, const CvAccession &cv) |
| Write a CV accession to stream. | |
| static void | writeNamedMod_ (std::ostream &os, const NamedMod &named) |
| Write a named modification to stream. | |
| static void | writeMassDelta_ (std::ostream &os, const MassDelta &delta, ProFormaWriteMode mode) |
| Write a mass delta to stream. | |
| static void | writeFormulaTag_ (std::ostream &os, const FormulaTag &formula) |
| Write a formula tag to stream. | |
| static void | writeGlycanComposition_ (std::ostream &os, const GlycanComposition &glycan) |
| Write a glycan composition to stream. | |
| static void | writeInfoTag_ (std::ostream &os, const InfoTag &info) |
| Write an info tag to stream. | |
| static void | writePositionConstraint_ (std::ostream &os, const PositionConstraint &pc) |
| Write a position constraint to stream. | |
| static void | writeLabel_ (std::ostream &os, const Label &label, ProFormaWriteMode mode) |
| Write a label to stream. | |
| static void | writeUnlocalisedMods_ (std::ostream &os, const std::vector< UnlocalisedMod > &mods, ProFormaWriteMode mode) |
| Write unlocalised modifications to stream. | |
| static void | writeLabileModifications_ (std::ostream &os, const std::vector< LabileModification > &mods, ProFormaWriteMode mode) |
| Write labile modifications to stream. | |
| static void | writeNTermMods_ (std::ostream &os, const std::vector< Modification > &mods, ProFormaWriteMode mode) |
| Write N-terminal modifications to stream. | |
| static void | writeCTermMods_ (std::ostream &os, const std::vector< Modification > &mods, ProFormaWriteMode mode) |
| Write C-terminal modifications to stream. | |
| static void | writeSequence_ (std::ostream &os, const std::vector< SequenceSection > &seq, ProFormaWriteMode mode) |
| Write the sequence with modifications to stream. | |
| static void | writeSequenceElement_ (std::ostream &os, const SequenceElement &elem, ProFormaWriteMode mode) |
| Write a single sequence element to stream. | |
| static void | writeAmbiguousRegion_ (std::ostream &os, const AmbiguousRegion ®ion, ProFormaWriteMode mode) |
| Write an ambiguous region to stream. | |
| static void | writeModifiedRange_ (std::ostream &os, const ModifiedRange &range, ProFormaWriteMode mode) |
| Write a modified range to stream. | |
| static void | writeChargeState_ (std::ostream &os, const ChargeState &charge) |
| Write a charge state to stream. | |
| static const char * | cvDatabaseToString_ (CvDatabase db) |
| Get the string representation of a CV database prefix. | |
| static const char * | cvDatabaseToHint_ (CvDatabase db) |
| Get the single-letter hint for a CV database. | |
| static const char * | massSourceToString_ (MassDelta::Source source) |
| Get the source prefix string for mass delta. | |
Writer for ProForma v2 peptidoform notation.
This class provides serialization of ProForma AST structures back to ProForma strings. It supports lossless roundtrip conversion when the AST was populated from parsing, preserving the original notation style (e.g., using "Oxidation" vs "UNIMOD:35" based on what was originally parsed).
Output Format Rules:
<[MOD]@A,C> or <13C> for isotope replacement[mod]-SEQUENCESEQUENCE-[mod]A[mod1][mod2][mod1|mod2][mod#XL1][Glycan:HexNAc2Hex5][UNIMOD:35][+15.9949][Formula:C2H3NO]/2 or /[M+2H]2+[Phospho]? or [Phospho]^2?{Glycan:Hex}(?DQ)(EOSFORMS)[+19.0523]PEPTIDE//PEPTIDEUsage example:
|
staticprivate |
Get the single-letter hint for a CV database.
| db | The CV database enum |
|
staticprivate |
Get the string representation of a CV database prefix.
| db | The CV database enum |
|
staticprivate |
Get the source prefix string for mass delta.
| source | The mass delta source enum |
|
static |
Convert a Peptidoform to a ProForma string.
Serializes a single peptide chain including all modifications, but without charge state information.
| [in] | peptidoform | The peptidoform to serialize |
| [in] | mode | Write mode: LOSSLESS preserves original formatting, CANONICAL produces normalized output |
|
static |
Convert a PeptidoformIon to a ProForma string.
Serializes one or more peptide chains with optional charge state. Multiple chains are separated by "//".
| [in] | ion | The peptidoform ion to serialize |
| [in] | mode | Write mode: LOSSLESS preserves original formatting, CANONICAL produces normalized output |
|
staticprivate |
Write an ambiguous region to stream.
Formats as (?AA...), e.g., (?DQ)
| os | Output stream |
| region | The ambiguous region |
| mode | Write mode |
|
staticprivate |
Write a charge state to stream.
Formats as /CHARGE or /[ADDUCTS]CHARGE+, e.g., /2, /[M+2H]2+
| os | Output stream |
| charge | The charge state |
|
staticprivate |
Write C-terminal modifications to stream.
Formats as -[MOD], e.g., -[Amidated]
| os | Output stream |
| mods | Vector of C-terminal modifications |
| mode | Write mode |
|
staticprivate |
Write a CV accession to stream.
Formats as DATABASE:ACCESSION, e.g., UNIMOD:35, MOD:00046
| os | Output stream |
| cv | The CV accession |
|
staticprivate |
Write a formula tag to stream.
Formats as Formula:FORMULA or Formula:FORMULA:z+CHARGE
| os | Output stream |
| formula | The formula tag |
|
staticprivate |
Write a global modification to stream.
Formats as <[MOD]@TARGETS>, e.g., <[TMT6plex]@K,N-term>
| os | Output stream |
| mod | The global modification |
| mode | Write mode |
|
staticprivate |
Write global modification entries to stream.
Handles both IsotopeReplacement (<13C>) and GlobalModification (<[TMT6plex]@K>).
| os | Output stream |
| mods | Vector of global modification entries |
| mode | Write mode |
|
staticprivate |
Write a glycan composition to stream.
Formats as Glycan:COMPOSITION, e.g., Glycan:HexNAc2Hex5
| os | Output stream |
| glycan | The glycan composition |
|
staticprivate |
Write an info tag to stream.
Formats as INFO:TEXT
| os | Output stream |
| info | The info tag |
|
staticprivate |
Write an isotope replacement to stream.
Formats as <ISOTOPE>, e.g., <13C>, <15N>, <D>
| os | Output stream |
| isotope | The isotope replacement |
|
staticprivate |
Write a label to stream.
Formats as #ID or #ID(SCORE), e.g., #XL1, #g1(0.90), #BRANCH
| os | Output stream |
| label | The label |
| mode | Write mode |
|
staticprivate |
Write labile modifications to stream.
Formats as {MOD}, e.g., {Glycan:Hex}
| os | Output stream |
| mods | Vector of labile modifications |
| mode | Write mode |
|
staticprivate |
Write a mass delta to stream.
In LOSSLESS mode, uses original_text if available. In CANONICAL mode, formats with 4 decimal places.
| os | Output stream |
| delta | The mass delta |
| mode | Write mode |
|
staticprivate |
Write a modification (with alternatives) to stream.
Handles single modifications and alternatives separated by |. Includes labels like #XL1 or #g1(0.90) if present.
| os | Output stream |
| mod | The modification with its alternatives |
| mode | Write mode |
|
staticprivate |
Write a modification tag (variant) to stream.
Dispatches to the appropriate writer based on tag type: CvAccession, NamedMod, MassDelta, FormulaTag, GlycanComposition, InfoTag
| os | Output stream |
| tag | The modification tag variant |
| mode | Write mode |
|
staticprivate |
Write a modified range to stream.
Formats as (SEQ)[MOD], e.g., (EOSFORMS)[+19.0523]
| os | Output stream |
| range | The modified range |
| mode | Write mode |
|
staticprivate |
Write a named modification to stream.
Formats as NAME or PREFIX:NAME, e.g., Oxidation, U:Oxidation
| os | Output stream |
| named | The named modification |
|
staticprivate |
Write N-terminal modifications to stream.
Formats as [MOD]-, e.g., [Acetyl]-
| os | Output stream |
| mods | Vector of N-terminal modifications |
| mode | Write mode |
|
staticprivate |
Write a position constraint to stream.
Formats as Position:RESIDUES, e.g., Position:MKC
| os | Output stream |
| pc | The position constraint |
|
staticprivate |
Write the sequence with modifications to stream.
Handles SequenceElement, AmbiguousRegion, and ModifiedRange.
| os | Output stream |
| seq | Vector of sequence sections |
| mode | Write mode |
|
staticprivate |
Write a single sequence element to stream.
Formats as AA[MOD][MOD]..., e.g., M[Oxidation], K[TMT6plex]
| os | Output stream |
| elem | The sequence element |
| mode | Write mode |
|
staticprivate |
Write unlocalised modifications to stream.
Formats as [MOD]? or [MOD]^N?, e.g., [Phospho]?, [Phospho]^2?
| os | Output stream |
| mods | Vector of unlocalised modifications |
| mode | Write mode |