From 9456bb6122a3e4729503f2a902263e1e4dc93a0c Mon Sep 17 00:00:00 2001 From: Mohamed Sameh Date: Sun, 15 Dec 2024 20:56:59 +0100 Subject: [PATCH 01/10] fix: zero predictions for ms2 --- alphadia/transferlearning/train.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alphadia/transferlearning/train.py b/alphadia/transferlearning/train.py index 9704d557..b26e7899 100644 --- a/alphadia/transferlearning/train.py +++ b/alphadia/transferlearning/train.py @@ -5,6 +5,7 @@ import torch from alphabase.peptide.fragment import remove_unused_fragments from alphabase.peptide.mobility import ccs_to_mobility_for_df, mobility_to_ccs_for_df +from alphabase.peptide.precursor import refine_precursor_df from peptdeep.model.charge import ChargeModelForModAASeq from peptdeep.model.model_interface import CallbackHandler, LR_SchedulerInterface from peptdeep.pretrained_models import ModelManager @@ -564,13 +565,14 @@ def finetune_ms2( test_intensity_df = test_intensity_df[0] # Prepare order for peptdeep prediction - + val_psm_df = refine_precursor_df(val_psm_df) reordered_val_psm_df = self._reset_frag_idx(val_psm_df) reordered_val_intensity_df = self._order_intensities( reordered_precursor_df=reordered_val_psm_df, unordered_precursor_df=val_psm_df, unordered_frag_df=val_intensity_df, ) + test_psm_df = refine_precursor_df(test_psm_df) reordered_test_psm_df = self._reset_frag_idx(test_psm_df) reordered_test_intensity_df = self._order_intensities( reordered_precursor_df=reordered_test_psm_df, From b0cf870b7491450735c4cb214bdf19888d1782c4 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:21:41 +0100 Subject: [PATCH 02/10] =?UTF-8?q?Bump=20version:=201.9.1=20=E2=86=92=201.9?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alphadia/__init__.py | 2 +- gui/package.json | 2 +- gui/src/main/modules/profile.js | 2 +- misc/.bumpversion.cfg | 2 +- release/linux/build_installer_linux.sh | 2 +- release/linux/control | 2 +- release/macos/build_installer_macos.sh | 2 +- release/macos/build_package_macos.sh | 4 ++-- release/macos/distribution.xml | 2 +- release/macos/info.plist | 4 ++-- release/windows/alphadia_innoinstaller.iss | 4 ++-- release/windows/build_installer_windows.ps1 | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/alphadia/__init__.py b/alphadia/__init__.py index bd2ea95b..e16450ce 100644 --- a/alphadia/__init__.py +++ b/alphadia/__init__.py @@ -1,3 +1,3 @@ #!python -__version__ = "1.9.1" +__version__ = "1.9.2" diff --git a/gui/package.json b/gui/package.json index def7516f..0c003da7 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,7 +1,7 @@ { "name": "alphadia", "productName": "alphadia-gui", - "version": "1.9.1", + "version": "1.9.2", "description": "Graphical user interface for DIA data analysis", "main": "dist/electron.js", "homepage": "./", diff --git a/gui/src/main/modules/profile.js b/gui/src/main/modules/profile.js index bcd47d0a..787e9a5c 100644 --- a/gui/src/main/modules/profile.js +++ b/gui/src/main/modules/profile.js @@ -3,7 +3,7 @@ const path = require("path") const { app, shell, BrowserWindow} = require("electron") const { dialog } = require('electron') -const VERSION = "1.9.1" +const VERSION = "1.9.2" const Profile = class { diff --git a/misc/.bumpversion.cfg b/misc/.bumpversion.cfg index 97037493..1aa88e0f 100644 --- a/misc/.bumpversion.cfg +++ b/misc/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.9.1 +current_version = 1.9.2 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/release/linux/build_installer_linux.sh b/release/linux/build_installer_linux.sh index cfcbb9bb..35703bad 100755 --- a/release/linux/build_installer_linux.sh +++ b/release/linux/build_installer_linux.sh @@ -10,7 +10,7 @@ rm -rf dist build *.egg-info rm -rf dist_pyinstaller build_pyinstaller python -m build -pip install "dist/alphadia-1.9.1-py3-none-any.whl[stable]" +pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" if [ "${CPU_OR_GPU}" != "GPU" ]; then pip install torch -U --extra-index-url https://download.pytorch.org/whl/cpu diff --git a/release/linux/control b/release/linux/control index 1568815e..90fed30a 100644 --- a/release/linux/control +++ b/release/linux/control @@ -1,5 +1,5 @@ Package: alphadia -Version: 1.9.1 +Version: 1.9.2 Architecture: all Maintainer: Mann Labs Description: alphadia diff --git a/release/macos/build_installer_macos.sh b/release/macos/build_installer_macos.sh index 7df4cf99..0fd02708 100755 --- a/release/macos/build_installer_macos.sh +++ b/release/macos/build_installer_macos.sh @@ -10,7 +10,7 @@ rm -rf dist_pyinstaller build_pyinstaller export EAGER_IMPORT=true # TODO check if this can be removed with newset peptdeep version w/out transformer dependenc python -m build -pip install "dist/alphadia-1.9.1-py3-none-any.whl[stable]" +pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" # Creating the stand-alone pyinstaller folder pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y diff --git a/release/macos/build_package_macos.sh b/release/macos/build_package_macos.sh index 6838c237..2ae26c65 100755 --- a/release/macos/build_package_macos.sh +++ b/release/macos/build_package_macos.sh @@ -7,10 +7,10 @@ set -e -u # Set up package name and version PACKAGE_NAME="alphadia" APP_NAME="alphadia" -PACKAGE_VERSION="1.9.1" +PACKAGE_VERSION="1.9.2" PKG_FOLDER="dist/$APP_NAME.app" -# BUILD_NAME is taken from environment variables, e.g. alphadia-1.9.1-macos-darwin-arm64 or alphadia-1.9.1-macos-darwin-x64 +# BUILD_NAME is taken from environment variables, e.g. alphadia-1.9.2-macos-darwin-arm64 or alphadia-1.9.2-macos-darwin-x64 rm -rf ${BUILD_NAME}.pkg # Cleanup the package folder diff --git a/release/macos/distribution.xml b/release/macos/distribution.xml index d5d7dea8..bac68251 100644 --- a/release/macos/distribution.xml +++ b/release/macos/distribution.xml @@ -1,6 +1,6 @@ - AlphaDIA 1.9.1 + AlphaDIA 1.9.2 diff --git a/release/macos/info.plist b/release/macos/info.plist index 3809c893..02a16ba3 100644 --- a/release/macos/info.plist +++ b/release/macos/info.plist @@ -9,9 +9,9 @@ CFBundleIconFile alphadia.icns CFBundleIdentifier - alphadia.1.9.1 + alphadia.1.9.2 CFBundleShortVersionString - 1.9.1 + 1.9.2 CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/release/windows/alphadia_innoinstaller.iss b/release/windows/alphadia_innoinstaller.iss index 4f332647..a19ba8e4 100644 --- a/release/windows/alphadia_innoinstaller.iss +++ b/release/windows/alphadia_innoinstaller.iss @@ -5,7 +5,7 @@ ; so all paths are given relative to the location of this .iss file. #define MyAppName "AlphaDIA" -#define MyAppVersion "1.9.1" +#define MyAppVersion "1.9.2" #define MyAppPublisher "Max Planck Institute of Biochemistry, Mann Labs" #define MyAppURL "https://github.com/MannLabs/alphadia" #define MyAppExeName "alphadia-gui.exe" @@ -29,7 +29,7 @@ PrivilegesRequired=lowest PrivilegesRequiredOverridesAllowed=dialog ; release workflow expects artifact at root of repository OutputDir=..\..\ -; example for BUILD_NAME: alphadia-1.9.1-win-x64 +; example for BUILD_NAME: alphadia-1.9.2-win-x64 OutputBaseFilename={#GetEnv('BUILD_NAME')} SetupIconFile=..\logos\alphadia.ico Compression=lzma diff --git a/release/windows/build_installer_windows.ps1 b/release/windows/build_installer_windows.ps1 index 974e2682..1123d75f 100644 --- a/release/windows/build_installer_windows.ps1 +++ b/release/windows/build_installer_windows.ps1 @@ -5,7 +5,7 @@ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist python -m build -pip install "dist/alphadia-1.9.1-py3-none-any.whl[stable]" +pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" # Creating the stand-alone pyinstaller folder pip install tbb==2021.13.1 From 9421198c0f33e635630c5428ecf67cf2b55dfc4a Mon Sep 17 00:00:00 2001 From: GeorgWa Date: Fri, 20 Dec 2024 11:48:08 +0100 Subject: [PATCH 03/10] fix dask version --- requirements/requirements.txt | 1 + requirements/requirements_loose.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index c421c4e8..6a165d05 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -17,6 +17,7 @@ transformers==4.40.2 directlfq==0.2.19 pythonnet==3.0.3 zstandard==0.22.0 +dask==2024.11.2 # not direct dependencies but we have to restrict the versions numpy<2 # test: tolerate_version avoid the breaking change in numpy >= 2 scipy==1.12.0 diff --git a/requirements/requirements_loose.txt b/requirements/requirements_loose.txt index 68aa94bf..d373a565 100644 --- a/requirements/requirements_loose.txt +++ b/requirements/requirements_loose.txt @@ -6,6 +6,7 @@ alpharaw>=0.3.1 # test: tolerate_version alphatims alphabase>=1.4.0 # test: tolerate_version peptdeep>=1.3.0 # test: tolerate_version +dask==2024.11.2 # test: tolerate_version progressbar neptune seaborn From 7511152dfc5d6977deb01a99db6b66f87d7b630b Mon Sep 17 00:00:00 2001 From: Mohamed Sameh Date: Fri, 20 Dec 2024 19:02:36 +0100 Subject: [PATCH 04/10] fix the nan bug --- alphadia/outputaccumulator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alphadia/outputaccumulator.py b/alphadia/outputaccumulator.py index 9f1e8547..76c14cd2 100644 --- a/alphadia/outputaccumulator.py +++ b/alphadia/outputaccumulator.py @@ -585,8 +585,8 @@ def ms2_quality_control( # use the precursor for MS2 learning if the median correlation is above the cutoff use_for_ms2[i] = median_correlation > precursor_correlation_cutoff - # Fix: Use loc to modify the original DataFrame instead of the view - spec_lib_base.fragment_intensity_df.loc[start_idx:stop_idx] = ( + # Fix: Use iloc to modify the original DataFrame instead of the view + spec_lib_base.fragment_intensity_df.iloc[start_idx:stop_idx] = ( fragment_intensity_view.values * ( fragment_correlation_view From 8cb6e1b9d69cdeb59294e67c8de152183dedc346 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:55:54 +0100 Subject: [PATCH 05/10] install mono in CI install mono in CI --- .github/workflows/_run_tests.yml | 5 +++++ misc/pip_install.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index e5032c14..92436ac9 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -34,6 +34,11 @@ jobs: - name: Conda info shell: bash -l {0} run: conda info + - name: Install mono + shell: bash -l {0} + run: | + conda install mono + - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | diff --git a/misc/pip_install.sh b/misc/pip_install.sh index bbfd5352..2ca0b8b8 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -4,7 +4,7 @@ INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} -conda create -n $ENV_NAME python=$PYTHON_VERSION -y +conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From b00c6de6214426a597d1e6ac89b9542b10d265f5 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:14:02 +0100 Subject: [PATCH 06/10] no mono for windows --- .github/workflows/_run_tests.yml | 6 +++--- misc/pip_install.sh | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 92436ac9..7689ecf3 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -35,17 +35,17 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono + if: ${{ runner.os != 'windows-latest' }} shell: bash -l {0} run: | conda install mono - - name: Perform pip installation with all stable dependencies shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} diff --git a/misc/pip_install.sh b/misc/pip_install.sh index 2ca0b8b8..b48ee03e 100644 --- a/misc/pip_install.sh +++ b/misc/pip_install.sh @@ -3,8 +3,13 @@ set -e -u INSTALL_TYPE=$1 # stable, loose, etc.. ENV_NAME=${2:-alphadia} PYTHON_VERSION=${3:-3.11} +INSTALL_MONO=${4:-false} -conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y +if [ "$INSTALL_MONO" = "true" ]; then + conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y +else + conda create -n $ENV_NAME python=$PYTHON_VERSION -y +fi if [ "$INSTALL_TYPE" = "loose" ]; then INSTALL_STRING="" From 7d72682102a0fad90eb1b80cbe7cd8c7b166dfb3 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:38:08 +0100 Subject: [PATCH 07/10] fix no mono for windows --- .github/workflows/_run_tests.yml | 11 ++++++----- .github/workflows/branch-checks.yaml | 3 ++- .github/workflows/pip_installation.yml | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 7689ecf3..0333c79e 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -1,5 +1,5 @@ # reusable workflow to run tests on different installation types and OS -name: run-tests +name: Run unit tests on ${{ inputs.os }} on: workflow_call: @@ -17,7 +17,8 @@ on: required: true type: string jobs: - run-unit-tests-stable-ubuntu: + run-unit-tests: + name: Unit tests [${{ inputs.os }}] runs-on: ${{ inputs.os }} steps: - uses: actions/checkout@v4 @@ -35,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ runner.os != 'windows-latest' }} + if: ${{ inputs.os != 'windows-latest' }} shell: bash -l {0} run: | conda install mono @@ -43,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ runner.os != 'windows-latest' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} diff --git a/.github/workflows/branch-checks.yaml b/.github/workflows/branch-checks.yaml index 5fa58954..90677094 100644 --- a/.github/workflows/branch-checks.yaml +++ b/.github/workflows/branch-checks.yaml @@ -15,8 +15,9 @@ jobs: # For feature branches, we don't test the full matrix (os x [stable, loose]) in order to save time & resources. run-tests-stable: - name: Test stable pip installation on ubuntu-latest + name: Test 'stable' on ubuntu-latest strategy: + fail-fast: false matrix: os: [ubuntu-latest] python-version: ["3.10", "3.11", "3.12"] diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index 172f3b5a..92e6721b 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -21,7 +21,7 @@ concurrency: jobs: run-unit-tests-stable: - name: Test stable pip installation on 3 OS + name: Test 'stable' on ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-13, windows-latest] @@ -34,7 +34,7 @@ jobs: test-script: ./run_unit_tests.sh run-unit-tests-loose: - name: Test loose pip installation on 3 OS + name: Test 'loose' on ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, macos-13, windows-latest ] From c064a8f10051272342de49403d25d9caa16f38c6 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:42:18 +0100 Subject: [PATCH 08/10] add support for Windows 95 (TM) --- .github/workflows/_run_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 0333c79e..2e528439 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ inputs.os != 'windows-latest' }} + if: ${{ contains(inputs.os, 'windows') == 'false' }} shell: bash -l {0} run: | conda install mono @@ -44,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ inputs.os != 'windows-latest' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} From 99081d7706bcba30c44984d23bfde69ffb2dfe7d Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:50:30 +0100 Subject: [PATCH 09/10] fix --- .github/workflows/_run_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 2e528439..59a8698e 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -1,5 +1,5 @@ # reusable workflow to run tests on different installation types and OS -name: Run unit tests on ${{ inputs.os }} +name: Run unit tests on: workflow_call: From afea9730ffae0867cd0456b90cc75e1a9a8514ae Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:49:33 +0100 Subject: [PATCH 10/10] fix --- .github/workflows/_run_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_run_tests.yml b/.github/workflows/_run_tests.yml index 59a8698e..1cc32945 100644 --- a/.github/workflows/_run_tests.yml +++ b/.github/workflows/_run_tests.yml @@ -36,7 +36,7 @@ jobs: shell: bash -l {0} run: conda info - name: Install mono - if: ${{ contains(inputs.os, 'windows') == 'false' }} + if: ${{ !contains(inputs.os, 'windows') }} shell: bash -l {0} run: | conda install mono @@ -44,9 +44,9 @@ jobs: shell: bash -l {0} run: | cd misc - . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} + . ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }} - name: Run tests shell: bash -l {0} run: | cd tests - . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ contains(inputs.os, 'windows') == 'false' }} + . ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }}