alphabase.spectral_library.reader

See examples in library_reader notebook.

Module for reading spectral libraries.

Classes:

LibraryReaderBase([charged_frag_types, ...])

Base class for reading spectral libraries.

SWATHLibraryReader

class alphabase.spectral_library.reader.LibraryReaderBase(charged_frag_types: List[str] = ['b_z1', 'b_z2', 'y_z1', 'y_z2', 'b_modloss_z1', 'b_modloss_z2', 'y_modloss_z1', 'y_modloss_z2'], column_mapping: dict | None = None, modification_mapping: dict | None = None, fdr: float = 0.01, fixed_C57: bool = False, mod_seq_columns: List[str] | None = None, rt_unit: str | None = None, precursor_mz_min: float = 400, precursor_mz_max: float = 2000, decoy: str | None = None, **kwargs)[source][source]

Bases: ModifiedSequenceReader, SpecLibBase

Base class for reading spectral libraries.

Methods:

__init__([charged_frag_types, ...])

Base class for reading spectral libraries from long format csv files.

__init__(charged_frag_types: List[str] = ['b_z1', 'b_z2', 'y_z1', 'y_z2', 'b_modloss_z1', 'b_modloss_z2', 'y_modloss_z1', 'y_modloss_z2'], column_mapping: dict | None = None, modification_mapping: dict | None = None, fdr: float = 0.01, fixed_C57: bool = False, mod_seq_columns: List[str] | None = None, rt_unit: str | None = None, precursor_mz_min: float = 400, precursor_mz_max: float = 2000, decoy: str | None = None, **kwargs)[source][source]

Base class for reading spectral libraries from long format csv files.

Parameters:
  • charged_frag_types (list of str) – List of fragment types to be used in the spectral library. The default is [‘b_z1’,’b_z2’,’y_z1’, ‘y_z2’, ‘b_modloss_z1’,’b_modloss_z2’,’y_modloss_z1’, ‘y_modloss_z2’]

  • column_mapping (dict) – Dictionary mapping the column names in the csv file to the column names in the spectral library. The default is None, which uses the library_reader_base column mapping in psm_reader.yaml

  • modification_mapping (dict) – Dictionary mapping the modification names in the csv file to the modification names in the spectral library.

  • fdr (float) – False discovery rate threshold for filtering the spectral library. default is 0.01

  • fixed_C57 (bool) – If true, the search engine will not show Carbamidomethyl in the modified sequences. By default False

  • mod_seq_columns (list of str) – List of column names in the csv file containing the modified sequence. By default the mapping is taken from psm_reader.yaml

  • rt_unit (str) – Unit of the retention time column in the csv file. The default is ‘irt’

  • precursor_mz_min (float) – Minimum precursor m/z value for filtering the spectral library.

  • precursor_mz_max (float) – Maximum precursor m/z value for filtering the spectral library.

  • decoy (str) – Decoy type for the spectral library. Can be either pseudo_reverse or diann

  • **kwargs (dict) – deprecated

alphabase.spectral_library.reader.SWATHLibraryReader[source]

alias of LibraryReaderBase