Skip to content

Translation for speclib.tsv fails while handling modifications #218

@JuliaS92

Description

@JuliaS92

Describe the bug
I tried predicting a library for a list of modified peptides. Library prediction worked (hdf5 was written), but writing of the tsv file with modifications translated to unimod failed with listindex out of range.

To Reproduce
Steps to reproduce the behavior:

  1. Input peptide list in the GUI with modifications: Methyl@K, Dimethyl@K, Acetyl@K, Carboxymethyl@K, Carboxyethyl@K, Phospho@S, Glu->Arg@E, HexNAc@T, Trimethyl@K, HNE@K, Phospho@T
  2. Select labels Label:13C(6)15N(4)@r and Label:13C(6)15N(2)@k
  3. Tick both Spectornaut tsv and unimod translation
  4. Run library prediction

Expected behavior
Spectronaut tsv

Logs

2024-11-28 13:14:13> Translating to /Users/schessner/Documents/.*/predict.speclib.tsv for DiaNN/Spectronaut...
  0%|                                                     | 0/1 [00:00<?, ?it/s]
2024-11-28 13:14:13> Traceback (most recent call last):
  File "peptdeep/pipeline_api.py", line 443, in generate_library
    lib_maker.translate_to_tsv(
  File "peptdeep/spec_lib/library_factory.py", line 132, in translate_to_tsv
    translate_to_tsv(
  File "alphabase/spectral_library/translate.py", line 459, in translate_to_tsv
    df = speclib_to_single_df(
  File "alphabase/spectral_library/translate.py", line 276, in speclib_to_single_df
    df["ModifiedPeptide"] = speclib._precursor_df[
  File "pandas/core/frame.py", line 10374, in apply
    return op.apply().__finalize__(self, method="apply")
  File "pandas/core/apply.py", line 916, in apply
    return self.apply_standard()
  File "pandas/core/apply.py", line 1063, in apply_standard
    results, res_index = self.apply_series_generator()
  File "pandas/core/apply.py", line 1081, in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
  File "alphabase/spectral_library/translate.py", line 46, in create_modified_sequence
    mods = [mods[rev_order[i]] for i in range(len(mods))]
  File "alphabase/spectral_library/translate.py", line 46, in <listcomp>
    mods = [mods[rev_order[i]] for i in range(len(mods))]
IndexError: list index out of range

Version (please complete the following information):

  • Installation Type One-click (internal pre-release)
  • If no log is available, provide the following:
    • Platform information
      • system Darwin 23.5.0
    • Python information:
      • peptdeep version 1.3.0
      • alphabase 1.4.2

Additional context
Same error occurs without translation to unimod.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions