Skip to content

Tutorial notebook isn't work well because of peptide column #358

@elephantoid

Description

@elephantoid

Describe the bug
I was going to learn how to use oktoberfest using your tutorial notebook.
but it has a problem about column names.
i also can't find "peptide" anywhere even i downloaded zip file('https://zenodo.org/record/7613029/files/Oktoberfest_input.zip')

anyway, i checked runner.py and there is the point.
peptides_spectral_library.csv(from zenodo) columns are [modified_sequence, collision_energy, precursor_charge]
there is no peptides! so L304 of runner.py have to occur KeyError

To Reproduce

Steps to reproduce the behavior:

  1. setup conda environment using script.
  2. make a new jupyter notebook
  3. copy & paste each cell from Tutorial

Expected behavior

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/.conda/envs/oktoberfest/lib/python3.11/site-packages/pandas/core/indexes/base.py:3812, in Index.get_loc(self, key)
   3811 try:
-> 3812     return self._engine.get_loc(casted_key)
   3813 except KeyError as err:

File pandas/_libs/index.pyx:167, in pandas._libs.index.IndexEngine.get_loc()

File pandas/_libs/index.pyx:196, in pandas._libs.index.IndexEngine.get_loc()

File pandas/_libs/hashtable_class_helper.pxi:7088, in pandas._libs.hashtable.PyObjectHashTable.get_item()

File pandas/_libs/hashtable_class_helper.pxi:7096, in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'peptide'

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
Cell In[54], line 1
----> 1 run_job("spectral_library_config.json")

File ~/.conda/envs/oktoberfest/lib/python3.11/site-packages/oktoberfest/runner.py:1389, in run_job(config_path)
   1387 try:
   1388     if job_type == "SpectralLibraryGeneration":
-> 1389         generate_spectral_lib(config_path)
   1390     elif job_type == "CollisionEnergyCalibration":
   1391         run_ce_calibration(config_path)

File ~/.conda/envs/oktoberfest/lib/python3.11/site-packages/oktoberfest/runner.py:423, in generate_spectral_lib(config_path)
    420 config.read(config_path)
    421 config.check()
--> 423 spec_library = _speclib_from_digestion(config)
    425 speclib_written_step = ProcessStep(config.output, "speclib_written")
    426 if not speclib_written_step.is_done():

File ~/.conda/envs/oktoberfest/lib/python3.11/site-packages/oktoberfest/runner.py:26, in _speclib_from_digestion(config)
     23 from oktoberfest import preprocessing as pp
     24 from oktoberfest import rescore as re
---> 26 from .data.spectra import Spectra
     27 from .utils import Config, JobPool, ProcessStep, apply_quant, group_iterator
     29 logger = logging.getLogger(__name__)

File ~/.conda/envs/oktoberfest/lib/python3.11/site-packages/pandas/core/frame.py:4107, in DataFrame.__getitem__(self, key)
   4105 if self.columns.nlevels > 1:
   4106     return self._getitem_multilevel(key)
-> 4107 indexer = self.columns.get_loc(key)
   4108 if is_integer(indexer):
   4109     indexer = [indexer]

File ~/.conda/envs/oktoberfest/lib/python3.11/site-packages/pandas/core/indexes/base.py:3819, in Index.get_loc(self, key)
   3814     if isinstance(casted_key, slice) or (
   3815         isinstance(casted_key, abc.Iterable)
   3816         and any(isinstance(x, slice) for x in casted_key)
   3817     ):
   3818         raise InvalidIndexError(key)
-> 3819     raise KeyError(key) from err
   3820 except TypeError:
   3821     # If we have a listlike key, _check_indexing_error will raise
   3822     #  InvalidIndexError. Otherwise we fall through and re-raise
   3823     #  the TypeError.
   3824     self._check_indexing_error(key)

KeyError: 'peptide'

System [please complete the following information]:

  • OS: e.g. [Ubuntu 24]
  • Language Version: [Python 3.11]
  • Virtual environment: [ Conda]

Additional context

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