Skip to content

Commit

Permalink
Merge pull request #71 from Plant-Food-Research-Open/add/nftest
Browse files Browse the repository at this point in the history
Integrated nf-test into pipeline CI
  • Loading branch information
GallVp authored Oct 22, 2024
2 parents e57be23 + 97ed70e commit 35f6d64
Show file tree
Hide file tree
Showing 78 changed files with 3,531 additions and 181 deletions.
10 changes: 10 additions & 0 deletions .github/include.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
".":
- ./.github/workflows/**
- ./nf-test.config
tests:
- ./assets/*
- ./bin/*
- ./conf/*
- ./main.nf
- ./nextflow_schema.json
- ./nextflow.config
89 changes: 70 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,96 @@ on:

env:
NXF_ANSI_LOG: false
NFT_WORKDIR: "nf-test-work"
NFT_DIFF: "pdiff"
NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2"

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

jobs:
nf-test-changes:
name: Check for changes
runs-on: ubuntu-latest
outputs:
nf_test_files: ${{ steps.list.outputs.components }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0

- name: List nf-test files
id: list
uses: adamrtalbot/[email protected]
with:
head: ${{ github.sha }}
base: origin/${{ github.base_ref }}
include: .github/include.yaml

- name: print list of nf-test files
run: |
echo ${{ steps.list.outputs.components }}
test:
name: Run pipeline with test data
name: ${{ matrix.nf_test_files }} ${{ matrix.profile }} NF-${{ matrix.NXF_VER }}
needs: [nf-test-changes]
if: needs.nf-test-changes.outputs.nf_test_files != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
NXF_VER:
- "24.04.2"
TEST_PARAMS:
- minimal
- short
- nonmasked
- stub
OPTION_STUB:
- "-stub"

nf_test_files: ["${{ fromJson(needs.nf-test-changes.outputs.nf_test_files) }}"]
profile:
- "docker"

steps:
- name: Check out pipeline code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
uses: actions/checkout@v4.2.1

- name: Install Nextflow
uses: nf-core/setup-nextflow@v2
with:
version: "${{ matrix.NXF_VER }}"

- uses: actions/[email protected]
with:
python-version: "3.11"
architecture: "x64"

- name: Install pdiff to see diff between nf-test snapshots
run: |
python -m pip install --upgrade pip
pip install pdiff
- uses: nf-core/[email protected]
with:
version: 0.9.0

- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
if: matrix.nf_test_files == 'tests/stub/main.nf.test'
uses: jlumbroso/[email protected]

- name: Run nf-test
run: |
nf-test test --verbose ${{ matrix.nf_test_files }} --profile "+${{ matrix.profile }}"
confirm-pass:
runs-on: ubuntu-latest
needs: [test]
if: always()
steps:
- name: All tests ok
if: ${{ !contains(needs.*.result, 'failure') }}
run: exit 0
- name: One or more tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

- name: Run pipeline with test data
- name: debug-print
if: always()
run: |
nextflow run \
${GITHUB_WORKSPACE} \
-profile test,docker \
-params-file \
./tests/${{ matrix.TEST_PARAMS }}/params.json \
${{ matrix.OPTION_STUB }} \
--outdir ./results
echo "toJSON(needs) = ${{ toJSON(needs) }}"
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.5.0dev - [16-Oct-2024]
## v0.5.0dev - [22-Oct-2024]

### `Added`

1. Added MultiQC [#65](https://github.com/plant-food-research-open/genepal/issues/65)
2. Updated nf-core template to 3.0.2 [#66](https://github.com/PlantandFoodResearch/genepal/issues/66)
3. Integrated nf-test into pipeline CI [#68](https://github.com/PlantandFoodResearch/genepal/issues/68)

### `Fixed`

1. Now using `${meta.id}_trim` as prefix for `FASTQC` files
2. Added `monochromeLogs` parameter to suppress warnings
3. Updated citations to include DOIs
4. Fixed a bug where FASTQ versions were not correctly captured.

### `Dependencies`

Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,30 +92,34 @@ The pipeline uses nf-core modules contributed by following authors:

<a href="https://github.com/gallvp"><img src="https://github.com/gallvp.png" width="50" height="50"></a>
<a href="https://github.com/drpatelh"><img src="https://github.com/drpatelh.png" width="50" height="50"></a>
<a href="https://github.com/jfy133"><img src="https://github.com/jfy133.png" width="50" height="50"></a>
<a href="https://github.com/joseespinosa"><img src="https://github.com/joseespinosa.png" width="50" height="50"></a>
<a href="https://github.com/kevinmenden"><img src="https://github.com/kevinmenden.png" width="50" height="50"></a>
<a href="https://github.com/adamrtalbot"><img src="https://github.com/adamrtalbot.png" width="50" height="50"></a>
<a href="https://github.com/toniher"><img src="https://github.com/toniher.png" width="50" height="50"></a>
<a href="https://github.com/joseespinosa"><img src="https://github.com/joseespinosa.png" width="50" height="50"></a>
<a href="https://github.com/matthdsm"><img src="https://github.com/matthdsm.png" width="50" height="50"></a>
<a href="https://github.com/grst"><img src="https://github.com/grst.png" width="50" height="50"></a>
<a href="https://github.com/friederikehanssen"><img src="https://github.com/friederikehanssen.png" width="50" height="50"></a>
<a href="https://github.com/erikrikarddaniel"><img src="https://github.com/erikrikarddaniel.png" width="50" height="50"></a>
<a href="https://github.com/edmundmiller"><img src="https://github.com/edmundmiller.png" width="50" height="50"></a>
<a href="https://github.com/maxulysse"><img src="https://github.com/maxulysse.png" width="50" height="50"></a>
<a href="https://github.com/kherronism"><img src="https://github.com/kherronism.png" width="50" height="50"></a>
<a href="https://github.com/adamrtalbot"><img src="https://github.com/adamrtalbot.png" width="50" height="50"></a>
<a href="https://github.com/vagkaratzas"><img src="https://github.com/vagkaratzas.png" width="50" height="50"></a>
<a href="https://github.com/kherronism"><img src="https://github.com/kherronism.png" width="50" height="50"></a>
<a href="https://github.com/spficklin"><img src="https://github.com/spficklin.png" width="50" height="50"></a>
<a href="https://github.com/robsyme"><img src="https://github.com/robsyme.png" width="50" height="50"></a>
<a href="https://github.com/priyanka-surana"><img src="https://github.com/priyanka-surana.png" width="50" height="50"></a>
<a href="https://github.com/praveenraj2018"><img src="https://github.com/praveenraj2018.png" width="50" height="50"></a>
<a href="https://github.com/nvnieuwk"><img src="https://github.com/nvnieuwk.png" width="50" height="50"></a>
<a href="https://github.com/muffato"><img src="https://github.com/muffato.png" width="50" height="50"></a>
<a href="https://github.com/matthdsm"><img src="https://github.com/matthdsm.png" width="50" height="50"></a>
<a href="https://github.com/maxulysse"><img src="https://github.com/maxulysse.png" width="50" height="50"></a>
<a href="https://github.com/mashehu"><img src="https://github.com/mashehu.png" width="50" height="50"></a>
<a href="https://github.com/mahesh-panchal"><img src="https://github.com/mahesh-panchal.png" width="50" height="50"></a>
<a href="https://github.com/jvhagey"><img src="https://github.com/jvhagey.png" width="50" height="50"></a>
<a href="https://github.com/jfy133"><img src="https://github.com/jfy133.png" width="50" height="50"></a>
<a href="https://github.com/jemten"><img src="https://github.com/jemten.png" width="50" height="50"></a>
<a href="https://github.com/friederikehanssen"><img src="https://github.com/friederikehanssen.png" width="50" height="50"></a>
<a href="https://github.com/felixkrueger"><img src="https://github.com/felixkrueger.png" width="50" height="50"></a>
<a href="https://github.com/ewels"><img src="https://github.com/ewels.png" width="50" height="50"></a>
<a href="https://github.com/erikrikarddaniel"><img src="https://github.com/erikrikarddaniel.png" width="50" height="50"></a>
<a href="https://github.com/charles-plessy"><img src="https://github.com/charles-plessy.png" width="50" height="50"></a>
<a href="https://github.com/bunop"><img src="https://github.com/bunop.png" width="50" height="50"></a>
<a href="https://github.com/abhi18av"><img src="https://github.com/abhi18av.png" width="50" height="50"></a>

## Contributions and Support

Expand Down
4 changes: 4 additions & 0 deletions cleanNXF.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ do
rm -rf "work/$i"
done
echo "Cleaned work..."

rm -f .nf-test.log
rm -rf .nf-test
echo "Cleaned nf-test..."
10 changes: 5 additions & 5 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -361,20 +361,20 @@ process { // SUBWORKFLOW: GXF_FASTA_AGAT_SPADDINTRONS_SPEXTRACTSEQUENCES
}
}

process { // Universal
withName: AGAT_SPFILTERFEATUREFROMKILLLIST {
process { // WORKFLOW: GENEPAL
withName: '.*:GENEPAL:AGAT_SPFILTERFEATUREFROMKILLLIST' {
ext.prefix = { "${meta.id}.purged" }
}

withName: SAVE_MARKED_GFF3 {
withName: '.*:GENEPAL:SAVE_MARKED_GFF3' {
publishDir = [
path: { "${params.outdir}/etc/splicing_marked" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
]
}

withName: BENCHMARK {
withName: '.*:GENEPAL:BENCHMARK' {
publishDir = [
path: { "${params.outdir}/benchmark" },
mode: params.publish_dir_mode,
Expand All @@ -383,7 +383,7 @@ process { // Universal
]
}

withName: MULTIQC {
withName: '.*:GENEPAL:MULTIQC' {
ext.args = '--verbose'
publishDir = [
path: { "${params.outdir}" },
Expand Down
20 changes: 12 additions & 8 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@

process {
resourceLimits = [
cpus: 2,
memory: '6.GB',
cpus: 4,
memory: '15.GB',
time: '1.h'
]
}

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Input data
input = "${projectDir}/tests/minimal/assemblysheet.csv"
protein_evidence = 'https://raw.githubusercontent.com/Gaius-Augustus/BRAKER/f58479fe5bb13a9e51c3ca09cb9e137cab3b8471/example/proteins.fa'
input = "${projectDir}/tests/minimal/assemblysheet.csv"
protein_evidence = 'https://raw.githubusercontent.com/Gaius-Augustus/BRAKER/f58479fe5bb13a9e51c3ca09cb9e137cab3b8471/example/proteins.fa'

braker_extra_args = '--gm_max_intergenic 10000 --skipOptimize' // Added for faster test execution! Do not use with actual data!
busco_lineage_datasets = 'eudicots_odb10'
// Braker options for faster test execution!
// WARNING: Do not use with actual data!
braker_extra_args = '--gm_max_intergenic 10000 --skipOptimize'

// Skip BUSCO for faster test execution!
busco_skip = true
}
12 changes: 8 additions & 4 deletions conf/test_full.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ params {
config_profile_description = 'Full test dataset to check pipeline function'

// Input data
input = "${projectDir}/tests/minimal/assemblysheet.csv"
protein_evidence = 'https://raw.githubusercontent.com/Gaius-Augustus/BRAKER/f58479fe5bb13a9e51c3ca09cb9e137cab3b8471/example/proteins.fa'
input = "${projectDir}/tests/minimal/assemblysheet.csv"
protein_evidence = 'https://raw.githubusercontent.com/Gaius-Augustus/BRAKER/f58479fe5bb13a9e51c3ca09cb9e137cab3b8471/example/proteins.fa'

braker_extra_args = '--gm_max_intergenic 10000 --skipOptimize' // Added for faster test execution! Do not use with actual data!
busco_lineage_datasets = 'eudicots_odb10'
// Braker options for faster test execution!
// WARNING: Do not use with actual data!
braker_extra_args = '--gm_max_intergenic 10000 --skipOptimize' // Added for faster test execution! Do not use with actual data!

// BUSCO lineage
busco_lineage_datasets = 'eudicots_odb10'
}
37 changes: 36 additions & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["fasta_gxf_busco_plot"]
},
"cat/cat": {
"branch": "main",
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["modules"]
},
"custom/restoregffids": {
"branch": "main",
"git_sha": "a8939d36280e7d9037c7cf164eeede19e46546a4",
Expand All @@ -55,11 +60,31 @@
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["fasta_gxf_busco_plot"]
},
"gunzip": {
"branch": "main",
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["modules"]
},
"ltrfinder": {
"branch": "main",
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["modules"]
},
"ltrharvest": {
"branch": "main",
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["modules"]
},
"ltrretriever/lai": {
"branch": "main",
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["fasta_edta_lai"]
},
"ltrretriever/ltrretriever": {
"branch": "main",
"git_sha": "ae9714c21ede9199a3118e3c20b65484aa73e232",
"installed_by": ["modules"]
},
"repeatmasker/repeatmasker": {
"branch": "main",
"git_sha": "a8939d36280e7d9037c7cf164eeede19e46546a4",
Expand Down Expand Up @@ -120,6 +145,11 @@
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"diamond/makedb": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"eggnogmapper": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
Expand Down Expand Up @@ -219,14 +249,19 @@
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["fastq_fastqc_umitools_fastp"]
},
"untar": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
}
}
},
"subworkflows": {
"nf-core": {
"fastq_fastqc_umitools_fastp": {
"branch": "master",
"git_sha": "46eca555142d6e597729fcb682adcc791796f514",
"git_sha": "4026bab16a91b1b0b18d80ff465819ca725f33fd",
"installed_by": ["subworkflows"]
},
"utils_nextflow_pipeline": {
Expand Down
5 changes: 5 additions & 0 deletions modules/gallvp/cat/cat/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::pigz=2.3.4
Loading

0 comments on commit 35f6d64

Please sign in to comment.