Skip to content

Commit

Permalink
Merge pull request #419 from MannLabs/fix-nan-fragments-bug
Browse files Browse the repository at this point in the history
fix the nans in accumulated transferlib bug
  • Loading branch information
GeorgWa authored Dec 21, 2024
2 parents 9d0ac2f + afea973 commit 485717b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/_run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# reusable workflow to run tests on different installation types and OS
name: run-tests
name: Run unit tests

on:
workflow_call:
Expand All @@ -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
Expand All @@ -34,13 +35,18 @@ jobs:
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Install mono
if: ${{ !contains(inputs.os, 'windows') }}
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 }} ${{ !contains(inputs.os, 'windows') }}
- name: Run tests
shell: bash -l {0}
run: |
cd tests
. ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }}
. ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }}
3 changes: 2 additions & 1 deletion .github/workflows/branch-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pip_installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 ]
Expand Down
4 changes: 2 additions & 2 deletions alphadia/outputaccumulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion misc/pip_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -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=""
Expand Down

0 comments on commit 485717b

Please sign in to comment.