Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .binder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COPY LICENSE LICENSE
COPY README.md README.md
COPY pyproject.toml pyproject.toml

RUN pip install ".[stable]"
RUN pip install ".[stable,dask-stable]"

# change owner to be able to write to that folder
COPY --chown=${USER}:${USER} example_nbs example_nbs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_tests_quick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: ./pip_install.sh tests,gui
install-script: ./pip_install.sh tests,gui,dask
test-script: ./run_e2e_tests_quick.sh
4 changes: 2 additions & 2 deletions .github/workflows/e2e_tests_quick_multiple_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: ./pip_install.sh stable,tests,gui
install-script: ./pip_install.sh stable,tests,gui,dask-stable
test-script: ./run_e2e_tests_quick.sh

run-unit-tests-loose:
Expand All @@ -43,5 +43,5 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: ./pip_install.sh tests,gui
install-script: ./pip_install.sh tests,gui,dask
test-script: ./run_e2e_tests_quick.sh
2 changes: 1 addition & 1 deletion .github/workflows/install_and_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: ./pip_install.sh tests,gui
install-script: ./pip_install.sh tests,gui,dask
test-script: ./run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: ./pip_install.sh stable,tests,gui
install-script: ./pip_install.sh stable,tests,gui,dask-stable
test-script: ./run_unit_tests.sh

run-unit-tests-loose:
Expand All @@ -40,5 +40,5 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: ./pip_install.sh tests,gui
install-script: ./pip_install.sh tests,gui,dask
test-script: ./run_unit_tests.sh
2 changes: 1 addition & 1 deletion .github/workflows/run_example_nbs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: ./pip_install.sh tests,gui
install-script: ./pip_install.sh tests,gui,dask
test-script: ./run_example_notebooks.sh
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COPY LICENSE LICENSE
COPY README.md README.md
COPY pyproject.toml pyproject.toml

RUN pip install ".[stable,gui-stable]"
RUN pip install ".[stable,gui-stable,dask-stable]"

ENV PORT=41215
EXPOSE 41215
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ For those who are really adventurous, it is also possible to directly install an
pip install "git+https://github.com/MannLabs/alphaquant.git@development#egg=alphaquant[stable,development-stable]"
```

#### Optional extras

For processing very large PTM files that don't fit in memory, install the optional dask extra:

```bash
pip install "alphaquant[dask]"
```
or the version with a pinned dependency (recommended)
```bash
pip install "alphaquant[dask-stable]"
```

### Developer installation

AlphaQuant can also be installed in editable (i.e. developer) mode with a few `bash` commands. This allows to fully customize the software and even modify the source code to your specific needs. When an editable Python package is installed, its source code is stored in a transparent location of your choice. While optional, it is advised to first (create and) navigate to e.g. a general software folder:
Expand Down
16 changes: 15 additions & 1 deletion alphaquant/ptm/ptmsite_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@
# Cell

import pandas as pd
import dask.dataframe as dd
import warnings

try:
import dask.dataframe as dd
HAS_DASK = True
except ModuleNotFoundError:
HAS_DASK = False
warnings.warn(
"Dependency 'dask' not installed. If you want to use its functionality, install it with: `pip install \"alphaquant[dask]\"` . ImportError will be raised if the data requires out-of-memory processing."
)


def assign_dataset_chunkwise(input_file, results_dir, samplemap_df , modification_type = "[Phospho (STY)]", id_thresh = 0.6, excl_thresh =0.2 ,swissprot_file = None,
Expand All @@ -46,6 +54,12 @@ def assign_dataset_chunkwise(input_file, results_dir, samplemap_df , modificatio
input_type (str): Type of input data ("Spectronaut" or "DIANN")
organism (str): Organism name
"""
if not HAS_DASK:
raise ImportError(
"Dask is required for out-of-memory PTM site mapping. "
"Install it with: pip install \"alphaquant[dask]\""
)

clean_up_previous_processings(results_dir)

if input_type == 'Spectronaut':
Expand Down
2 changes: 1 addition & 1 deletion alphaquant/quant_reader/longformat_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
HAS_DASK = True
except ModuleNotFoundError:
warnings.warn(
"Dependency 'dask' not installed. If you want to use its functionality, install alphaquant with the 'dask' extra. Falling back to non-dask based processing."
"Dependency 'dask' not installed. If you want to use its functionality, install it with: `pip install \"alphaquant[dask]\"` . Falling back to non-dask based processing."
)
HAS_DASK = False

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ optional-dependencies = { stable = { file = ["requirements/requirements.txt",
] }, gui-stable = { file = [ "requirements/requirements_gui.txt",
] }, tests = { file = [ "requirements/requirements_tests.txt",
] }, development = { file = ["requirements/requirements_development.txt", "requirements/requirements_tests.txt",
] }, dask = { file = [ "requirements/requirements_dask_loose.txt",
] }, dask-stable = { file = [ "requirements/requirements_dask.txt",
] }}

version = {attr = "alphaquant.__version__"}
Expand Down
3 changes: 1 addition & 2 deletions release/linux/build_installer_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ rm -rf dist_pyinstaller build_pyinstaller

# Find the wheel file in dist directory
WHL_NAME=$(cd dist && ls ./*.whl && cd ..)
pip install "dist/${WHL_NAME}[stable,gui-stable]"
pip install "dist/${WHL_NAME}[stable,gui-stable,dask-stable]"

# Creating the stand-alone pyinstaller folder
pip install pyinstaller
pyinstaller release/pyinstaller/alphaquant.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y

3 changes: 1 addition & 2 deletions release/macos/build_installer_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ rm -rf dist_pyinstaller build_pyinstaller

# Get the wheel file name from dist directory
WHL_NAME=$(cd dist && ls ./*.whl && cd ..)
pip install "dist/${WHL_NAME}[stable,gui-stable]"
pip install "dist/${WHL_NAME}[stable,gui-stable,dask-stable]"

# Creating the stand-alone pyinstaller folder
pip install pyinstaller
pyinstaller release/pyinstaller/alphaquant.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y

3 changes: 1 addition & 2 deletions release/windows/build_installer_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist_pyinstaller

# substitute X.Y.Z-devN with X.Y.Z.devN
$WHL_NAME = (Get-ChildItem -Path "dist" -Filter "*.whl").Name
pip install "dist/$WHL_NAME[stable,gui-stable]"
pip install "dist/$WHL_NAME[stable,gui-stable,dask-stable]"

# Creating the stand-alone pyinstaller folder
pip install pyinstaller
pyinstaller release/pyinstaller/alphaquant.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y
2 changes: 0 additions & 2 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ anytree==2.12.1
graphviz==0.20.3
click==8.1.8
lmfit==1.3.2
dask==2025.1.0
multiprocess==0.70.17
pyfasta==0.5.2
openpyxl==3.1.5
scikit-learn==1.6.1
alphamap==0.2.0
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements_dask.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dask==2025.1.0
1 change: 1 addition & 0 deletions requirements/requirements_dask_loose.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dask
2 changes: 0 additions & 2 deletions requirements/requirements_loose.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ anytree
graphviz
click
lmfit
dask
multiprocess
pyfasta
openpyxl
scikit-learn
alphabase
Expand Down
Loading