diff --git a/.gitattributes b/.gitattributes index 7a2dabc2..c1c17000 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ *.config linguist-language=nextflow *.nf.test linguist-language=nextflow +tests/**/*nf.test.snap linguist-generated modules/nf-core/** linguist-generated subworkflows/nf-core/** linguist-generated diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07d7ab5b..b9a5297e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,76 +1,106 @@ -name: nf-core CI # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors +name: nf-core CI on: push: branches: - - dev + - "dev" pull_request: + branches: + - "dev" + - "master" release: - types: [published] + types: + - "published" env: NXF_ANSI_LOG: false + NFTEST_VER: "0.7.3" concurrency: - group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: + define_nxf_versions: + name: Choose nextflow versions to test against depending on target branch + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.nxf_versions.outputs.matrix }} + steps: + - id: nxf_versions + run: | + if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then + echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT + else + echo matrix='["latest-everything", "22.10.1"]' | tee -a $GITHUB_OUTPUT + fi + test: - name: Run pipeline with test data - # Only run on push if this is the nf-core dev branch (merged PRs) - if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/ampliseq') }}" + name: nf-test + needs: define_nxf_versions runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - NXF_VER: - - "22.10.1" - - "latest-everything" + NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }} + tags: + - "test" + - "test_single" + - "test_fasta" + - "test_multi" + - "test_reftaxcustom" + - "test_doubleprimers" + - "test_iontorrent" + - "test_novaseq" + - "test_pacbio_its" + - "test_sintax" + - "test_pplace" + profile: + - "docker" + steps: - name: Check out pipeline code uses: actions/checkout@v3 + - name: Check out test data + uses: actions/checkout@v3 + with: + repository: nf-core/test-datasets + ref: ampliseq + path: test-datasets/ + fetch-depth: 1 + + - name: Replace remote paths in samplesheets + run: | + for f in ${{ github.workspace }}/test-datasets/samplesheets/*.tsv; do + sed -i "s=https://github.com/nf-core/test-datasets/raw/ampliseq/testdata/=${{ github.workspace }}/test-datasets/=g" $f + echo "========== $f ============" + cat $f + echo "========================================" + done; + - name: Install Nextflow uses: nf-core/setup-nextflow@v1 with: version: "${{ matrix.NXF_VER }}" - - name: Run pipeline with test data + - name: Install nf-test run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results + wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER + sudo mv nf-test /usr/local/bin/ - profiles: - name: Run workflow profile - # Only run on push if this is the nf-core dev branch (merged PRs) - if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/ampliseq') }} - runs-on: ubuntu-latest - strategy: - matrix: - # Run remaining test profiles with minimum nextflow version - profile: - [ - test_multi, - test_pacbio_its, - test_doubleprimers, - test_iontorrent, - test_single, - test_fasta, - test_reftaxcustom, - test_novaseq, - test_pplace, - test_sintax, - ] - steps: - - name: Check out pipeline code - uses: actions/checkout@v2 - - - name: Install Nextflow + - name: Run nf-test run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + nf-test test --tag ${{ matrix.tags }} --profile ${{ matrix.tags }},${{ matrix.profile }} --junitxml=test.xml - - name: Run pipeline with ${{ matrix.profile }} test profile + - name: Output log on failure + if: failure() run: | - nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.profile }},docker --outdir ./results + sudo apt install bat > /dev/null + batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/output/pipeline_info/software_versions.yml -# + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: "*.xml" diff --git a/.gitignore b/.gitignore index 28a3c214..3d8181e6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ testing* .screenrc ampliseq.Rproj results_test/* +.nf-test/ +nf-test diff --git a/.nf-core.yml b/.nf-core.yml index 7ca12279..92b7f03b 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,5 +1,7 @@ repository_type: pipeline - lint: + files_unchanged: + - .gitattributes files_exist: - conf/igenomes.config + actions_ci: False diff --git a/CHANGELOG.md b/CHANGELOG.md index 217cf896..a7c3f3a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` +- [#580](https://github.com/nf-core/ampliseq/pull/580) - Add NF-TEST pipeline end-to-end tests for existing CI tests - [#591](https://github.com/nf-core/ampliseq/pull/591) - New version of the Unite taxonomy databases: 9.0 - [#564](https://github.com/nf-core/ampliseq/pull/564),[#567](https://github.com/nf-core/ampliseq/pull/567),[#582](https://github.com/nf-core/ampliseq/pull/582) - Added phylogenetic placement - [#577](https://github.com/nf-core/ampliseq/pull/577) - Added SINTAX for taxonomic classification @@ -15,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Changed` +- [#580](https://github.com/nf-core/ampliseq/pull/580) - GitHub Actions CI - pull_request to `dev` tests with NXF_VER `latest-everything` & pull_request to `master` tests with NXF_VER `22.10.1` & `latest-everything` - [#563](https://github.com/nf-core/ampliseq/pull/563) - Renamed DADA2 taxonomic classification files to include the chosen reference taxonomy abbreviation. - [#567](https://github.com/nf-core/ampliseq/pull/567) - Renamed `--dada_tax_agglom_min` and `--qiime_tax_agglom_min` to `--tax_agglom_min` and `--dada_tax_agglom_max` and `--qiime_tax_agglom_max` to `--tax_agglom_max` - [#598](https://github.com/nf-core/ampliseq/pull/598) - Updated Workflow figure with SINTAX and phylogenetic placement diff --git a/nf-test.config b/nf-test.config new file mode 100644 index 00000000..cd432d43 --- /dev/null +++ b/nf-test.config @@ -0,0 +1,16 @@ +config { + // location for all nf-tests + testsDir "tests" + + // nf-test directory including temporary files for each test + workDir ".nf-test" + + // location of library folder that is added automatically to the classpath + libDir "tests/pipeline/lib/" + + // location of an optional nextflow.config file specific for executing tests + configFile "nextflow.config" + + // run all test with the defined docker profile from the main nextflow.config + profile "" +} diff --git a/tests/pipeline/doubleprimers.nf.test b/tests/pipeline/doubleprimers.nf.test new file mode 100644 index 00000000..cd810025 --- /dev/null +++ b/tests/pipeline/doubleprimers.nf.test @@ -0,0 +1,40 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_doubleprimers" + tag "pipeline" + + test("Double-Primers") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() }, + { assert new File("$outputDir/qiime2/input/table.qza").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet_double_primer.tsv")).match("input") }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") } + ) + } + } +} diff --git a/tests/pipeline/doubleprimers.nf.test.snap b/tests/pipeline/doubleprimers.nf.test.snap new file mode 100644 index 00000000..399cc657 --- /dev/null +++ b/tests/pipeline/doubleprimers.nf.test.snap @@ -0,0 +1,52 @@ +{ + "input": { + "content": [ + "Samplesheet_double_primer.tsv:md5,cd63754fefa6e844a758efb893660f97" + ], + "timestamp": "2023-05-28T21:08:54+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,ba0452e3edde6300fd111ad0e5b8e206" + ], + "timestamp": "2023-05-28T21:08:54+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, QIIME2_INSEQ={qiime2=2022.11.1}, RENAME_RAW_DATA_FILES={sed=4.7}, TRUNCLEN={pandas=1.1.5, python=3.9.1}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-05-28T21:08:54+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,f0dd8c3dc3f45b84a1e32f88aabe7d08" + ], + "timestamp": "2023-05-28T21:08:54+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,bde6052256e9994a8ba6d4dd45d992e3", + "ASV_table.tsv:md5,223eb043a32a1ce932e2e515c00125e6", + "DADA2_stats.tsv:md5,89a8bbd8f229ba75268098078fb254de", + "DADA2_table.rds:md5,e527269819e4056eed063dca9f25e3e7", + "DADA2_table.tsv:md5,d30d5d392665181abddcf8ba5bdda102" + ], + "timestamp": "2023-05-28T21:08:54+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,fbe6bb4c5527c0099577af622e35af67", + "rrna.bac.gff:md5,05ddde74c06bb7377f2087a90e3ee1c3", + "rrna.euk.gff:md5,df19e1b84ba6f691d20c72b397c88abf", + "rrna.mito.gff:md5,04be33c4213eb82f66cf0652fe9e32d8" + ], + "timestamp": "2023-05-28T21:08:54+0000" + }, + "multiqc": { + "content": [ + "multiqc_general_stats.txt:md5,8429be0a16adf09b6634bf31b430bfac", + "multiqc_cutadapt.txt:md5,e89359b4478ef5d10620709f651f26a2" + ], + "timestamp": "2023-05-28T21:08:54+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/fasta.nf.test b/tests/pipeline/fasta.nf.test new file mode 100644 index 00000000..9daca857 --- /dev/null +++ b/tests/pipeline/fasta.nf.test @@ -0,0 +1,32 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_fasta" + tag "pipeline" + + test("Fasta Input") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/dada2/ref_taxonomy.rdp_18.txt")).match("dada2") }, + { assert new File("$outputDir/dada2/ASV_tax_species.rdp_18.tsv").exists() }, + { assert new File("$outputDir/dada2/ASV_tax.rdp_18.tsv").exists() }, + { assert snapshot(path("$outputDir/input/ASV_seqs.fasta")).match("input") } + ) + } + } +} diff --git a/tests/pipeline/fasta.nf.test.snap b/tests/pipeline/fasta.nf.test.snap new file mode 100644 index 00000000..aef19720 --- /dev/null +++ b/tests/pipeline/fasta.nf.test.snap @@ -0,0 +1,29 @@ +{ + "input": { + "content": [ + "ASV_seqs.fasta:md5,39b0d4ad96b37fa68d4ee5c21b667fed" + ], + "timestamp": "2023-05-28T21:06:17+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, DADA2_TAXONOMY={R=4.1.1, dada2=1.22.0}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-05-28T21:06:17+0000" + }, + "dada2": { + "content": [ + "ref_taxonomy.rdp_18.txt:md5,815c4fce9f3d1de019fb995a43fb66ed" + ], + "timestamp": "2023-05-28T21:06:17+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,6dae470aace9293d5eb8c318584852dd", + "rrna.bac.gff:md5,439a9084f089120f700f938dfb58fa41", + "rrna.euk.gff:md5,c9bc1d9d8fb77dc19c95dee2d53840eb", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-05-28T21:06:17+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/iontorrent.nf.test b/tests/pipeline/iontorrent.nf.test new file mode 100644 index 00000000..9b73af86 --- /dev/null +++ b/tests/pipeline/iontorrent.nf.test @@ -0,0 +1,45 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_iontorrent" + tag "pipeline" + + test("Paired-End Ion Torrent") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/ref_taxonomy.unite-fungi_8_3.txt"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/dada2/ASV_tax.unite-fungi_8_3.tsv").exists() }, + { assert new File("$outputDir/dada2/ASV_tax_species.unite-fungi_8_3.tsv").exists() }, + { assert new File("$outputDir/fastqc/it1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/it2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/it3_fastqc.html").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet_it_SE_ITS.tsv")).match("input") }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") } + ) + } + } +} diff --git a/tests/pipeline/iontorrent.nf.test.snap b/tests/pipeline/iontorrent.nf.test.snap new file mode 100644 index 00000000..5d7c832b --- /dev/null +++ b/tests/pipeline/iontorrent.nf.test.snap @@ -0,0 +1,54 @@ +{ + "input": { + "content": [ + "Samplesheet_it_SE_ITS.tsv:md5,929870dea597430aaeee2a52283b427f" + ], + "timestamp": "2023-06-20T01:42:35+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,ee0bc82cf4798b0c2f599ba105314f86" + ], + "timestamp": "2023-06-20T01:42:35+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, DADA2_TAXONOMY={R=4.1.1, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, RENAME_RAW_DATA_FILES={sed=4.7}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-06-20T01:42:35+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,a7d1d93ad079ec0ea2479126dba0a607" + ], + "timestamp": "2023-06-20T01:42:35+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,24a69ad674c0b99882d095f6e8afdc03", + "ASV_table.tsv:md5,bd99a0696aa853c0d12c2870ec9fb987", + "DADA2_stats.tsv:md5,f543f7445bbb3941138166615fcf4866", + "ref_taxonomy.unite-fungi_8_3.txt:md5,0f0f24c6c937cfe315f7f490ecdf9af4", + "DADA2_table.rds:md5,bbbe293f2e03869cbe6b8f6b15ea0ed8", + "DADA2_table.tsv:md5,d92684c4ac57c34341171f1dffccb4d6" + ], + "timestamp": "2023-06-20T01:42:35+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,df19e1b84ba6f691d20c72b397c88abf", + "rrna.bac.gff:md5,df19e1b84ba6f691d20c72b397c88abf", + "rrna.euk.gff:md5,df19e1b84ba6f691d20c72b397c88abf", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-06-20T01:42:35+0000" + }, + "multiqc": { + "content": [ + "multiqc_fastqc.txt:md5,a64a5b74f7f336909d706a5747ad596d", + "multiqc_general_stats.txt:md5,e50f532aa2a52a79a2f76b66f970771c", + "multiqc_cutadapt.txt:md5,9315dca2bd7b5476e54a9ccd8b1f24d5" + ], + "timestamp": "2023-06-20T01:42:35+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/lib/UTILS.groovy b/tests/pipeline/lib/UTILS.groovy new file mode 100644 index 00000000..28c78f75 --- /dev/null +++ b/tests/pipeline/lib/UTILS.groovy @@ -0,0 +1,38 @@ +// Helper functions for pipeline tests + +class UTILS { + + // Function to remove Nextflow version from software_versions.yml + public static String removeNextflowVersion(outputDir) { + def softwareVersions = path("$outputDir/pipeline_info/software_versions.yml").yaml + if (softwareVersions.containsKey("Workflow")) { + softwareVersions.Workflow.remove("Nextflow") + } + return softwareVersions + } + + // Function to filter lines from a file and return a new file + public static File filterLines(String inFilePath, int linesToSkip) { + if (linesToSkip >= 0) { + File inputFile = new File(inFilePath) + File outputFile = new File(inFilePath + ".filtered") + def lineCount = 0 + inputFile.eachLine { line -> + lineCount++ + if (lineCount > linesToSkip) { + outputFile.append(line + '\n') + } + } + return outputFile + } else { + File inputFile = new File(inFilePath) + File outputFile = new File(inFilePath + ".filtered") + def lines = inputFile.readLines() + def totalLines = lines.size() + lines.take(totalLines + linesToSkip).each { line -> + outputFile.append(line + '\n') + } + return outputFile + } + } +} diff --git a/tests/pipeline/multi.nf.test b/tests/pipeline/multi.nf.test new file mode 100644 index 00000000..e4fe28a0 --- /dev/null +++ b/tests/pipeline/multi.nf.test @@ -0,0 +1,70 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_multi" + tag "pipeline" + + test("Multiple Sequencing Runs") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/ref_taxonomy.rdp_18.txt"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/dada2/ASV_tax.rdp_18.tsv").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1a_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1a_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2a_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2a_2_fastqc.html").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet_multi.tsv")).match("input") }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt")).match("multiqc") }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-4.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-5.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-6.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/count_table_filter_stats.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/filtered-table.qza").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.biom").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() }, + { assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() }, + { assert new File("$outputDir/qiime2/input/table.qza").exists() }, + { assert new File("$outputDir/qiime2/input/taxonomy.qza").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-4.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-5.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-6.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-DADA2-tax.tsv").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/filtered-sequences.qza").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/rep-seq.fasta").exists() }, + { assert snapshot(path("$outputDir/qiime2/representative_sequences/descriptive_stats.tsv"), + path("$outputDir/qiime2/representative_sequences/seven_number_summary.tsv")).match("qiime2") } + ) + } + } +} diff --git a/tests/pipeline/multi.nf.test.snap b/tests/pipeline/multi.nf.test.snap new file mode 100644 index 00000000..43edd876 --- /dev/null +++ b/tests/pipeline/multi.nf.test.snap @@ -0,0 +1,54 @@ +{ + "input": { + "content": [ + "Samplesheet_multi.tsv:md5,25b97db179c42b568e28f00a1c475f78" + ], + "timestamp": "2023-05-28T21:15:03+0000" + }, + "qiime2": { + "content": [ + "descriptive_stats.tsv:md5,f6c6527f32005a005fef4d1830874a3e", + "seven_number_summary.tsv:md5,4b177ed9a865e3320953b69860a435ef" + ], + "timestamp": "2023-05-28T21:15:03+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_TAXONOMY={R=4.1.1, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, FILTER_STATS={pandas=1.1.5, python=3.9.1}, QIIME2_INSEQ={qiime2=2022.11.1}, RENAME_RAW_DATA_FILES={sed=4.7}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-05-28T21:15:03+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,cc01727705136cc5d096d373237e1e06" + ], + "timestamp": "2023-05-28T21:15:03+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,f786f2a262c3b7bf1eca475dc2c9bef6", + "ASV_table.tsv:md5,91ca9b9ab06a873033c29af4f93dfa80", + "ref_taxonomy.rdp_18.txt:md5,815c4fce9f3d1de019fb995a43fb66ed", + "DADA2_stats.tsv:md5,1413d7b7abcdd9344efe78b550112345", + "DADA2_table.rds:md5,e55f6c929176c853ac4d91123532df9c", + "DADA2_table.tsv:md5,e9d7e7dfabdd1f9d3bbaa45eba545367" + ], + "timestamp": "2023-05-28T21:15:03+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,07229e8767a6165fdc2e392d75aec74a", + "rrna.bac.gff:md5,5e2dc0da75181e69c61ad49fe877848a", + "rrna.euk.gff:md5,12cd46457b8fcf5853a6cfba39dd7c63", + "rrna.mito.gff:md5,737567148a9252d93deb529a06f3239c" + ], + "timestamp": "2023-05-28T21:15:03+0000" + }, + "multiqc": { + "content": [ + "multiqc_general_stats.txt:md5,5692ee73c6933866807706d29b15c880", + "multiqc_fastqc.txt:md5,3a4417c7d95a9bbe17751dc974157cd3" + ], + "timestamp": "2023-05-28T21:15:03+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/novaseq.nf.test b/tests/pipeline/novaseq.nf.test new file mode 100644 index 00000000..a2101d3d --- /dev/null +++ b/tests/pipeline/novaseq.nf.test @@ -0,0 +1,35 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_novaseq" + tag "pipeline" + + test("Paired-End Novaseq") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/fastqc/S1_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/S1_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/S2_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/S2_2_fastqc.html").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet_novaseq.tsv")).match("input") }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt")).match("multiqc") } + ) + } + } +} diff --git a/tests/pipeline/novaseq.nf.test.snap b/tests/pipeline/novaseq.nf.test.snap new file mode 100644 index 00000000..3a13216c --- /dev/null +++ b/tests/pipeline/novaseq.nf.test.snap @@ -0,0 +1,31 @@ +{ + "input": { + "content": [ + "Samplesheet_novaseq.tsv:md5,bcca78fe24736f4ee4ea26fdbd47ee64" + ], + "timestamp": "2023-06-20T00:10:02+0000" + }, + "software_versions": { + "content": [ + "{CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, FILTER_CODONS={pandas=1.1.5, python=3.9.1}, RENAME_RAW_DATA_FILES={sed=4.7}, TRUNCLEN={pandas=1.1.5, python=3.9.1}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-06-20T00:10:02+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,60c7cc4669df672109fce853dfa874fd", + "ASV_table.tsv:md5,db74c8b5abf372fdaed19d0bf23c91c8", + "DADA2_stats.tsv:md5,5f82ca12036dae5da84a93b6fce96c36", + "DADA2_table.rds:md5,e7cc351e115cccdeabd0d0e9e7d9045a", + "DADA2_table.tsv:md5,fba33455974dd6c07ce54a72f7147425" + ], + "timestamp": "2023-06-20T00:10:02+0000" + }, + "multiqc": { + "content": [ + "multiqc_fastqc.txt:md5,ac8744f9d5d4dc51957a719183074c2f", + "multiqc_general_stats.txt:md5,c4d6a79d9c271a72c2f6a7ef66fe39c6" + ], + "timestamp": "2023-06-20T00:10:02+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/pacbio_its.nf.test b/tests/pipeline/pacbio_its.nf.test new file mode 100644 index 00000000..39e1d2a2 --- /dev/null +++ b/tests/pipeline/pacbio_its.nf.test @@ -0,0 +1,59 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_pacbio_its" + tag "pipeline" + + test("Paired-End Pacbio ITS") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/assignsh/ASV_tax_species_SH.unite-fungi_8_3.tsv")).match("assignsh") }, + { assert new File("$outputDir/assignsh/ASV_ITS_tax.vsearch.txt").exists() }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert new File("$outputDir/cutadapt/pb1.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/pb2.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/pb3.trimmed.cutadapt.log").exists() }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/ref_taxonomy.unite-fungi_8_3.txt"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/dada2/ASV_tax.unite-fungi_8_3.tsv").exists() }, + { assert new File("$outputDir/dada2/ASV_tax_species.unite-fungi_8_3.tsv").exists() }, + { assert new File("$outputDir/fastqc/pb1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/pb2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/pb3_fastqc.html").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet_pacbio_ITS.tsv"), + path("$outputDir/input/Metadata_pacbio_ITS.tsv")).match("input") }, + { assert snapshot(path("$outputDir/itsx/ASV_ITS_seqs.full.fasta"), + path("$outputDir/itsx/ITSx.args.txt")).match("itsx") }, + { assert new File("$outputDir/itsx/ASV_ITS_seqs.summary.txt").exists() }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") }, + { assert snapshot(path("$outputDir/SBDI/dna.tsv"), + path("$outputDir/SBDI/emof.tsv"), + path("$outputDir/SBDI/event.tsv")).match("SBDI") }, + { assert new File("$outputDir/SBDI/annotation.tsv").exists() }, + { assert new File("$outputDir/SBDI/asv-table.tsv").exists() } + ) + } + } +} diff --git a/tests/pipeline/pacbio_its.nf.test.snap b/tests/pipeline/pacbio_its.nf.test.snap new file mode 100644 index 00000000..148e0bb2 --- /dev/null +++ b/tests/pipeline/pacbio_its.nf.test.snap @@ -0,0 +1,76 @@ +{ + "assignsh": { + "content": [ + "ASV_tax_species_SH.unite-fungi_8_3.tsv:md5,91211af4f17cf4537fe715b50a0b2b64" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "input": { + "content": [ + "Samplesheet_pacbio_ITS.tsv:md5,905b0fc4850149d6457c9da7076c2c2d", + "Metadata_pacbio_ITS.tsv:md5,51d81b0fe29f6377fa21ce8399fc5ae0" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "itsx": { + "content": [ + "ASV_ITS_seqs.full.fasta:md5,dab051f759c877a79adf47f5729f5665", + "ITSx.args.txt:md5,32430f2c36d83c08273352bad45857e8" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "SBDI": { + "content": [ + "dna.tsv:md5,061ca46725294da75acd8237390f4291", + "emof.tsv:md5,c6599c76a70fe5458db56ff8c2e89a37", + "event.tsv:md5,bfcf7d8ac2a3c6b48d075d6dc235f0e4" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,d185ccd02c22b859fcaf2e5158ce70c6" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "software_versions": { + "content": [ + "{ASSIGNSH={pandas=1.1.5, python=3.9.1}, BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, DADA2_TAXONOMY={R=4.1.1, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, FORMAT_TAXRESULTS_STD={pandas=1.1.5, python=3.9.1}, ITSX_CUTASV={ITSx=1.1.3}, RENAME_RAW_DATA_FILES={sed=4.7}, SBDIEXPORT={R=3.6.3}, VSEARCH_USEARCHGLOBAL={vsearch=2.21.1}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,97a8ee12c40a0bc582ba1cefda117f95" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,a2632b1cc533d290db19ceedaf350dcd", + "ASV_table.tsv:md5,6de5507a0fcb0c9b03f8fec0270440be", + "ref_taxonomy.unite-fungi_8_3.txt:md5,0f0f24c6c937cfe315f7f490ecdf9af4", + "DADA2_stats.tsv:md5,4bbde0bbf579f60e692bd32d14034f0d", + "DADA2_table.rds:md5,a36558c04a7b21050bb6e479b09bd483", + "DADA2_table.tsv:md5,7e7aab7ae9a3b20fb08f3fe7f8b0430c" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,6bb50a4c244d80d56e759ecfbb045381", + "rrna.bac.gff:md5,7c38dd6692b792ace17142158afeb33e", + "rrna.euk.gff:md5,8ae155cbe43335084a0c9a2ccd655cb3", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-06-20T02:07:02+0000" + }, + "multiqc": { + "content": [ + "multiqc_fastqc.txt:md5,d289cd1a2523f9ad66e93a895dcbe52c", + "multiqc_general_stats.txt:md5,05682be32bc30bc4610f0ca608cafe67", + "multiqc_cutadapt.txt:md5,1b3b6833e78db31ab12e5c16b7fa1d73" + ], + "timestamp": "2023-06-20T02:07:02+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/pplace.nf.test b/tests/pipeline/pplace.nf.test new file mode 100644 index 00000000..b78c479b --- /dev/null +++ b/tests/pipeline/pplace.nf.test @@ -0,0 +1,62 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_pplace" + tag "pipeline" + + test("Pplace") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert snapshot(path("$outputDir/input/Samplesheet.tsv"), + path("$outputDir/input/Metadata.tsv")).match("input") }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-1.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/count_table_filter_stats.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/filtered-table.qza").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.biom").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() }, + { assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() }, + { assert new File("$outputDir/qiime2/input/table.qza").exists() }, + { assert new File("$outputDir/qiime2/input/taxonomy.qza").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-1.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-PPLACE-tax.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-QIIME2-tax.tsv").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/filtered-sequences.qza").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/rep-seq.fasta").exists() }, + { assert snapshot(path("$outputDir/qiime2/representative_sequences/descriptive_stats.tsv"), + path("$outputDir/qiime2/representative_sequences/seven_number_summary.tsv")).match("qiime2") }, + { assert new File("$outputDir/pplace/test_pplace.taxonomy.per_query_unique.tsv").exists() }, + { assert new File("$outputDir/pplace/test_pplace.taxonomy.per_query.tsv").exists() }, + { assert new File("$outputDir/pplace/test_pplace.graft.test_pplace.epa_result.newick").exists() }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") } + ) + } + } +} diff --git a/tests/pipeline/pplace.nf.test.snap b/tests/pipeline/pplace.nf.test.snap new file mode 100644 index 00000000..6ac96c29 --- /dev/null +++ b/tests/pipeline/pplace.nf.test.snap @@ -0,0 +1,60 @@ +{ + "input": { + "content": [ + "Samplesheet.tsv:md5,dbf8d1a2b7933dab9e5a139f33c2b1f4", + "Metadata.tsv:md5,060b56528bb566eed71f6dfdb52cc395" + ], + "timestamp": "2023-06-20T17:24:03+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, EPANG_PLACE={epang=0.3.8}, FILTER_STATS={pandas=1.1.5, python=3.9.1}, GAPPA_ASSIGN={gappa=0.8.0}, GAPPA_GRAFT={gappa=0.8.0}, GAPPA_HEATTREE={gappa=0.8.0}, HMMER_AFAFORMATQUERY={hmmer/easel=0.48}, HMMER_AFAFORMATREF={hmmer/easel=0.48}, HMMER_HMMALIGNQUERY={hmmer=3.3.2}, HMMER_HMMALIGNREF={hmmer=3.3.2}, HMMER_HMMBUILD={hmmer=3.3.2}, HMMER_MASKQUERY={hmmer/easel=0.48}, HMMER_MASKREF={hmmer/easel=0.48}, HMMER_UNALIGNREF={hmmer/easel=0.48}, QIIME2_INSEQ={qiime2=2022.11.1}, RENAME_RAW_DATA_FILES={sed=4.7}, TRUNCLEN={pandas=1.1.5, python=3.9.1}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-06-20T17:24:03+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,5d02749984a811479e7d534fda75163f" + ], + "timestamp": "2023-06-20T17:24:03+0000" + }, + "qiime2": { + "content": [ + "descriptive_stats.tsv:md5,666279e79355dd60a0f5c7c8bb77618d", + "seven_number_summary.tsv:md5,e087b59678e7e9ade87e0a7349f54e2e" + ], + "timestamp": "2023-06-20T17:24:03+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,f6bf53e90e5d2efc4f62a0e4c789bbec" + ], + "timestamp": "2023-06-20T17:24:03+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,864c3e0dc9b4a7649beee0c8665dceb5", + "ASV_table.tsv:md5,2618251e597593e4d716dd9bed095539", + "DADA2_stats.tsv:md5,54a1ac8d6c5a3ff15f700c4b2dd40c86", + "DADA2_table.rds:md5,d095501019ce7ebccfa0eb801db1ed29", + "DADA2_table.tsv:md5,5c9fb0bfd70da165f0ce6a361bfe0b43" + ], + "timestamp": "2023-06-20T17:24:03+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,6dae470aace9293d5eb8c318584852dd", + "rrna.bac.gff:md5,439a9084f089120f700f938dfb58fa41", + "rrna.euk.gff:md5,c9bc1d9d8fb77dc19c95dee2d53840eb", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-06-20T17:24:03+0000" + }, + "multiqc": { + "content": [ + "multiqc_general_stats.txt:md5,9e8ff06d7285ab8748a80e639d3dd54a", + "multiqc_cutadapt.txt:md5,330a7b72dc671ca99fcb3fb84b6776c1" + ], + "timestamp": "2023-06-20T17:24:03+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/reftaxcustom.nf.test b/tests/pipeline/reftaxcustom.nf.test new file mode 100644 index 00000000..42e0d104 --- /dev/null +++ b/tests/pipeline/reftaxcustom.nf.test @@ -0,0 +1,50 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_reftaxcustom" + tag "dada2" + tag "pipeline" + + test("Custom DADA2 Reference Taxonomy Database") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/dada2/ASV_tax.user.tsv").exists() }, + { assert new File("$outputDir/dada2/ASV_tax_species.user.tsv").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1a_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1a_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2a_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2a_2_fastqc.html").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet.tsv")).match("input") }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") } + ) + } + } +} diff --git a/tests/pipeline/reftaxcustom.nf.test.snap b/tests/pipeline/reftaxcustom.nf.test.snap new file mode 100644 index 00000000..b68f0657 --- /dev/null +++ b/tests/pipeline/reftaxcustom.nf.test.snap @@ -0,0 +1,53 @@ +{ + "input": { + "content": [ + "Samplesheet.tsv:md5,dbf8d1a2b7933dab9e5a139f33c2b1f4" + ], + "timestamp": "2023-05-28T21:18:54+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,5d02749984a811479e7d534fda75163f" + ], + "timestamp": "2023-05-28T21:18:54+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, DADA2_TAXONOMY={R=4.1.1, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, RENAME_RAW_DATA_FILES={sed=4.7}, TRUNCLEN={pandas=1.1.5, python=3.9.1}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-05-28T21:18:54+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,3231d6ee72b9a1e7742e5605caaff05a" + ], + "timestamp": "2023-05-28T21:18:54+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,864c3e0dc9b4a7649beee0c8665dceb5", + "ASV_table.tsv:md5,2618251e597593e4d716dd9bed095539", + "DADA2_stats.tsv:md5,54a1ac8d6c5a3ff15f700c4b2dd40c86", + "DADA2_table.rds:md5,d095501019ce7ebccfa0eb801db1ed29", + "DADA2_table.tsv:md5,5c9fb0bfd70da165f0ce6a361bfe0b43" + ], + "timestamp": "2023-05-28T21:18:54+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,6dae470aace9293d5eb8c318584852dd", + "rrna.bac.gff:md5,439a9084f089120f700f938dfb58fa41", + "rrna.euk.gff:md5,c9bc1d9d8fb77dc19c95dee2d53840eb", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-05-28T21:18:54+0000" + }, + "multiqc": { + "content": [ + "multiqc_fastqc.txt:md5,3a4417c7d95a9bbe17751dc974157cd3", + "multiqc_general_stats.txt:md5,88c2b9e6d02b83afe4f9551e6c9a91a7", + "multiqc_cutadapt.txt:md5,330a7b72dc671ca99fcb3fb84b6776c1" + ], + "timestamp": "2023-05-28T21:18:54+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/single.nf.test b/tests/pipeline/single.nf.test new file mode 100644 index 00000000..be236c9a --- /dev/null +++ b/tests/pipeline/single.nf.test @@ -0,0 +1,51 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_single" + tag "pipeline" + + test("Single-End") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert new File("$outputDir/cutadapt/1a_S103_L001_R1_001.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/1_S103_L001_R1_001.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/2a_S115_L001_R1_001.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/2_S115_L001_R1_001.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/assignTaxonomy.cutadapt.log").exists() }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/ref_taxonomy.rdp_18.txt"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/dada2/ASV_tax.rdp_18.tsv").exists() }, + { assert new File("$outputDir/dada2/ASV_tax_species.rdp_18.tsv").exists() }, + { assert new File("$outputDir/fastqc/1a_S103_L001_R1_001_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/1_S103_L001_R1_001_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/2a_S115_L001_R1_001_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/2_S115_L001_R1_001_fastqc.html").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet_single_end.tsv")).match("input") }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") } + ) + } + } +} diff --git a/tests/pipeline/single.nf.test.snap b/tests/pipeline/single.nf.test.snap new file mode 100644 index 00000000..9de64fdf --- /dev/null +++ b/tests/pipeline/single.nf.test.snap @@ -0,0 +1,54 @@ +{ + "input": { + "content": [ + "Samplesheet_single_end.tsv:md5,71bcb9920b1187571ba9e2a5759ee4a5" + ], + "timestamp": "2023-05-28T20:35:33+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,5e5bfa4a7324a44f6d9e3cb0978ca291" + ], + "timestamp": "2023-05-28T20:35:33+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, DADA2_TAXONOMY={R=4.1.1, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, RENAME_RAW_DATA_FILES={sed=4.7}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-05-28T20:35:33+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,0feea9a92fde36cbf63dba6e63617c7e" + ], + "timestamp": "2023-05-28T20:35:33+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,d452ff8b8a306b52ffc6db7e4396c6db", + "ASV_table.tsv:md5,a1226d8573fc0595161d4b2b5ac63cac", + "ref_taxonomy.rdp_18.txt:md5,815c4fce9f3d1de019fb995a43fb66ed", + "DADA2_stats.tsv:md5,8386cc209c1f64237deeec79f75b075b", + "DADA2_table.rds:md5,aefd24f6ac2753a43baca19a93c4e2ee", + "DADA2_table.tsv:md5,3e5280fd5b36c943c0148c4d5b50cb65" + ], + "timestamp": "2023-05-28T20:35:33+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,7ba69096ac8690260dcb2139ba2d9d82", + "rrna.bac.gff:md5,15c5fa3b75684c42d60174b77fa87a09", + "rrna.euk.gff:md5,1978664ae39a761f9082ae605c026182", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-05-28T20:35:33+0000" + }, + "multiqc": { + "content": [ + "multiqc_fastqc.txt:md5,0ea2e6e2d327d66e778e9ff5d03d933b", + "multiqc_general_stats.txt:md5,5040629a246bb3288879d3d30e9d6f40", + "multiqc_cutadapt.txt:md5,48d079bea04fe93d260b980c15793a0c" + ], + "timestamp": "2023-05-28T20:35:33+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/sintax.nf.test b/tests/pipeline/sintax.nf.test new file mode 100644 index 00000000..f6de2995 --- /dev/null +++ b/tests/pipeline/sintax.nf.test @@ -0,0 +1,72 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test_sintax" + tag "pipeline" + + test("Sintax") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-4.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/count_table_filter_stats.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/filtered-table.qza").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.biom").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() }, + { assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() }, + { assert new File("$outputDir/qiime2/input/table.qza").exists() }, + { assert new File("$outputDir/qiime2/input/taxonomy.qza").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-4.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-SINTAX-tax.tsv").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/filtered-sequences.qza").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/rep-seq.fasta").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-var2-ASV/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-var3-ASV/percent-abundances.tsv").exists() }, + { assert snapshot(path("$outputDir/qiime2/representative_sequences/descriptive_stats.tsv"), + path("$outputDir/qiime2/representative_sequences/seven_number_summary.tsv")).match("qiime2") }, + { assert snapshot(path("$outputDir/input/Samplesheet_pacbio_ITS.tsv"), + path("$outputDir/input/Metadata_pacbio_ITS.tsv")).match("input") }, + { assert new File("$outputDir/itsx/ASV_ITS_seqs.full.fasta").exists() }, + { assert new File("$outputDir/itsx/ASV_ITS_seqs.ITS2.fasta").exists() }, + { assert new File("$outputDir/itsx/ASV_ITS_seqs.summary.txt").exists() }, + { assert new File("$outputDir/itsx/ITSx.args.txt").exists() }, + { assert snapshot(path("$outputDir/SBDI/dna.tsv"), + path("$outputDir/SBDI/emof.tsv"), + path("$outputDir/SBDI/event.tsv")).match("SBDI") }, + { assert new File("$outputDir/SBDI/annotation.tsv").exists() }, + { assert new File("$outputDir/SBDI/asv-table.tsv").exists() }, + { assert new File("$outputDir/sintax/ASV_ITS_tax_sintax.unite-fungi.raw.tsv").exists() }, + { assert new File("$outputDir/sintax/ASV_tax_sintax.unite-fungi.tsv").exists() }, + { assert new File("$outputDir/sintax/ref_taxonomy_sintax.txt").exists() }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") } + ) + } + } +} diff --git a/tests/pipeline/sintax.nf.test.snap b/tests/pipeline/sintax.nf.test.snap new file mode 100644 index 00000000..1d4f538e --- /dev/null +++ b/tests/pipeline/sintax.nf.test.snap @@ -0,0 +1,68 @@ +{ + "input": { + "content": [ + "Samplesheet_pacbio_ITS.tsv:md5,905b0fc4850149d6457c9da7076c2c2d", + "Metadata_pacbio_ITS.tsv:md5,51d81b0fe29f6377fa21ce8399fc5ae0" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "SBDI": { + "content": [ + "dna.tsv:md5,061ca46725294da75acd8237390f4291", + "emof.tsv:md5,c6599c76a70fe5458db56ff8c2e89a37", + "event.tsv:md5,bfcf7d8ac2a3c6b48d075d6dc235f0e4" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, FILTER_STATS={pandas=1.1.5, python=3.9.1}, ITSX_CUTASV={ITSx=1.1.3}, QIIME2_INSEQ={qiime2=2022.11.1}, RENAME_RAW_DATA_FILES={sed=4.7}, SBDIEXPORT={R=3.6.3}, VSEARCH_SINTAX={vsearch=2.21.1}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,d185ccd02c22b859fcaf2e5158ce70c6" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "qiime2": { + "content": [ + "descriptive_stats.tsv:md5,f857c6de0bcb1080a0d6fabd7e87c283", + "seven_number_summary.tsv:md5,ef0fd839c0f691c0bbf478de3e724d34" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,680baf14004fc0591c2a333c7e5e85b3" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,a2632b1cc533d290db19ceedaf350dcd", + "ASV_table.tsv:md5,6de5507a0fcb0c9b03f8fec0270440be", + "DADA2_stats.tsv:md5,4bbde0bbf579f60e692bd32d14034f0d", + "DADA2_table.rds:md5,a36558c04a7b21050bb6e479b09bd483", + "DADA2_table.tsv:md5,7e7aab7ae9a3b20fb08f3fe7f8b0430c" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "barrnap": { + "content": [ + "rrna.arc.gff:md5,6bb50a4c244d80d56e759ecfbb045381", + "rrna.bac.gff:md5,7c38dd6692b792ace17142158afeb33e", + "rrna.euk.gff:md5,8ae155cbe43335084a0c9a2ccd655cb3", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-06-20T16:40:18+0000" + }, + "multiqc": { + "content": [ + "multiqc_general_stats.txt:md5,05682be32bc30bc4610f0ca608cafe67", + "multiqc_cutadapt.txt:md5,1b3b6833e78db31ab12e5c16b7fa1d73" + ], + "timestamp": "2023-06-20T16:40:18+0000" + } +} \ No newline at end of file diff --git a/tests/pipeline/test.nf.test b/tests/pipeline/test.nf.test new file mode 100644 index 00000000..7b295941 --- /dev/null +++ b/tests/pipeline/test.nf.test @@ -0,0 +1,100 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "main.nf" + tag "test" + tag "pipeline" + + test("Paired-End") { + + when { + params { + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("software_versions") }, + { assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") }, + { assert snapshot(path("$outputDir/asv_length_filter/").list()).match("asv_length_filter") }, + { assert snapshot(path("$outputDir/barrnap/ASV_seqs.ssu.fasta"), + path("$outputDir/barrnap/ASV_table.ssu.tsv"), + path("$outputDir/barrnap/rrna.arc.gff"), + path("$outputDir/barrnap/rrna.bac.gff"), + path("$outputDir/barrnap/rrna.euk.gff"), + path("$outputDir/barrnap/stats.ssu.tsv"), + path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") }, + { assert new File("$outputDir/barrnap/summary.tsv").exists() }, + { assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") }, + { assert new File("$outputDir/cutadapt/assignTaxonomy.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/sampleID_1a.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/sampleID_1.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/sampleID_2a.trimmed.cutadapt.log").exists() }, + { assert new File("$outputDir/cutadapt/sampleID_2.trimmed.cutadapt.log").exists() }, + { assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"), + path("$outputDir/dada2/ASV_table.tsv"), + path("$outputDir/dada2/ref_taxonomy.gtdb.txt"), + path("$outputDir/dada2/DADA2_stats.tsv"), + path("$outputDir/dada2/DADA2_table.rds"), + path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") }, + { assert new File("$outputDir/dada2/ASV_tax.gtdb.tsv").exists() }, + { assert new File("$outputDir/dada2/ASV_tax_species.gtdb.tsv").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1a_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_1a_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2a_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/sampleID_2a_2_fastqc.html").exists() }, + { assert snapshot(path("$outputDir/input/Samplesheet.tsv"), + path("$outputDir/input/Metadata.tsv")).match("input") }, + { assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"), + path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-4.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/count_table_filter_stats.tsv").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/filtered-table.qza").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.biom").exists() }, + { assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() }, + { assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() }, + { assert new File("$outputDir/qiime2/input/table.qza").exists() }, + { assert new File("$outputDir/qiime2/input/taxonomy.qza").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-2.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-3.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-4.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-DADA2-tax.tsv").exists() }, + { assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-QIIME2-tax.tsv").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/descriptive_stats.tsv").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/filtered-sequences.qza").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/rep-seq.fasta").exists() }, + { assert new File("$outputDir/qiime2/representative_sequences/seven_number_summary.tsv").exists() }, + { assert new File("$outputDir/qiime2/taxonomy/GTGYCAGCMGCCGCGGTAA-GGACTACNVGGGTWTCTAAT-classifier.qza").exists() }, + { assert new File("$outputDir/qiime2/taxonomy/ref_taxonomy.txt").exists() }, + { assert new File("$outputDir/qiime2/taxonomy/taxonomy.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-badpairwise10-ASV/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-badpairwise10-level-2/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-badpairwise10-level-3/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-badpairwise10-level-4/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-mix8-ASV/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-mix8-level-2/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-mix8-level-3/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-mix8-level-4/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-treatment1-ASV/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-treatment1-level-2/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-treatment1-level-3/percent-abundances.tsv").exists() }, + { assert new File("$outputDir/qiime2/ancom/Category-treatment1-level-4/percent-abundances.tsv").exists() }, + { assert snapshot(path("$outputDir/SBDI/dna.tsv"), + path("$outputDir/SBDI/emof.tsv"), + path("$outputDir/SBDI/event.tsv")).match("SBDI") }, + { assert new File("$outputDir/SBDI/annotation.tsv").exists() }, + { assert new File("$outputDir/SBDI/asv-table.tsv").exists() } + ) + } + } +} diff --git a/tests/pipeline/test.nf.test.snap b/tests/pipeline/test.nf.test.snap new file mode 100644 index 00000000..08678113 --- /dev/null +++ b/tests/pipeline/test.nf.test.snap @@ -0,0 +1,76 @@ +{ + "input": { + "content": [ + "Samplesheet.tsv:md5,dbf8d1a2b7933dab9e5a139f33c2b1f4", + "Metadata.tsv:md5,060b56528bb566eed71f6dfdb52cc395" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "SBDI": { + "content": [ + "dna.tsv:md5,46bb52a05204ade2d571ac089f732012", + "emof.tsv:md5,52ff7d226c79b1f78d5f4895d748f915", + "event.tsv:md5,d275c5c0d7dbf7a5b2c61082fbce486d" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "cutadapt": { + "content": [ + "cutadapt_summary.tsv:md5,5d02749984a811479e7d534fda75163f" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "software_versions": { + "content": [ + "{BARRNAP={barrnap=0.9}, CUSTOM_DUMPSOFTWAREVERSIONS={python=3.11.0, yaml=6.0}, CUTADAPT_BASIC={cutadapt=3.4}, DADA2_DENOISING={R=4.1.1, dada2=1.22.0}, DADA2_FILTNTRIM={R=4.1.1, dada2=1.22.0}, DADA2_QUALITY1={R=4.1.1, ShortRead=1.52.0, dada2=1.22.0}, DADA2_TAXONOMY={R=4.1.1, dada2=1.22.0}, FASTQC={fastqc=0.11.9}, FILTER_LEN_ASV={Biostrings=2.58.0, R=4.0.3}, FILTER_STATS={pandas=1.1.5, python=3.9.1}, QIIME2_INSEQ={qiime2=2022.11.1}, RENAME_RAW_DATA_FILES={sed=4.7}, SBDIEXPORT={R=3.6.3}, TRUNCLEN={pandas=1.1.5, python=3.9.1}, Workflow={nf-core/ampliseq=2.6.0dev}}" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "overall_summary_tsv": { + "content": [ + "overall_summary.tsv:md5,42879bf840cad10ef96b1da77e0768b7" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "dada2": { + "content": [ + "ASV_seqs.fasta:md5,864c3e0dc9b4a7649beee0c8665dceb5", + "ASV_table.tsv:md5,2618251e597593e4d716dd9bed095539", + "ref_taxonomy.gtdb.txt:md5,eb743d553579d464dcaa6bdd75f69ccd", + "DADA2_stats.tsv:md5,54a1ac8d6c5a3ff15f700c4b2dd40c86", + "DADA2_table.rds:md5,d095501019ce7ebccfa0eb801db1ed29", + "DADA2_table.tsv:md5,5c9fb0bfd70da165f0ce6a361bfe0b43" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "barrnap": { + "content": [ + "ASV_seqs.ssu.fasta:md5,10f0d101b63c193b5899c704488f9001", + "ASV_table.ssu.tsv:md5,03556c7c2372ad6c3cecc7390ed9617d", + "rrna.arc.gff:md5,6dae470aace9293d5eb8c318584852dd", + "rrna.bac.gff:md5,439a9084f089120f700f938dfb58fa41", + "rrna.euk.gff:md5,c9bc1d9d8fb77dc19c95dee2d53840eb", + "stats.ssu.tsv:md5,dbb23448395135334093edbb3efb1cd0", + "rrna.mito.gff:md5,df19e1b84ba6f691d20c72b397c88abf" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "multiqc": { + "content": [ + "multiqc_fastqc.txt:md5,3a4417c7d95a9bbe17751dc974157cd3", + "multiqc_general_stats.txt:md5,88c2b9e6d02b83afe4f9551e6c9a91a7", + "multiqc_cutadapt.txt:md5,330a7b72dc671ca99fcb3fb84b6776c1" + ], + "timestamp": "2023-05-28T20:55:32+0000" + }, + "asv_length_filter": { + "content": [ + "ASV_len_filt.tsv:md5,a0a6de452999953191b5df29d0b3176a", + "ASV_len_orig.tsv:md5,09a300b31acf0eee817367dad5083f48", + "ASV_seqs.len.fasta:md5,04e8838f97cabf090b95891cde5c45b7", + "ASV_table.len.tsv:md5,8a68fdf1da3bbb0e24bfe4f90af0fbfd", + "stats.len.tsv:md5,9b13b65cf9cc5fd59f6d8717d26202ed" + ], + "timestamp": "2023-05-28T20:55:32+0000" + } +} \ No newline at end of file