alphabase.spectral_library.decoy¶
Classes:
Base class for decoy generator. |
|
|
|
|
|
|
Pseudo-reverse peptide decoy generator. |
Data:
Factory object of SpecLibDecoyProvider to register and get different types of decoy methods. |
- class alphabase.spectral_library.decoy.BaseDecoyGenerator[source][source]¶
Bases:
objectBase 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 = 'GAVLIFMPWSCTYHKRQENDBJOUXZsty', mutated_AAs: str = 'LLLVVLLLLTSSSSLLNDQEVVVVVVtss')[source][source]¶
Bases:
BaseDecoyGeneratorMethods:
__init__([raw_AAs, mutated_AAs])DiaNN-like decoy peptide generator
- __init__(raw_AAs: str = 'GAVLIFMPWSCTYHKRQENDBJOUXZsty', mutated_AAs: str = 'LLLVVLLLLTSSSSLLNDQEVVVVVVtss')[source][source]¶
DiaNN-like decoy peptide generator
- Parameters:
raw_AAs (str, optional) – AAs those DiaNN decoy from. Defaults to ‘GAVLIFMPWSCTYHKRQENDBJOUXZsty’.
mutated_AAs (str, optional) – AAs those DiaNN decoy to. Defaults to ‘LLLVVLLLLTSSSSLLNDQEVVVVVVtss’.
- class alphabase.spectral_library.decoy.PseudoReverseDecoyGenerator(fix_C_term: bool = True)[source][source]¶
Bases:
BaseDecoyGeneratorMethods:
__init__([fix_C_term])Pseudo-reverse decoy generator.
- class alphabase.spectral_library.decoy.SpecLibDecoy(target_lib: SpecLibBase, decoy_generator: Any = <class 'alphabase.spectral_library.decoy.PseudoReverseDecoyGenerator'>, **kwargs)[source][source]¶
Bases:
SpecLibBasePseudo-reverse peptide decoy generator.
Methods:
__init__(target_lib, decoy_generator, **kwargs)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: SpecLibBase, decoy_generator: 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:
- 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:
objectMethods:
__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
- 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:
- 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.