Repository navigation
Bring mass spec utilities into ViMMS - #331
Conversation
e717cd5 to
bbb082c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbb082c3b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pymzml = "^2.5.11" | ||
| psims = "^1.3.5" | ||
| mass-spec-utils = "^0.0.12" | ||
| molmass = "^2025.4.14" |
There was a problem hiding this comment.
Update notebook imports after vendoring
Removing mass-spec-utils here leaves checked-in example notebooks that still import the old top-level package, so a fresh Poetry install from this commit can no longer run them without an undeclared extra install. I searched the repo and found live code cells such as examples/02. DDA Strategies (Davies et al 2020)/01. Model Optimisation.ipynb and the DDA-vs-DIA notebooks still using from mass_spec_utils...; either rewrite those to vimms.mass_spec_utils... or provide a compatibility alias before dropping the dependency.
Useful? React with 👍 / 👎.
| try: | ||
| precursor_mz = scan.selected_precursors[0]['mz'] | ||
| except: | ||
| precursot_mz = None |
There was a problem hiding this comment.
Reset missing MS2 precursors instead of reusing the last one
When an MS2 scan has no selected_precursors, this typo assigns precursot_mz and leaves precursor_mz unchanged from the previous loop iteration. In mzML files with consecutive MS2 scans where one omits precursor metadata, that scan is recorded with the previous precursor m/z, which can make map_boxes_to_scans and downstream MS2 matching attach fragments to the wrong feature; set precursor_mz = None in the exception path.
Useful? React with 👍 / 👎.
Summary
Copy the
mass-spec-utilscode currently used by ViMMS back into this repository asvimms.mass_spec_utils, then update ViMMS imports to use the internal package.This removes the runtime dependency on the unmaintained external
mass-spec-utilspackage while keeping behavior as mechanical as possible.Changes
vimms/mass_spec_utils/with the utility modules ViMMS already depended on:mass_spec_utils...tovimms.mass_spec_utils....mass-spec-utilsfrom Poetry dependencies.mass-spec-utils:molmassandsortedcontainers.poetry.lock.Validation
Ran with the
vimmsconda environment:python -m compileall -q vimms testspytest -q tests/test_chemical_generation.py->17 passedpytest -q tests/test_controllers_targeted.py tests/test_feature_dsda.py tests/test_more_coverage.py->12 passedpoetry check-> passed with existing Poetry metadata deprecation warningspoetry install --no-interaction --no-rootpytest -q->148 passed, 2 warningsgit diff --checkFixes #274.