Python API#
- mzpaf.parse_annotation()#
Parse a string into one or more
IonAnnotationBaseinstances.Parameters#
- annotation_stringstr
The string to be parsed
- wrap_errorsbool, optional
Whether or not to capture parsing errors as
InvalidAnnotationor not. Defaults toFalse.
Returns#
- list[
IonAnnotationBase] : The annotations parsed
See Also#
- class mzpaf.AnnotationStringParser(pattern)#
Bases:
objectAn annotation string parser using a specific parser pattern.
This class organizes the parsing of common and type-specific components of a string into one or more peak annotations.
Instances are
Callable, withparse_annotationbeing the reference parser.- Parameters:
pattern (Pattern)
- parse_annotation(annotation_string, **kwargs)#
Parse a string into one or more
IonAnnotationBaseinstances.- Parameters:
annotation_string (str) – The string to be parsed
**kwargs – Passed to the
_dispatch()which in turn createsIonAnnotationBaseinstances
- Returns:
The annotations parsed
- Return type:
list[
IonAnnotationBase]
- class mzpaf.IonAnnotationBase(series, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
objectA base class for all mzPAF ion annotations.
Provides shared functionality and common attributes for the data model.
- Parameters:
- classmethod from_json(data)#
Convert parsed JSON data back into formal data structures.
- Return type:
- class mzpaf.ImmoniumIonAnnotation(series, amino_acid, modification=None, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBaseRepresent a single amino acid ionized with a neutral loss.
- Parameters:
- modification#
A modification still attached to the amino acid. Should be denoted using a controlled vocabulary term.
- Type:
str or
None
- class mzpaf.PeptideFragmentIonAnnotation(series, position, sequence=None, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBase,_HasSequenceMixinRepresent a canonical peptide backbone fragment, such as a b or y ion in the Roepstorff notation.
- Parameters:
- sequence#
The sequence this fragment is derived from if it is not a specified analyte from the spectrum metadata. Should be written in ProForma 2.0 notation.
- Type:
str or
None
- class mzpaf.InternalPeptideFragmentIonAnnotation(series, start_position, end_position, sequence=None, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBase,_HasSequenceMixinRepresent an internal fragment of a peptide, containing neither of the original termini of the source peptide.
- Parameters:
- start_position#
The bond ordinal where the first break occurs relative to the N-terminal of the peptide.
- Type:
- end_position#
The bond ordinal where the second break occurs relative to the N-terminal of the peptide.
- Type:
- sequence#
The sequence this fragment is derived from if it is not a specified analyte from the spectrum metadata. Should be written in ProForma 2.0 notation.
- Type:
str or
None
- class mzpaf.PrecursorIonAnnotation(series, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBaseThe intact, possibly charge-reduced, precursor ion.
- class mzpaf.ReferenceIonAnnotation(series, reference, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBaseAn ion which matches a referencea entity like a TMT reporter ion or a signature ion.
Attribute#
- referencestr
The reference identifier.
- class mzpaf.NamedCompoundIonAnnotation(series, label, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBase
- class mzpaf.FormulaAnnotation(series, formula, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBase
- class mzpaf.SMILESAnnotation(series, smiles, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBase
- class mzpaf.Unannotated(series, unannotated_label, neutral_losses=None, isotope=None, adducts=None, charge=None, analyte_reference=None, mass_error=None, confidence=None, rest=None, is_auxiliary=None)#
Bases:
IonAnnotationBase- Parameters: