Skip to content

Commit

Permalink
Adapt tests to sage/msgf - runs fine locally
Browse files Browse the repository at this point in the history
  • Loading branch information
glormph committed Jan 31, 2025
1 parent 197f1d4 commit 5f14dc9
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 33 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ jobs:
create-container:
uses: ./.github/workflows/container.yml

run-all-tests:
run-all-tests-sage:
needs: create-container
env:
SEARCH: sage
uses: ./.github/workflows/tests_all.yml

run-all-tests-msgf:
needs: create-container
env:
SEARCH: msgf
uses: ./.github/workflows/tests_all.yml

create-release:
runs-on: ubuntu-latest
needs: run-all-tests
needs: [run-all-tests-sage, run-all-tests-msgf]
steps:
- uses: ncipollo/release-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/single_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
uses: nf-core/setup-nextflow@v2

- name: Run single test
run: bash run_tests.sh tmt16_fast
run: bash run_tests.sh sage tmt16_fast
12 changes: 6 additions & 6 deletions .github/workflows/tests_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: nf-core/setup-nextflow@v2

- name: Run tests
run: bash run_tests.sh tmt16
run: bash run_tests.sh $SEARCH tmt16

test-tmt18:
runs-on: ubuntu-latest
Expand All @@ -27,7 +27,7 @@ jobs:
uses: nf-core/setup-nextflow@v2

- name: Run tests
run: bash run_tests.sh tmt18
run: bash run_tests.sh $SEARCH tmt18

test-labelfree:
runs-on: ubuntu-latest
Expand All @@ -39,7 +39,7 @@ jobs:
uses: nf-core/setup-nextflow@v2

- name: Run tests
run: bash run_tests.sh labelfree
run: bash run_tests.sh $SEARCH labelfree

test-lf_phos:
runs-on: ubuntu-latest
Expand All @@ -51,7 +51,7 @@ jobs:
uses: nf-core/setup-nextflow@v2

- name: Run tests
run: bash run_tests.sh labelfree_phos
run: bash run_tests.sh $SEARCH labelfree_phos

test-tims:
runs-on: ubuntu-latest
Expand All @@ -63,7 +63,7 @@ jobs:
uses: nf-core/setup-nextflow@v2

- name: Run tests
run: bash run_tests.sh tims
run: bash run_tests.sh $SEARCH tims

test-mixed-tmt:
runs-on: ubuntu-latest
Expand All @@ -75,4 +75,4 @@ jobs:
uses: nf-core/setup-nextflow@v2

- name: Run tests
run: bash run_tests.sh tmt16_18
run: bash run_tests.sh $SEARCH tmt16_18
15 changes: 11 additions & 4 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ rundir=$(pwd)
export repodir=$(dirname "$(realpath -s "$0")")
export testdir="${repodir}/tests/"
export testdata="${rundir}/static-resources/test-data/ddamsproteomics"
if [ "$1" != 'sage' ] && [ "$1" != 'msgf' ]
then
echo 'Must run tests with "bash run_tests.sh sage [or msgf]"'
exit 1
fi
export NXFCMD="nextflow run -resume -profile test ${repodir}/main.nf --$1"

if [ -e "${testdata}" ]
then
Expand All @@ -33,7 +39,8 @@ test_names=(
tims
)

if [ -z "$1" ]

if [ -z "$2" ]
then
# Run all tests, do not exit with failures
# Manual runs
Expand All @@ -54,12 +61,12 @@ then
else
# Single test, exit with error when failing
# Used in github actions
bash "${testdir}/$1.sh"
bash "${testdir}/$2.sh"
if [[ "$?" == 0 ]]
then
echo ${green}"$1" - SUCCESS ${reset}
echo ${green}"$2" - SUCCESS ${reset}
else
echo ${red}"$1" - FAIL ${reset}
echo ${red}"$2" - FAIL ${reset}
exit 1
fi
fi
8 changes: 4 additions & 4 deletions tests/labelfree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu
echo Normal labelfree test
name=lf
cat ${testdir}/lf_mzmls.txt | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir test_output/${name} \
--input test_output/mzmldef \
--genes \
Expand All @@ -23,7 +23,7 @@ nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
echo Labelfree run with warnings: no decoy in setB, no target in setA
name=lf_notarget
cat ${testdir}/lf_mzmls.txt | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir test_output/${name} \
--input test_output/mzmldef \
--genes \
Expand All @@ -34,7 +34,7 @@ nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
echo Labelfree run without fractions, with warnings: no decoy in setB, no target in setA
name=lf_nofrac_notarget
cat ${testdir}/lf_mzmls_nofrac.txt | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir test_output/${name} \
--input test_output/mzmldef \
--genes \
Expand All @@ -46,7 +46,7 @@ nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
echo Single file labelfree test
name=lf_singlefile
cat <(head -n1 ${testdir}/lf_mzmls.txt) <(grep setA ${testdir}/lf_mzmls.txt) | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir test_output/${name} \
--input test_output/mzmldef \
--genes \
Expand Down
9 changes: 5 additions & 4 deletions tests/labelfree_phos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo Phospho, labelfree, one luciphor setB not enough PSMs
name=labelfree_phos
lfphos_dir=test_output/${name}
cat ${testdir}/lf_mzmls.txt | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir ${lfphos_dir} \
--input test_output/mzmldef \
--genes \
Expand All @@ -19,7 +19,7 @@ nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
# LF phos where we add replace a set with a "new" set
name=labelfree_phos_addset
cat <(head -n1 ${testdir}/lf_mzmls.txt) <(grep setA ${testdir}/lf_mzmls.txt) | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir test_output/${name} \
--input test_output/mzmldef \
--oldmzmldef ${testdir}/lf_mzmls.txt \
Expand All @@ -41,7 +41,7 @@ nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
echo LF phos no decoy
name=labelfree_phos_nodecoy
cat <(head -n1 ${testdir}/lf_mzmls.txt) <(grep setA ${testdir}/lf_mzmls.txt) | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir test_output/${name} \
--input test_output/mzmldef \
--genes \
Expand All @@ -55,9 +55,10 @@ set +eu
echo Run in which no target PSMs are found - crashes
name=labelfree_phos_notarget
cat <(head -n1 ${testdir}/lf_mzmls.txt) <(grep setA ${testdir}/lf_mzmls.txt) | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} \
$NXFCMD --name ${name} \
--outdir test_output/${name} \
--input test_output/mzmldef \
--psmconflvl 0.001 \
--genes \
--tdb ${testdata}/lf.fa \
--mods 'carbamidomethyl;oxidation' \
Expand Down
2 changes: 1 addition & 1 deletion tests/tims.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo TIMS TMT16, noms1quant
name=tims_tmt16
baseresults=test_output/${name}
cat "${testdir}/tims_mzmls.txt" | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir ${baseresults} \
$NXFCMD --name ${name} --outdir ${baseresults} \
--sampletable "${testdir}/tmt16_samples.txt" \
--noms1quant \
--input test_output/mzmldef \
Expand Down
12 changes: 7 additions & 5 deletions tests/tmt16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ name=tmt16denomdeq
resultsdir=test_output/${name}
mkdir -p $resultsdir
cat "${testdir}/tmt16_mzmls.txt" | envsubst > ${resultsdir}/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir ${resultsdir} \
$NXFCMD --name ${name} --outdir ${resultsdir} \
--input ${resultsdir}/mzmldef \
--sampletable "${testdir}/tmt16_samples.txt" \
--hardklor --isobaric '0set-A:tmtpro:126:131N' \
--tdb "${testdata}/tmt16_fa.fa" \
--mods 'carbamidomethyl;oxidation;43.005814,*,opt,N-term,Unknown' \
--maxmiscleav 2 \
--pepconflvl 0.05 \
--deqms --keepnapsmsquant --genes


