Fragment Ion Types

The ion types module provides lookups for peptide fragment ion types.

class tacular.ion_types.FragmentIonInfo(id, name, formula, monoisotopic_mass, average_mass, dict_composition, properties=<IonTypeProperty.NONE: 0>)[source]

Bases: object

Information about a fragment ion

Parameters:
  • id (str)

  • name (str)

  • formula (str | None)

  • monoisotopic_mass (float | None)

  • average_mass (float | None)

  • dict_composition (Mapping[str, int] | None)

  • properties (IonTypeProperty)

average_mass: float | None
property composition: Counter[ElementInfo][source]

Get the composition as a Counter

dict_composition: Mapping[str, int] | None
formula: str | None
get_mass(monoisotopic=True)[source]

Get the mass of the fragment ion

Return type:

float

Parameters:

monoisotopic (bool)

id: str
property ion_type: IonType
property is_aa_specific_backward: bool

Check if ion is an amino acid-specific backward ion (v, w, wa, wb)

property is_aa_specific_forward: bool

Check if ion is an amino acid-specific forward ion (d, da, db)

property is_backward: bool

Check if ion is a backward ion type (x, y, z)

property is_forward: bool

Check if ion is a forward ion type (a, b, c)

property is_intact: bool

Check if ion is an intact ion (precursor, neutral)

property is_internal: bool

Check if ion is an internal fragment

monoisotopic_mass: float | None
name: str
properties: IonTypeProperty = 0
to_dict(float_precision=6)[source]

Convert the FragmentIonInfo to a dictionary

Return type:

dict[str, object]

Parameters:

float_precision (int)

class tacular.ion_types.FragmentIonLookup(fragment_ion_data)[source]

Bases: object

Parameters:

fragment_ion_data (dict[IonType, FragmentIonInfo])

get(key, default=None)[source]

Get fragment ion or None if not found

Return type:

FragmentIonInfo | None

Parameters:
query_id(ion_id)[source]

Query by fragment ion ID (e.g., ‘a’, ‘b’, ‘y’, ‘z’)

Return type:

FragmentIonInfo | None

Parameters:

ion_id (str)

query_ion_type(ion_type)[source]

Query by IonType enum

Return type:

FragmentIonInfo | None

Parameters:

ion_type (IonType)

query_name(name)[source]

Query by fragment ion name (e.g., ‘A-Ion’, ‘Y-Ion’)

Return type:

FragmentIonInfo | None

Parameters:

name (str)

class tacular.ion_types.IonType(*values)[source]

Bases: StrEnum

Fragment ion types following ProForma notation

A = 'a'
AX = 'ax'
AY = 'ay'
AZ = 'az'
B = 'b'
BX = 'bx'
BY = 'by'
BZ = 'bz'
C = 'c'
CX = 'cx'
CY = 'cy'
CZ = 'cz'
C_MINUS_H = 'c-H'
D = 'd'
DA = 'da'
DA_ISOLEUCINE = 'da-isoleucine'
DA_THREONINE = 'da-threonine'
DB = 'db'
DB_ISOLEUCINE = 'db-isoleucine'
DB_THREONINE = 'db-threonine'
D_VALINE = 'd-valine'
IMMONIUM = 'i'
NEUTRAL = 'n'
PRECURSOR = 'p'
V = 'v'
W = 'w'
WA = 'wa'
WA_ISOLEUCINE = 'wa-isoleucine'
WA_THREONINE = 'wa-threonine'
WB = 'wb'
WB_ISOLEUCINE = 'wb-isoleucine'
WB_THREONINE = 'wb-threonine'
W_VALINE = 'w-valine'
X = 'x'
Y = 'y'
Z = 'z'
Z_PLUS_H = 'z+H'
Z_RADICAL = 'z.'
class tacular.ion_types.IonTypeProperty(*values)[source]

Bases: Flag

Flag enum for ion type properties.

AA_SPECIFIC_BWD = 32
AA_SPECIFIC_FWD = 16
BACKWARD = 2
FORWARD = 1
INTACT = 8
INTERNAL = 4
NONE = 0