Skip to content

Casanovo silently skips some spectra #671

Description

@wsnoble

Describe the Issue

Casanovo silently skips some spectra.

Steps To Reproduce

I ran Casanovo on the attached MGF, once using the standard weights and once using weights that I had trained myself. Casanovo reports skipping 10 spectra with invalid information. It then says that the file contains 304 spectra, but it only reports scores for 303 spectra. What happened to the other spectrum?

If I use weights for a model I trained myself, the problem is much more pronounced -- it only reports scores for 196 spectra.

Expected Behavior

Every spectrum should either be reported as skipped or should be assigned a score.

Terminal Output (If Applicable)

Provide any applicable console output in between the tick marks below.

NFO: ======= System Information =======
INFO: Executed Command: /Users/wnoble/.casanovo-gui/.venv/bin/casanovo sequence --config /Users/wnoble/Downloads/casanovo-gui-config-20260725115450.yaml --model orbitrap --output_dir /Users/wnoble/Downloads --output_root proteosafe.il-pairs --force_overwrite /Users/wnoble/Downloads/proteosafe.il-pairs.mgf
INFO: Host Machine: lazuli-bunting.local
INFO: OS: Darwin
INFO: OS Version: Darwin Kernel Version 25.5.0: Tue Jun  9 22:28:24 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T6020
INFO: Python Version: 3.11.15
INFO: Casanovo Version: 5.2.0
INFO: Depthcharge Version: 0.4.10
INFO: PyTorch Version: 2.12.1
WARNING: accelerator='auto' will be overwritten to 'cpu' on Apple Silicon devices due to incompatibility with MPS accelerators.
Note: If you want to use a different accelerator (other than MPS), please specify it explicitly in the config file.
Seed set to 454
INFO: Model weights file /Users/wnoble/Library/Caches/casanovo/casanovo_orbitrap_v5-2-0.ckpt retrieved from local cache
INFO: Casanovo version 5.2.0
INFO: Sequencing peptides from:
INFO:   /Users/wnoble/Downloads/proteosafe.il-pairs.mgf
GPU available: True (mps), used: False
TPU available: False, using: 0 TPU cores
WARNING: /Users/wnoble/.casanovo-gui/.venv/lib/python3.11/site-packages/lightning/pytorch/trainer/setup.py:175: GPU available but not used. You can set it by doing `Trainer(accelerator='gpu')`.
WARNING: /Users/wnoble/.casanovo-gui/.venv/lib/python3.11/site-packages/lightning/pytorch/trainer/setup.py:175: GPU available but not used. You can set it by doing `Trainer(accelerator='gpu')`.
💡 Tip: For seamless cloud logging and experiment tracking, try installing [litlogger](https://pypi.org/project/litlogger/) to enable LitLogger, which logs metrics and artifacts automatically to the Lightning Experiments platform.
WARNING: UserWarning: Skipped 10 spectra with invalid information.Last error was: 
 Insufficient number of peaks
WARNING: UserWarning: Skipped 10 spectra with invalid information.Last error was: 
 Insufficient number of peaks
INFO: Test dataset contains 304 spectra.
WARNING: /Users/wnoble/.casanovo-gui/.venv/lib/python3.11/site-packages/lightning/pytorch/utilities/_pytree.py:21: `isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
WARNING: /Users/wnoble/.casanovo-gui/.venv/lib/python3.11/site-packages/lightning/pytorch/utilities/_pytree.py:21: `isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
WARNING: UserWarning: 'pin_memory' argument is set as true but not supported on MPS now, device pinned memory won't be used.
WARNING: UserWarning: 'pin_memory' argument is set as true but not supported on MPS now, device pinned memory won't be used.
INFO: ======= End of Run Report =======
INFO: Run Start Time: 26/07/25 11:55:02
INFO: Run End Time: 26/07/25 11:55:22
INFO: Time Elapsed: 0:00:20.502277
INFO: Sequenced 303 spectra
INFO: Score Distribution:
INFO: 303 spectra (100.00%) scored ≥ 0.00
INFO: 284 spectra (93.73%) scored ≥ 0.50
INFO: 76 spectra (25.08%) scored ≥ 0.90
INFO: 0 spectra (0.00%) scored ≥ 0.95
INFO: 0 spectra (0.00%) scored ≥ 0.99
INFO: Min Peptide Length: 6
INFO: Max Peptide Length: 24
INFO: Median Peptide Length: 11
[done] Casanovo finished successfully (exit 0).

proteosafe.il-pairs.mgf.gz

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