Skip to content

Fix running ICEBERG from an installed package - #41

Merged
rogerwwww merged 2 commits into
coleygroup:mainfrom
computational-metabolomics:installed-package-fixes
Sep 16, 2026
Merged

rogerwwww merged 2 commits into
coleygroup:mainfrom
computational-metabolomics:installed-package-fixes

Conversation

@RJMW

@RJMW RJMW commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

We ran into two problems when using ms_pred as an installed package rather than from a clone of the repository.

iceberg_prediction() in iceberg_elucidation.py starts predict_smis.py using the path src/ms_pred/iceberg/predict_smis.py, which only works when running from the root of the repo. From anywhere else the call returns without writing any predictions. The script is now located relative to iceberg_elucidation.py itself.

PyTorch Lightning 2.0 removed pl.utilities.seed.seed_everything, so the scripts that still call it stop with an AttributeError. We've switched the 26 remaining calls to pl.seed_everything, which works in both 1.x and 2.x. The three places that already have a fallback (iceberg/predict_gen.py, marason/predict_gen.py and marason/predict_smis.py) are left as they are.

We tested the path fix on CPU with the MassSpecGym ICEBERG 2.1 checkpoints. Run from outside the repo, iceberg_prediction() writes no preds.hdf5 on main, but does with this change.

#35 fixes the same path problem, but against the older dag_pred layout, so it no longer applies cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants