diff --git a/.github/workflows/standard-test.yml b/.github/workflows/standard-test.yml index c1de49bc..f8f61872 100644 --- a/.github/workflows/standard-test.yml +++ b/.github/workflows/standard-test.yml @@ -27,9 +27,11 @@ jobs: nxf_ver: ['22.10.0', 'latest'] steps: - - name: Check out pipeline code - uses: actions/checkout@v3 - + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - uses: nf-core/setup-nextflow@v1 with: version: ${{ matrix.nxf_ver }} @@ -49,7 +51,7 @@ jobs: - name: Run pipeline with test data run: | - nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test_profile}},${{ matrix.profile }} + nextflow run pgscatalog/pgsc_calc -r ${{ steps.extract_branch.outputs.branch }} -profile ${{ matrix.test_profile}},${{ matrix.profile }} singularity: if: ${{ inputs.singularity }} @@ -62,9 +64,11 @@ jobs: nxf_ver: ['22.10.0', 'latest'] steps: - - name: Check out pipeline code - uses: actions/checkout@v3 - + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch + - uses: nf-core/setup-nextflow@v1 with: version: ${{ matrix.nxf_ver }} @@ -90,4 +94,4 @@ jobs: - name: Run pipeline with test data run: | - nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test_profile}},${{ matrix.profile }} + nextflow run pgscatalog/pgsc_calc -r ${{ steps.extract_branch.outputs.branch }} -profile ${{ matrix.test_profile}},${{ matrix.profile }} diff --git a/conf/modules.config b/conf/modules.config index 44f08be0..3bb330aa 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -61,9 +61,9 @@ process { withLabel: report { ext.conda = "$projectDir/environments/report/environment.yml" ext.singularity = 'oras://dockerhub.ebi.ac.uk/gdp-public/pgsc_calc/singularity/report' - ext.singularity_version = ':dev' + ext.singularity_version = ':2.0' ext.docker = 'dockerhub.ebi.ac.uk/gdp-public/pgsc_calc/report' - ext.docker_version = ':dev' + ext.docker_version = ':2.0' } withLabel: pyyaml { diff --git a/conf/test.config b/conf/test.config index b14446eb..4ebee4d6 100644 --- a/conf/test.config +++ b/conf/test.config @@ -19,9 +19,13 @@ params { max_memory = '6.GB' max_time = '6.h' - input = "$projectDir/assets/examples/samplesheet.csv" - scorefile = "$projectDir/assets/examples/scorefiles/PGS001229_22.txt" + input = "https://gitlab.ebi.ac.uk/nebfield/test-datasets/-/raw/master/pgsc_calc/input_v2.json" + format = "json" + scorefile = "https://gitlab.ebi.ac.uk/nebfield/test-datasets/-/raw/master/pgsc_calc/PGS001229_22.txt" + + // TODO: fix local tests with CSV + // input = "$projectDir/assets/examples/samplesheet.csv" + // scorefile = "$projectDir/assets/examples/scorefiles/PGS001229_22.txt" outdir = "$projectDir/results" target_build = "GRCh37" - skip_ancestry = true } diff --git a/conf/test_json.config b/conf/test_json.config index 9cb99fc5..a8eba801 100644 --- a/conf/test_json.config +++ b/conf/test_json.config @@ -12,5 +12,4 @@ params { scorefile = "https://gitlab.ebi.ac.uk/nebfield/test-datasets/-/raw/master/pgsc_calc/PGS001229_22.txt" outdir = "$projectDir/results" target_build = "GRCh37" - skip_ancestry = true } diff --git a/docs/changelog.rst b/docs/changelog.rst index 3a2b232c..29ba8192 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,8 +8,17 @@ will only occur in major versions with changes noted in this changelog. .. _`semantic versioning`: https://semver.org/ +pgsc_calc v2.0.0-alpha.1 (2023-08-11) +------------------------------------- + +This patch fixes a bug when running the workflow directly from github with the +test profile (i.e. without cloning first). Thanks to `@staedlern`_ for reporting the +problem. + +.. _`@staedlern`: https://github.com/PGScatalog/pgsc_calc/issues/151 + pgsc_calc v2.0.0-alpha (2023-08-08) ------------------------------ +----------------------------------- This major release features breaking changes to samplesheet structure to provide more flexible support for extra genomic file types in the future. Two major new diff --git a/tests/ancestry/test.yml b/tests/ancestry/test.yml index 43d46f3d..b31c2e81 100644 --- a/tests/ancestry/test.yml +++ b/tests/ancestry/test.yml @@ -12,7 +12,8 @@ --target_build GRCh38 \ --pgs_id PGS001229 \ --min_overlap 0.50 \ - --target_build GRCh38 + --target_build GRCh38 \ + --scorefile false " tags: - ancestry diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index cddb2151..3c530d3c 100644 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -46,7 +46,7 @@ if ("$PROFILE" == "singularity") { conda { createTimeout = "120 min" } // Load test_data.config containing paths to test data -// includeConfig 'test_data.config' +includeConfig 'test_data.config' manifest { nextflowVersion = '!>=21.10.3' diff --git a/tests/config/test_data.config b/tests/config/test_data.config new file mode 100644 index 00000000..ec71e199 --- /dev/null +++ b/tests/config/test_data.config @@ -0,0 +1,5 @@ +params { + input = "$projectDir/assets/examples/samplesheet.csv" + scorefile = "$projectDir/assets/examples/scorefiles/PGS001229_22.txt" + target_build = "GRCh37" + } \ No newline at end of file diff --git a/tests/modules/combine/test.yml b/tests/modules/combine/test.yml index 90f0b76a..4dd6db13 100644 --- a/tests/modules/combine/test.yml +++ b/tests/modules/combine/test.yml @@ -1,5 +1,5 @@ - name: test combine scorefiles module - command: nextflow run ./tests/modules/combine -entry testcombine -c ./tests/config/nextflow.config -profile test --target_build GRCh38 + command: nextflow run ./tests/modules/combine -entry testcombine -c ./tests/config/nextflow.config --target_build GRCh38 tags: - module - combine diff --git a/tests/modules/download/test.yml b/tests/modules/download/test.yml index 90808365..df20d4cc 100644 --- a/tests/modules/download/test.yml +++ b/tests/modules/download/test.yml @@ -1,5 +1,5 @@ - name: pgscatalog test --pgs_id - command: nextflow run ./tests/modules/download -entry testaccession -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/download -entry testaccession -c ./tests/config/nextflow.config tags: - module - download @@ -11,7 +11,7 @@ - "pgscatalog_utils: 0.4.0" - name: pgscatalog test --efo_trait --pgp_id and --pgs_id - command: nextflow run ./tests/modules/download -entry testmultipleaccessions -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/download -entry testmultipleaccessions -c ./tests/config/nextflow.config tags: - module - download @@ -27,7 +27,7 @@ - "pgscatalog_utils: 0.4.0" - name: pgscatalog test bad accession - command: nextflow run ./tests/modules/download -entry testbadaccession -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/download -entry testbadaccession -c ./tests/config/nextflow.config tags: - module - download @@ -35,7 +35,7 @@ exit_code: 1 - name: pgscatalog test good and bad accessions GRCh38 - command: nextflow run ./tests/modules/download -entry testmixedaccessions -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/download -entry testmixedaccessions -c ./tests/config/nextflow.config tags: - module - download diff --git a/tests/modules/match/test.yml b/tests/modules/match/test.yml index 3215e5ab..27419bcc 100644 --- a/tests/modules/match/test.yml +++ b/tests/modules/match/test.yml @@ -1,6 +1,6 @@ # IPC files aren't published so can't test - name: test match module - command: nextflow run ./tests/modules/match -entry testmatch -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/match -entry testmatch -c ./tests/config/nextflow.config tags: - module - match @@ -11,7 +11,7 @@ - "pgscatalog_utils: 0.4.0" - name: test match combine module - command: nextflow run ./tests/modules/match -entry testmatchcombine -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/match -entry testmatchcombine -c ./tests/config/nextflow.config tags: - module - match diff --git a/tests/modules/plink2/relabelbim/test.yml b/tests/modules/plink2/relabelbim/test.yml index 981da6de..cd6bbab4 100644 --- a/tests/modules/plink2/relabelbim/test.yml +++ b/tests/modules/plink2/relabelbim/test.yml @@ -1,5 +1,5 @@ - name: plink2 testrelabelbim - command: nextflow run ./tests/modules/plink2/relabelbim -entry testrelabelbim -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/plink2/relabelbim -entry testrelabelbim -c ./tests/config/nextflow.config tags: - plink2 - fast diff --git a/tests/modules/plink2/relabelpvar/test.yml b/tests/modules/plink2/relabelpvar/test.yml index df9d72b7..a13895cc 100644 --- a/tests/modules/plink2/relabelpvar/test.yml +++ b/tests/modules/plink2/relabelpvar/test.yml @@ -1,5 +1,5 @@ - name: plink2 testrelabelpvar - command: nextflow run ./tests/modules/plink2/relabelpvar -entry testrelabelpvar -c ./tests/config/nextflow.config -profile test --vzs + command: nextflow run ./tests/modules/plink2/relabelpvar -entry testrelabelpvar -c ./tests/config/nextflow.config tags: - plink2 - fast @@ -12,5 +12,4 @@ - path: output/plink2/GRCh37_test_22.pvar.zst - path: output/plink2/versions.yml contains: - - "plink2: 2.00a3.3" - + - "plink2: 2.00a3.3" diff --git a/tests/modules/plink2/score/test.yml b/tests/modules/plink2/score/test.yml index ca17117a..4dddd189 100644 --- a/tests/modules/plink2/score/test.yml +++ b/tests/modules/plink2/score/test.yml @@ -1,5 +1,5 @@ - name: plink2 testscore - command: nextflow run ./tests/modules/plink2/score -entry testscore -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/plink2/score -entry testscore -c ./tests/config/nextflow.config tags: - module - score @@ -18,7 +18,7 @@ - "plink2: 2.00a3.3" - name: plink2 testsmallscore - command: nextflow run ./tests/modules/plink2/score -entry testsmallscore -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/plink2/score -entry testsmallscore -c ./tests/config/nextflow.config tags: - module - score @@ -37,7 +37,7 @@ - "plink2: 2.00a3.3" - name: plink2 testmultiscore - command: nextflow run ./tests/modules/plink2/score -entry testmultiscore -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/plink2/score -entry testmultiscore -c ./tests/config/nextflow.config tags: - module - score @@ -58,7 +58,7 @@ - "plink2: 2.00a3.3" - name: plink2 testsmallmultiscore - command: nextflow run ./tests/modules/plink2/score -entry testsmallmultiscore -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/plink2/score -entry testsmallmultiscore -c ./tests/config/nextflow.config tags: - module - score @@ -79,7 +79,7 @@ - "plink2: 2.00a3.3" - name: plink2 testmultiscorefail - command: nextflow run ./tests/modules/plink2/score -entry testmultiscorefail -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/plink2/score -entry testmultiscorefail -c ./tests/config/nextflow.config tags: - module - score diff --git a/tests/modules/plink2/vcf/test.yml b/tests/modules/plink2/vcf/test.yml index e3305d84..7174a174 100644 --- a/tests/modules/plink2/vcf/test.yml +++ b/tests/modules/plink2/vcf/test.yml @@ -1,5 +1,5 @@ - name: plink2 vcf - command: nextflow run ./tests/modules/plink2/vcf -entry testvcf -c ./tests/config/nextflow.config -profile test + command: nextflow run ./tests/modules/plink2/vcf -entry testvcf -c ./tests/config/nextflow.config tags: - module - plink2 diff --git a/tests/subworkflows/test_apply_score.yml b/tests/subworkflows/test_apply_score.yml index 770573f3..5d930910 100644 --- a/tests/subworkflows/test_apply_score.yml +++ b/tests/subworkflows/test_apply_score.yml @@ -1,6 +1,6 @@ # get a scores with two columns in output (test profile + PGS001229) for custom test - name: test apply score subworkflow - command: nextflow run main.nf -profile test --only_score -c ./tests/config/nextflow.config --pgs_id PGS001229 --min_overlap 0 + command: nextflow run main.nf --only_score -c ./tests/config/nextflow.config --pgs_id PGS001229 --min_overlap 0 tags: - applyscore - subworkflow @@ -14,9 +14,8 @@ - path: output/plink2/cineca_22_additive_0.sscore.vars - path: output/score/aggregated_scores.txt.gz -# TODO: fix overlap -> 1 in pgscatalog_utils - name: test perfect apply score - command: nextflow run main.nf -profile test --only_score -c ./tests/config/nextflow.config --scorefile ./tests/subworkflows/perfect.txt + command: nextflow run main.nf --only_score -c ./tests/config/nextflow.config --scorefile ./tests/subworkflows/perfect.txt tags: - applyscore - subworkflow diff --git a/tests/subworkflows/test_input_subworkflow.yml b/tests/subworkflows/test_input_subworkflow.yml index bc42349d..8de7d0cf 100644 --- a/tests/subworkflows/test_input_subworkflow.yml +++ b/tests/subworkflows/test_input_subworkflow.yml @@ -1,5 +1,5 @@ - name: test input check subworkflow - command: nextflow run main.nf -profile test --only_input -c ./tests/config/nextflow.config + command: nextflow run main.nf --only_input -c ./tests/config/nextflow.config tags: - inputcheck - subworkflow @@ -9,7 +9,7 @@ - path: output/combine/scorefiles.txt.gz - name: test input check subworkflow with PGS catalog API - command: nextflow run main.nf -profile test --pgs_id PGS001229 --only_input -c ./tests/config/nextflow.config + command: nextflow run main.nf --pgs_id PGS001229 --only_input -c ./tests/config/nextflow.config tags: - inputcheck - subworkflow @@ -20,7 +20,7 @@ - path: output/combine/scorefiles.txt.gz - name: test input check subworkflow with PGS catalog API and whitespace - command: nextflow run main.nf -profile test --pgs_id "PGS001229, PGS000802" --only_input -c ./tests/config/nextflow.config + command: nextflow run main.nf --pgs_id "PGS001229, PGS000802" --only_input -c ./tests/config/nextflow.config tags: - inputcheck - subworkflow diff --git a/tests/subworkflows/test_liftover_run.yml b/tests/subworkflows/test_liftover_run.yml index 527b9121..800087f0 100644 --- a/tests/subworkflows/test_liftover_run.yml +++ b/tests/subworkflows/test_liftover_run.yml @@ -1,5 +1,5 @@ - name: test input check subworkflow with liftover 38to37 - command: nextflow run main.nf -profile test --only_input --pgs_id PGS000193 --liftover --target_build GRCh37 -c ./tests/config/nextflow.config --hg19_chain https://hgdownload.cse.ucsc.edu/goldenpath/hg19/liftOver/hg19ToHg38.over.chain.gz --hg38_chain https://hgdownload.soe.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz + command: nextflow run main.nf --only_input --pgs_id PGS000193 --liftover --target_build GRCh37 -c ./tests/config/nextflow.config --hg19_chain https://hgdownload.cse.ucsc.edu/goldenpath/hg19/liftOver/hg19ToHg38.over.chain.gz --hg38_chain https://hgdownload.soe.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz tags: - liftover - subworkflow @@ -12,7 +12,7 @@ - "pgscatalog_utils: 0.4.0" - name: test input check subworkflow with liftover 37to38 - command: nextflow run main.nf -profile test --only_input --pgs_id PGS001229 --liftover --target_build GRCh38 -c ./tests/config/nextflow.config --hg19_chain https://hgdownload.cse.ucsc.edu/goldenpath/hg19/liftOver/hg19ToHg38.over.chain.gz --hg38_chain https://hgdownload.soe.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz + command: nextflow run main.nf --only_input --pgs_id PGS001229 --liftover --target_build GRCh38 -c ./tests/config/nextflow.config --hg19_chain https://hgdownload.cse.ucsc.edu/goldenpath/hg19/liftOver/hg19ToHg38.over.chain.gz --hg38_chain https://hgdownload.soe.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz tags: - liftover - subworkflow diff --git a/tests/subworkflows/test_make_compatible.yml b/tests/subworkflows/test_make_compatible.yml index ebef9a24..caa68411 100644 --- a/tests/subworkflows/test_make_compatible.yml +++ b/tests/subworkflows/test_make_compatible.yml @@ -1,5 +1,5 @@ - name: test make compatible subworkflow with bfile - command: nextflow run main.nf -profile test --input ./assets/examples/samplesheet_bfile.csv --only_compatible -c ./tests/config/nextflow.config + command: nextflow run main.nf --input ./assets/examples/samplesheet_bfile.csv --only_compatible -c ./tests/config/nextflow.config tags: - makecompatible - subworkflow @@ -13,7 +13,7 @@ - path: output/plink2/GRCh37_cineca_22.vmiss.gz - name: test make compatible subworkflow with vcf - command: nextflow run main.nf -profile test --input ./assets/examples/samplesheet_vcf.csv --only_compatible -c ./tests/config/nextflow.config + command: nextflow run main.nf --input ./assets/examples/samplesheet_vcf.csv --only_compatible -c ./tests/config/nextflow.config tags: - makecompatible - subworkflow @@ -27,7 +27,7 @@ - path: output/plink2/GRCh37_vcf_22.vmiss.gz - name: test make compatible subworkflow with pfile - command: nextflow run main.nf -profile test --only_compatible -c ./tests/config/nextflow.config + command: nextflow run main.nf --only_compatible -c ./tests/config/nextflow.config tags: - makecompatible - subworkflow diff --git a/tests/subworkflows/test_match.yml b/tests/subworkflows/test_match.yml index c7ae96ab..3619ddc7 100644 --- a/tests/subworkflows/test_match.yml +++ b/tests/subworkflows/test_match.yml @@ -1,5 +1,5 @@ - name: test match subworkflow - command: nextflow run main.nf -profile test --only_match -c ./tests/config/nextflow.config + command: nextflow run main.nf --only_match -c ./tests/config/nextflow.config tags: - match - subworkflow