Expand All @@ -25,7 +27,7 @@ baseresults=${resultsdir}
resultsdir=test_output/${name}
mkdir -p $resultsdir
cat <(head -n1 "${testdir}/tmt16_mzmls.txt") <(grep fr07 ${testdir}/tmt16_mzmls.txt) | envsubst > ${resultsdir}/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir test_output/${name} \
$NXFCMD --name ${name} --outdir test_output/${name} \
--input ${resultsdir}/mzmldef \
--sampletable "${testdir}/tmt16_samples.txt" \
--hardklor --isobaric '0set-A:tmtpro:126:131N' \
Expand All @@ -48,7 +50,7 @@ resultsdir=test_output/${name}
mkdir -p $resultsdir
cat "${testdir}/tmt16_mzmls.txt" | envsubst > ${resultsdir}/oldmzmls
cat "${testdir}/tmt16_setB_mzmls.txt" | envsubst > ${resultsdir}/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir test_output/${name} \
$NXFCMD --name ${name} --outdir test_output/${name} \
--input ${resultsdir}/mzmldef \
--sampletable "${testdir}/tmt16_setAB_samples.txt" \
--isobaric '0set-A:tmtpro:126:131N set-B:tmt16plex:126:131N' \
Expand All @@ -69,7 +71,7 @@ baseresults=${resultsdir}
resultsdir=test_output/${name}
mkdir -p $resultsdir
cat <(head -n1 "${testdir}/tmt16_mzmls.txt") <(grep fr07 ${testdir}/tmt16_mzmls.txt) <(grep fr08 ${testdir}/tmt16_mzmls.txt | cut -f1-3) | envsubst > ${resultsdir}/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir test_output/${name} \
$NXFCMD --name ${name} --outdir test_output/${name} \
--input ${resultsdir}/mzmldef \
--sampletable "${testdir}/tmt16_samples.txt" \
--hardklor --isobaric '0set-A:tmtpro:126:131N' \
Expand All @@ -85,7 +87,7 @@ name=tmt16_singlefile
resultsdir=test_output/${name}
mkdir -p $resultsdir
cat <(head -n1 ${testdir}/tmt16_mzmls.txt) <(grep fr08 ${testdir}/tmt16_mzmls.txt) | envsubst > ${resultsdir}/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir test_output/${name} \
$NXFCMD --name ${name} --outdir test_output/${name} \
--input ${resultsdir}/mzmldef \
--sampletable "${testdir}/tmt16_samples.txt" \
--hardklor --isobaric '0set-A:tmtpro:126:131N' \
Expand Down
2 changes: 1 addition & 1 deletion tests/tmt16_18.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo TMT 16/18 mix, multi DB run
name=tmt16_18mix
baseresults=test_output/${name}
cat "${testdir}/tmt16_mzmls.txt" <(sed 's/0set-A/20set-A/' "${testdir}/tmt18_mzmls.txt" | tail -n+2) | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir ${baseresults} \
$NXFCMD --name ${name} --outdir ${baseresults} \
--input test_output/mzmldef \
--sampletable "${testdir}/tmt18_setAB_samples.txt" \
--isobaric '0set-A:tmt16plex:126:131N 20set-A:tmt18plex:131' \
Expand Down
5 changes: 3 additions & 2 deletions tests/tmt16_fast.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/usr/bin/env bash

# Single test to not spend too much time, tests a lot of things but not all.

set -eu

echo TMT16 test with hiRIEF, isobaric and Phospho
# no hirief, so it can be added in the addsetB test even if not used here
# Test TMT16, DEqMS w denominator, keepnapsmsquant, implicit normalizing (deqms forces normalize)
# Warning: no decoys for any set (aka only setA)
name=tmt16denomdeq
resultsdir=test_output/${name}
mkdir -p $resultsdir
cat "${testdir}/tmt16_mzmls.txt" | envsubst > ${resultsdir}/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir ${resultsdir} \
$NXFCMD --name ${name} --outdir ${resultsdir} \
--input ${resultsdir}/mzmldef \
--sampletable "${testdir}/tmt16_samples.txt" \
--hardklor --isobaric '0set-A:tmtpro:126:131N' \
Expand Down
6 changes: 3 additions & 3 deletions tests/tmt18.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo TMT18 phos, no MS1 found somehow
name=tmt18phos
baseresults=test_output/${name}
cat "${testdir}/tmt18_mzmls.txt" | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir ${baseresults} \
$NXFCMD --name ${name} --outdir ${baseresults} \
--input test_output/mzmldef \
--sampletable "${testdir}/tmt18_samples.txt" \
--hardklor --isobaric '0set-A:tmt18plex:126:131N' \
Expand All @@ -30,7 +30,7 @@ mkdir -p test_output/${name}
ln -fs "${testdata}/tmt18_fr06_1000.mzML" "${testdata}/linked_tmt18_fr06_1000.mzML"
cat "${testdir}/tmt18_mzmls.txt" | envsubst > test_output/${name}/oldmzmls
sed 's/tmt18_fr/linked_tmt18_fr/;s/0set-A/20set-A/' "${testdir}/tmt18_mzmls.txt" | envsubst > test_output/mzmldef
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir test_output/${name} \
$NXFCMD --name ${name} --outdir test_output/${name} \
--input test_output/mzmldef \
--sampletable "${testdir}/tmt18_setAB_samples.txt" \
--hardklor --isobaric '0set-A:tmt18plex:sweep 20set-A:tmt18plex:sweep' \
Expand All @@ -52,7 +52,7 @@ echo TMT18 rerun with different settings post PSMs, --noms1quant
name=tmt18phos_rerun
mkdir -p test_output/${name}
cat "${testdir}/tmt18_mzmls.txt" | envsubst > test_output/${name}/oldmzmls
nextflow run -resume -profile test ${repodir}/main.nf --name ${name} --outdir test_output/${name} \
$NXFCMD --name ${name} --outdir test_output/${name} \
--sampletable "${testdir}/tmt18_samples.txt" \
--isobaric '0set-A:tmt18plex:131' \
--tdb "${testdata}/tmt18_fa.fa" \
Expand Down

0 comments on commit 5f14dc9

Please sign in to comment.