Skip to content

timsTOF im2deep rescoring fails: tdf2mzml ion mobility (MS:1002814) not read by ms2rescore_rs #456

@jonasscheid

Description

@jonasscheid

Description of the bug

Fixing #452 (PR #455) unblocked UNTAR, so -profile test_timstof now runs past spectra preparation for the first time. It then fails at MS2RESCORE:

ms2rescore.exceptions.MissingValuesError: Could not find any 'ion_mobility' values in PSM or spectrum files.

The im2deep feature generator (used for timsTOF — conf/test_timstof.config sets feature_generators = 'ms2pip,im2deep') needs an ion mobility value per PSM. The Comet idXML carries no ion mobility, so MS2Rescore falls back to reading it from the spectrum files via ms2rescore_rs.get_precursor_info().

TDF2MZML (docker.io/mfreitas/tdf2mzml:0.5_noentry) writes the precursor ion mobility into the mzML as CV term MS:1002814 — "mean inverse reduced ion mobility" on the <scan> element. ms2rescore_rs does not pick up that term, so it returns im = 0.0 for every precursor and MS2Rescore aborts.

Verified directly on the tdf2mzml-converted mzML:

>>> from ms2rescore_rs import get_precursor_info
>>> p = get_precursor_info('DN17_Antrum_classI_techRep1.mzML')
>>> len(p)
28456
>>> sum(1 for x in p.values() if x.im not in (None, 0, 0.0))
0

Retention time and precursor m/z are read correctly — only ion mobility is missing.

This was never caught because -profile test_timstof is not part of the nf-test suite, and the UNTAR crash (#452) aborted the run before MS2RESCORE was ever reached.

Command used and terminal output

$ nextflow run main.nf -profile test_timstof,docker --outdir results

ERROR ~ Error executing process > 'NFCORE_MHCQUANT:MHCQUANT:RESCORE:MS2RESCORE (...)'
...
  ms2rescore.exceptions.MissingValuesError: Could not find any 'ion_mobility' values in PSM or spectrum files.

Possible directions

  • Convert with a tool / tdf2mzml version that writes a precursor ion mobility CV term ms2rescore_rs recognises (e.g. MS:1002476 / MS:1002815), or post-process the mzML.
  • Propagate ion mobility into the Comet idXML so MS2Rescore reads it from the PSMs instead of the spectra.
  • When this is resolved, migrate test_timstof from the PXD038782 .d.tar.gz to a smaller PXD058436 file (benignMHCquant2 dataset).

System information

  • Nextflow 25.10.4 · Docker · Linux
  • nf-core/mhcquant 3.3.0dev
  • ms2rescore 3.1.5 (quay.io/biocontainers/ms2rescore:3.1.5--pyhdfd78af_1)
  • tdf2mzml 0.5 (docker.io/mfreitas/tdf2mzml:0.5_noentry)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions