Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c50ddbd
fixed config parser issues with default values from cli
ArthurDeclercq Sep 23, 2025
4de4f1d
changes to arguments to prevent cascade config overrides
ArthurDeclercq Sep 24, 2025
3585275
provide additional check to see whether missing data is necessary or not
ArthurDeclercq Sep 24, 2025
2918df9
check update functionality
ArthurDeclercq Sep 24, 2025
170ca32
update dialog when newer version is available
ArthurDeclercq Sep 24, 2025
cb68478
removed unused variables
ArthurDeclercq Sep 24, 2025
e34c2d8
version bump and pinned ms2rescore-rs version
ArthurDeclercq Sep 26, 2025
6a1168b
Improve updated logic for get_precursor_values; allow null also for f…
RalfG Oct 2, 2025
15b3633
Fix tests after function signature changes
RalfG Oct 2, 2025
a004c9d
Fix py39 compatibility
RalfG Oct 2, 2025
53f99c7
Add disable_update_check config option; switch to setting version in …
RalfG Oct 7, 2025
47cf975
Update workflows to use uv; test publish workflow without uploads
RalfG Oct 7, 2025
3754573
Fix workflows?
RalfG Oct 7, 2025
4545a86
Keep using pip for pyinstaller to ensure proper env discovery
RalfG Oct 14, 2025
7d3458d
Split off optional dependencies (extras) from dependency groups for d…
RalfG Oct 14, 2025
fc90510
Restore workflow run conditions after CI testing
RalfG Oct 14, 2025
c280ee2
Update lockfile
RalfG Oct 14, 2025
7b42701
Update dockerfile to use uv
RalfG Oct 14, 2025
da07830
Remove duplicate steps in test workflow
RalfG Oct 16, 2025
aa572ea
Add missing im2deep entry to docs
RalfG Oct 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,26 @@ jobs:
python-package:
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
enable-cache: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build pytest
- name: Install the project
run: uv sync --all-extras --dev

- name: Build source and wheel
run: |
python -m build --sdist --wheel --outdir dist/
run: uv build --sdist --wheel --out-dir dist/

- name: Test built package
run: |
pip install --only-binary :all: dist/ms2rescore-*.whl
# pytest
ms2rescore --help
uv run pip install --only-binary :all: dist/ms2rescore-*.whl
uv run ms2rescore --help

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand All @@ -53,6 +50,7 @@ jobs:

- name: Install package and dependencies
run: |
# Using pip to ensure proper environment discovery by PyInstaller
python -m pip install --upgrade pip
pip install --only-binary :all: .[ionmob] pyinstaller

Expand Down
39 changes: 21 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,40 @@ on:
workflow_dispatch:

jobs:
check-python-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Run Ruff
run: uvx ruff check --output-format=github .

test-python-package:
needs: check-python-package
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff

- name: Run Ruff
run: ruff check --output-format=github .
- name: Install the project
run: uv sync --all-extras --dev

- name: Build and install ms2rescore package
run: |
pip install --only-binary :all: .[dev]

- name: Test with pytest
run: |
pytest
- name: Run tests
run: uv run pytest

- name: Test installation
run: |
ms2rescore --help
run: uv run ms2rescore --help

test-windows-installer:
# Only run on push to main (e.g., after PR merge)
Expand All @@ -54,6 +56,7 @@ jobs:

- name: Install package and dependencies
run: |
# Using pip to ensure proper environment discovery by PyInstaller
python -m pip install --upgrade pip
pip install --only-binary :all: .[ionmob] pyinstaller

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ repos:
args: ["--output-format", "json"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: trailing-whitespace
# - id: end-of-file-fixer

# - repo: https://github.com/pycqa/isort
# rev: 5.11.2
# rev: 5.13.2
# hooks:
# - id: isort
# name: isort (python)

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 24.8.0
hooks:
- id: black
40 changes: 32 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
FROM python:3.11

# ARG DEBIAN_FRONTEND=noninteractive
FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim

LABEL name="ms2rescore"

# ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ms2rescore
# Setup a non-root user
RUN groupadd --system --gid 999 nonroot \
&& useradd --system --gid 999 --uid 999 --create-home nonroot

# Install the project into `/ms2rescore`
WORKDIR /ms2rescore

# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1

# Copy from the cache instead of linking since it's a mounted volume
ENV UV_LINK_MODE=copy

# Ensure installed tools can be executed out of the box
ENV UV_TOOL_BIN_DIR=/usr/local/bin

RUN apt-get update && apt-get install -y procps

# Then, add the rest of the project source code and install it
# Installing separately from its dependencies allows optimal layer caching
ADD pyproject.toml /ms2rescore/pyproject.toml
ADD LICENSE /ms2rescore/LICENSE
ADD README.md /ms2rescore/README.md
ADD MANIFEST.in /ms2rescore/MANIFEST.in
ADD uv.lock /ms2rescore/uv.lock
ADD ms2rescore /ms2rescore/ms2rescore

RUN apt-get update \
&& apt install -y procps \
&& pip install /ms2rescore --only-binary :all:
# Install the project and its dependencies using the lockfile and settings
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-dev

# Place executables in the environment at the front of the path
ENV PATH="/ms2rescore/.venv/bin:$PATH"

# Reset the entrypoint, don't invoke `uv`
ENTRYPOINT []

ENTRYPOINT [""]
# Use the non-root user to run our application
USER nonroot
8 changes: 8 additions & 0 deletions docs/source/api/ms2rescore.feature_generators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ ms2rescore.feature_generators.deeplc



ms2rescore.feature_generators.im2deep
####################################

.. automodule:: ms2rescore.feature_generators.im2deep
:members:



ms2rescore.feature_generators.ionmob
####################################

Expand Down
19 changes: 16 additions & 3 deletions docs/source/config_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,22 @@
- **One of**
- *string*
- *null*
- **`write_flashlfq`** *(boolean)*: Write results to a FlashLFQ-compatible file. Default: `false`.
- **`write_report`** *(boolean)*: Write an HTML report with various QC metrics and charts. Default: `false`.
- **`profile`** *(boolean)*: Write a txt report using cProfile for profiling. Default: `false`.
- **`write_flashlfq`**: Write results to a FlashLFQ-compatible file. Default: `false`.
- **One of**
- *boolean*
- *null*
- **`write_report`**: Write an HTML report with various QC metrics and charts. Default: `true`.
- **One of**
- *boolean*
- *null*
- **`disable_update_check`**: Disable the automatic update check. Default: `false`.
- **One of**
- *boolean*
- *null*
- **`profile`**: Write a txt report using cProfile for profiling. Default: `false`.
- **One of**
- *boolean*
- *null*
## Definitions

- <a id="definitions/feature_generator"></a>**`feature_generator`** *(object)*: Feature generator configuration. Can contain additional properties.
Expand Down
8 changes: 7 additions & 1 deletion ms2rescore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Modular and user-friendly platform for AI-assisted rescoring of peptide identifications ."""

__version__ = "3.2.0.dev2"
# __version__ is provided by the small helper module _version which prefers
# installed distribution metadata and falls back to reading pyproject.toml.
# The single source of truth for the version is pyproject.toml.

__all__ = [
"parse_configurations",
"rescore",
Expand All @@ -16,5 +19,8 @@
module="psims.mzmlb",
)

from ms2rescore._version import get_version # noqa: E402
from ms2rescore.config_parser import parse_configurations # noqa: E402
from ms2rescore.core import rescore # noqa: E402

__version__ = get_version()
29 changes: 23 additions & 6 deletions ms2rescore/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from rich.text import Text

from ms2rescore import __version__, package_data
from ms2rescore._version import check_for_update
from ms2rescore.config_parser import parse_configurations
from ms2rescore.core import rescore
from ms2rescore.exceptions import MS2RescoreConfigurationError
Expand Down Expand Up @@ -148,18 +149,24 @@ def _argument_parser() -> argparse.ArgumentParser:
)
parser.add_argument(
"--write-report",
# metavar="BOOL",
action="store_true",
default=None,
dest="write_report",
help="boolean to enable profiling with cProfile",
help="boolean whether to write an HTML report (default: True)",
)
parser.add_argument(
"--disable-update-check",
action="store_true",
default=None,
dest="disable_update_check",
help="Disable automatic check for software updates (default: False)",
)
parser.add_argument(
"--profile",
# metavar="BOOL",
action="store_true",
# type=bool,
# dest="profile",
help="boolean to enable profiling with cProfile",
default=None,
dest="profile",
help="Enable profiling with cProfile",
)

return parser
Expand Down Expand Up @@ -228,6 +235,16 @@ def main(tims=False):
config["ms2rescore"]["log_level"], config["ms2rescore"]["output_path"] + ".log.txt"
)

# Check for updates
if config["ms2rescore"]["disable_update_check"] is False:
update_info = check_for_update()
if update_info["update_available"]:
LOGGER.info(
f"New version of MS²Rescore available: {update_info['latest_version']} "
f"(you are using {update_info['current_version']})"
)
LOGGER.info(f"Download the latest version at: {update_info['html_url']}")

# Run MS²Rescore
try:
if cli_args.profile:
Expand Down
Loading