diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 663f575..0bc4b52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/.github/workflows/single_test.yml b/.github/workflows/single_test.yml index 8f9f102..44ce0c2 100644 --- a/.github/workflows/single_test.yml +++ b/.github/workflows/single_test.yml @@ -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 diff --git a/.github/workflows/tests_all.yml b/.github/workflows/tests_all.yml index 8c9b75e..c08cb3e 100644 --- a/.github/workflows/tests_all.yml +++ b/.github/workflows/tests_all.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/run_tests.sh b/run_tests.sh index cc0d6b5..68a2e52 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -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 @@ -33,7 +39,8 @@ test_names=( tims ) -if [ -z "$1" ] + +if [ -z "$2" ] then # Run all tests, do not exit with failures # Manual runs @@ -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 diff --git a/tests/labelfree.sh b/tests/labelfree.sh index 4def2ae..871bf3e 100644 --- a/tests/labelfree.sh +++ b/tests/labelfree.sh @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ diff --git a/tests/labelfree_phos.sh b/tests/labelfree_phos.sh index ec2870f..1e95415 100644 --- a/tests/labelfree_phos.sh +++ b/tests/labelfree_phos.sh @@ -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 \ @@ -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 \ @@ -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 \ @@ -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' \ diff --git a/tests/tims.sh b/tests/tims.sh index 49af58e..11f0530 100644 --- a/tests/tims.sh +++ b/tests/tims.sh @@ -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 \ diff --git a/tests/tmt16.sh b/tests/tmt16.sh index 81a5ce2..c17c4e8 100644 --- a/tests/tmt16.sh +++ b/tests/tmt16.sh @@ -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 @@ -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' \ @@ -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' \ @@ -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' \ @@ -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' \ diff --git a/tests/tmt16_18.sh b/tests/tmt16_18.sh index 4c3686e..be4d690 100644 --- a/tests/tmt16_18.sh +++ b/tests/tmt16_18.sh @@ -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' \ diff --git a/tests/tmt16_fast.sh b/tests/tmt16_fast.sh index 1aa598d..08f2002 100644 --- a/tests/tmt16_fast.sh +++ b/tests/tmt16_fast.sh @@ -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' \ diff --git a/tests/tmt18.sh b/tests/tmt18.sh index 7f90175..29e1453 100644 --- a/tests/tmt18.sh +++ b/tests/tmt18.sh @@ -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' \ @@ -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' \ @@ -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" \