From 2985b7da84f0f2b5eaec373257ecc8d0942df039 Mon Sep 17 00:00:00 2001 From: RalfG Date: Thu, 2 May 2024 14:15:56 +0200 Subject: [PATCH] Raise NotImplementedError in fasta2speclib until reimplemented for ms2pip v4 --- fasta2speclib/fasta2speclib.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/fasta2speclib/fasta2speclib.py b/fasta2speclib/fasta2speclib.py index bd4f318..a91977f 100644 --- a/fasta2speclib/fasta2speclib.py +++ b/fasta2speclib/fasta2speclib.py @@ -23,6 +23,7 @@ - Terminal modifications can have site specificity (e.g. N-term K or N-term P). """ + from __future__ import annotations __author__ = "Ralf Gabriels" @@ -56,6 +57,8 @@ logger = logging.getLogger(__name__) +raise NotImplementedError("This module is not yet implemented for MSĀ²PIP v4.") + class Peptide(BaseModel): """Peptide representation within the fasta2speclib search space.""" @@ -138,7 +141,7 @@ class Configuration(BaseModel): @field_validator("output_filetype") @classmethod def _validate_output_filetypes(cls, v): - allowed_types = ["msp", "mgf", "bibliospec", "spectronaut", "dlib"] # , "hdf"] + allowed_types = ["msp", "mgf", "bibliospec", "spectronaut", "dlib"] # , "hdf"] v = [filetype.lower() for filetype in v] for filetype in v: if filetype not in allowed_types: @@ -399,11 +402,15 @@ def _prepare_ms2pip_params(config: Configuration) -> dict: "model": config.ms2pip_model, "frag_error": 0.02, "ptm": [ - "{},{},opt,N-term".format(mod.name, mod.mass_shift) - if mod.peptide_n_term or mod.protein_n_term - else "{},{},opt,C-term".format(mod.name, mod.mass_shift) - if mod.peptide_c_term or mod.protein_c_term - else "{},{},opt,{}".format(mod.name, mod.mass_shift, mod.amino_acid) + ( + "{},{},opt,N-term".format(mod.name, mod.mass_shift) + if mod.peptide_n_term or mod.protein_n_term + else ( + "{},{},opt,C-term".format(mod.name, mod.mass_shift) + if mod.peptide_c_term or mod.protein_c_term + else "{},{},opt,{}".format(mod.name, mod.mass_shift, mod.amino_acid) + ) + ) for mod in config.modifications ], "sptm": [],