alphabase.spectral_library.decoy#

Classes:

BaseDecoyGenerator()

Base class for decoy generator.

DIANNDecoyGenerator([raw_AAs, mutated_AAs])

PseudoReverseDecoyGenerator([fix_C_term])

SpecLibDecoy(target_lib, decoy_generator, ...)

Pseudo-reverse peptide decoy generator.

SpecLibDecoyProvider()

Data:

decoy_lib_provider

Factory object of SpecLibDecoyProvider to register and get different types of decoy methods.

class alphabase.spectral_library.decoy.BaseDecoyGenerator[source][source]#

Bases: object

Base class for decoy generator. A class is used instead of a function to make as it needs to be pickled for multiprocessing.

class alphabase.spectral_library.decoy.DIANNDecoyGenerator(raw_AAs: str = 'GAVLIFMPWSCTYHKRQENDBJOUXZ', mutated_AAs: str = 'LLLVVLLLLTSSSSLLNDQEVVVVVV')[source][source]#

Bases: BaseDecoyGenerator

Methods:

__init__([raw_AAs, mutated_AAs])

DiaNN-like decoy peptide generator

__init__(raw_AAs: str = 'GAVLIFMPWSCTYHKRQENDBJOUXZ', mutated_AAs: str = 'LLLVVLLLLTSSSSLLNDQEVVVVVV')[source][source]#

DiaNN-like decoy peptide generator

Parameters:
  • raw_AAs (str, optional) – AAs those DiaNN decoy from. Defaults to ‘GAVLIFMPWSCTYHKRQENDBJOUXZ’.

  • mutated_AAs (str, optional) – AAs those DiaNN decoy to. Defaults to ‘LLLVVLLLLTSSSSLLNDQEVVVVVV’.

class alphabase.spectral_library.decoy.PseudoReverseDecoyGenerator(fix_C_term: bool = True)[source][source]#

Bases: BaseDecoyGenerator

Methods:

__init__([fix_C_term])

Pseudo-reverse decoy generator.

__init__(fix_C_term: bool = True)[source][source]#

Pseudo-reverse decoy generator.

Parameters:

fix_C_term (bool, optional) – If fix C-term AA when decoy. Defaults to True.

class alphabase.spectral_library.decoy.SpecLibDecoy(target_lib: ~alphabase.spectral_library.base.SpecLibBase, decoy_generator: ~typing.Any = <class 'alphabase.spectral_library.decoy.PseudoReverseDecoyGenerator'>, **kwargs)[source][source]#

Bases: SpecLibBase

Pseudo-reverse peptide decoy generator.

Methods:

__init__(target_lib[, decoy_generator])

param target_lib:

Target library to decoy.

append_to_target_lib()

A decoy method should define how to append itself to target_lib.

decoy_sequence([multiprocessing, ...])

Generate decoy sequences from self.target_lib.

translate_to_decoy([multiprocessing, ...])

Main entry of this class, it calls follows methods: - self.decoy_sequence()

__init__(target_lib: ~alphabase.spectral_library.base.SpecLibBase, decoy_generator: ~typing.Any = <class 'alphabase.spectral_library.decoy.PseudoReverseDecoyGenerator'>, **kwargs)[source][source]#
Parameters:
  • target_lib (SpecLibBase) – Target library to decoy.

  • fix_C_term (bool, optional) – If fix C-term AA when decoy. Defaults to True.

target_lib#

same as ‘target_lib’ in Args.

Type:

SpecLibBase

append_to_target_lib()[source][source]#

A decoy method should define how to append itself to target_lib. Sub-classes should override this method when necessary.

decoy_sequence(multiprocessing: bool = True, mp_batch_size=10000, mp_process_num: int = 8)[source][source]#

Generate decoy sequences from self.target_lib. Sub-classes should override the _decoy_seq method when necessary.

Parameters:
  • multiprocessing (bool, optional) – If true use multiprocessing. Defaults to True.

  • mp_batch_size (int, optional) – Batch size for multiprocessing. Defaults to 10000.

  • mp_process_num (int, optional) – Number of processes for multiprocessing. Defaults to 8.

translate_to_decoy(multiprocessing: bool = True, mp_batch_size=10000, mp_process_num: int = 8)[source][source]#

Main entry of this class, it calls follows methods: - self.decoy_sequence()

Parameters:
  • multiprocessing (bool, optional) – If true use multiprocessing. Defaults to True.

  • mp_batch_size (int, optional) – Batch size for multiprocessing. Defaults to 10000.

  • mp_process_num (int, optional) – Number of processes for multiprocessing. Defaults to 8.

class alphabase.spectral_library.decoy.SpecLibDecoyProvider[source][source]#

Bases: object

Methods:

__init__()

get_decoy_lib(name, target_lib, **kwargs)

Get an object of a subclass of SpecLibDecoy based on registered name.

register(name, decoy_class)

Register a new decoy class

__init__()[source][source]#
get_decoy_lib(name: str, target_lib: SpecLibBase, **kwargs) SpecLibDecoy[source][source]#

Get an object of a subclass of SpecLibDecoy based on registered name.

Parameters:
  • name (str) – Registered decoy class name

  • target_lib (SpecLibBase) – Target library for decoy generation

Returns:

Decoy library object

Return type:

SpecLibDecoy

register(name: str, decoy_class: SpecLibDecoy)[source][source]#

Register a new decoy class

alphabase.spectral_library.decoy.decoy_lib_provider: SpecLibDecoyProvider = <alphabase.spectral_library.decoy.SpecLibDecoyProvider object>#

Factory object of SpecLibDecoyProvider to register and get different types of decoy methods.