-
Notifications
You must be signed in to change notification settings - Fork 59
Add more nf tests #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sofstam
wants to merge
41
commits into
dev
Choose a base branch
from
add_nf_test
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,971
−28
Open
Add more nf tests #655
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
4ed1b68
Start adding nf-tests
sofstam 8bf2634
Add diamond snap
sofstam 71d6871
Add nonpareil
sofstam e6bd9d7
Add non-pareil
sofstam d9c451f
Remove bracken from .nftignore
sofstam ba7587f
Add multiqc to unstable patterns
sofstam 0b11065
Remove trailing whitespaces
sofstam 4bcc295
Remove some files
sofstam e6a3fc1
Update snapshot
sofstam 4f9b489
Remove centrifuge from .nftignore
sofstam 02384c5
Update snaps
f648259
Remove more files from .nftignore
7b9e01d
Add nf-test for kraken2
38f4e7d
Add bowtie2
0f7b403
Add more output files to snapshot
570e214
Snapshots for kaiju, kmcp, krona and metaphlan
bc690e3
Add metaphlan, nanoq, porechop_abi, samtools, taxpasta to snapshots
7af0f8c
Add md5 for taxpasta
1352e64
Update md5 assertions
f37ab27
Update the unstable files for bbduk
151fecb
Fix unstable files for fastp
1cd44fb
Update snaps for kaiju unstable files
22652de
Update snaps
ecce43f
Update snaps
3faf15d
Fix obsolete snapshots
362069d
Update tests/default.nf.test
sofstam 50c48af
Update tests/default.nf.test
sofstam b4c600c
Update tests/default.nf.test
sofstam 39837e0
Add md5 for all kraken2 files
d990ce8
Add content for each kraken2 file
f82e739
Update snapshots for kraken2 unstalbel files
39da5c5
Update pathways for kraken2 unstable files
3e3e7f3
Update kraken2 paths
bf0fa89
Update snapshots
974ff69
Remove the path from assertion
5c42f34
Add whole path for bowtie2
9fdc72b
Add more bracken files
a1ba47d
Add more files
1f3a09a
Define unstable files
043a37f
Add more files for fastp
19585d2
Add more tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,22 +15,121 @@ nextflow_pipeline { | |
| } | ||
|
|
||
| then { | ||
| // stable_name: All files + folders in ${params.outdir}/ with a stable name | ||
| // def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) | ||
| // stable_name: All files + folders in ${params.outdir}/ with a stable name | ||
| def stable_name_all = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) | ||
| // stable_path: All files in ${params.outdir}/ with stable content | ||
| // def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') | ||
| def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') | ||
|
|
||
| //MultiQC | ||
| def stable_name_multiqc = getAllFilesFromDir("$outputDir/multiqc", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| //BBDuk | ||
| def stable_content_bbduk = getAllFilesFromDir("$outputDir/bbduk", relative: true, includeDir: false, ignore: ['*.log'], ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_bbduk = getAllFilesFromDir("$outputDir/bbduk", relative: true, includeDir: false, ignore: null , ignoreFile: null, include: ['**/*.fastq.gz'] ) | ||
|
|
||
| //DIAMOND | ||
| def stable_content_diamond = getAllFilesFromDir("$outputDir/diamond", relative: true, includeDir: false, ignore: ['*/*.{tsv,log,txt}'], ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_diamond = getAllFilesFromDir("$outputDir/diamond", relative: true, includeDir: false, ignore: null , ignoreFile: null, include: ['**/*.{tsv,log,txt}'] ) | ||
|
|
||
| //nonpareil | ||
| def stable_content_nonpareil = getAllFilesFromDir("$outputDir/nonpareil", relative: true, includeDir: false, ignore: ['*.{svg,npa}'] , ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_nonpareil = getAllFilesFromDir("$outputDir/nonpareil", relative: true, includeDir: false, ignore: null , ignoreFile: null, include: ['**/*.{svg,npa}'] ) | ||
|
|
||
| //kraken2 | ||
| def stable_content_kraken2 = getAllFilesFromDir("$outputDir/kraken2", relative: true, includeDir: false, ignore: ['**/*.fastq.gz'] , ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_kraken2 = getAllFilesFromDir("$outputDir/kraken2", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.fastq.gz']) | ||
|
|
||
| //bowtie2 | ||
| def stable_name_bowtie2 = getAllFilesFromDir("$outputDir/bowtie2", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| //bracken | ||
| def stable_name_bracken = getAllFilesFromDir("$outputDir/bracken", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| //centrifuge | ||
| def stable_content_centrifuge = getAllFilesFromDir("$outputDir/centrifuge", relative: true, includeDir: false, ignore: ['**/*.fastq.gz'] , ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_centrifuge = getAllFilesFromDir("$outputDir/centrifuge", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| //fastp | ||
| def stable_content_fastp = getAllFilesFromDir("$outputDir/fastp", relative: true, includeDir: false, ignore: ['*.{log}'] , ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_fastp = getAllFilesFromDir("$outputDir/fastp", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.log']) | ||
|
|
||
| //ganon | ||
| def stable_name_ganon = getAllFilesFromDir("$outputDir/ganon", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| //kaiju | ||
| def stable_content_kaiju = getAllFilesFromDir("$outputDir/kaiju", relative: true, includeDir: false, ignore: ['*.{tsv}'] , ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_kaiju = getAllFilesFromDir("$outputDir/kaiju", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.tsv']) | ||
|
|
||
| //kmcp | ||
| def stable_name_kmcp = getAllFilesFromDir("$outputDir/kmcp", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| // krona | ||
| def stable_name_krona = getAllFilesFromDir("$outputDir/krona", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| // metaphlan | ||
| def stable_name_metaphlan = getAllFilesFromDir("$outputDir/metaphlan", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| // nanoq | ||
| def stable_name_nanoq = getAllFilesFromDir("$outputDir/nanoq", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| // porechop_abi | ||
| def stable_content_porechopabi = getAllFilesFromDir("$outputDir/porechop_abi", relative: true, includeDir: false, ignore: ['*.{log}'] , ignoreFile: null, include: ['*','**/*']) | ||
| def stable_name_porechopabi = getAllFilesFromDir("$outputDir/porechop_abi", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.log']) | ||
|
|
||
| // samtools | ||
| def stable_name_samtools = getAllFilesFromDir("$outputDir/samtools", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
| //taxpasta | ||
| def stable_name_taxpasta = getAllFilesFromDir("$outputDir/taxpasta", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*']) | ||
|
|
||
|
|
||
| assertAll( | ||
| { assert workflow.success}, | ||
| { assert snapshot( | ||
| // Number of successful tasks | ||
| workflow.trace.succeeded().size(), | ||
| // pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions | ||
| removeNextflowVersion("$outputDir/pipeline_info/nf_core_taxprofiler_software_mqc_versions.yml"), | ||
| // All stable path name, with a relative path | ||
| // stable_name, | ||
| // All files with stable contents | ||
| //stable_path | ||
| ).match() } | ||
| ).match() }, | ||
|
|
||
| { assert new File("$outputDir/pipeline_info/nf_core_taxprofiler_software_mqc_versions.yml").exists() }, | ||
| { assert new File("$outputDir/multiqc/multiqc_report.html").exists() }, | ||
|
|
||
| { assert snapshot ( stable_name_all ).match("all_files") }, | ||
| { assert snapshot ( stable_name_multiqc ).match("multiqc" ) }, | ||
| { assert snapshot( file("$outputDir/bbduk/2613_ERR5766181.bbduk.log").text.contains("Reads Processed:"), [stable_content_bbduk, stable_name_bbduk]).match("bbduk")}, | ||
| { assert snapshot ( stable_content_diamond, stable_name_diamond ).match("diamond" ) }, | ||
| { assert snapshot ( stable_content_nonpareil, stable_name_nonpareil ).match("nonpareil" ) }, | ||
| { assert snapshot ( | ||
| stable_name_kraken2, stable_content_kraken2, file ("$outputDir/kraken2/db2/2613_db2.kraken2.kraken2.report.txt").text.contains("S288C"), file ("$outputDir/kraken2/db2/2611_db2.kraken2.kraken2.report.txt").text.contains("S288C"), file ("$outputDir/kraken2/db2/2612_db2.kraken2.kraken2.report.txt").text.contains("S288C")) | ||
| .match("kraken2") }, | ||
| { assert snapshot ( stable_name_bowtie2, file ("$outputDir/bowtie2/align/2613_ERR5766181.bowtie2.log").text.contains("overall alignment rate"), file ("$outputDir/bowtie2/align/2612_ERR5766176_B.bowtie2.log").text.contains("overall alignment rate"), file ("$outputDir/bowtie2/align/2612_ERR5766176.bowtie2.log").text.contains("overall alignment rate"), file ("$outputDir/bowtie2/align/2612_ERR5766180.bowtie2.log").text.contains("overall alignment rate"), | ||
| path("$outputDir/bowtie2/align/")) | ||
| .match("bowtie2" ) }, | ||
| { assert snapshot ( stable_name_bracken, file ("$outputDir/bracken/db1/2613_db1.bracken.tsv").text.contains("Homo sapiens"), file ("$outputDir/bracken/db1/2611_db1.bracken.tsv").text.contains("Homo sapiens"), file ("$outputDir/bracken/db1/2612_db1.bracken.tsv").text.contains("Homo sapiens"), | ||
| path("$outputDir/bracken/db1")) | ||
| .match("bracken") }, | ||
| { assert snapshot ( stable_name_centrifuge, file ("$outputDir/centrifuge/db3/2613_db3.centrifuge.report.txt").text.contains("Eucommia"), file ("$outputDir/centrifuge/db3/2612_db3.centrifuge.report.txt").text.contains("Eucommia"), | ||
| stable_content_centrifuge) | ||
| .match("centrifuge") }, | ||
| { assert snapshot ( file ("$outputDir/fastp/2613_ERR5766181.fastp.log").text.contains("Read pairs merged"),file ("$outputDir/fastp/2612_ERR5766176_B.fastp.log").text.contains("Read pairs merged"),file ("$outputDir/fastp/2612_ERR5766180.fastp.log").text.contains("Read pairs merged"),stable_content_fastp, stable_name_fastp ).match("fastp") }, | ||
| { assert snapshot ( stable_name_ganon, file ("$outputDir/ganon/db1/2613_db1.ganon.tre").text.contains("Saccharomycetales"),file ("$outputDir/ganon/db1/2612_db1.ganon.tre").text.contains("Saccharomycetales"), file ("$outputDir/ganon/db1/2611_db1.ganon.tre").text.contains("Saccharomycetales"), | ||
| path("$outputDir/ganon/db1")) | ||
| .match("ganon") }, | ||
| { assert snapshot ( file ("$outputDir/kaiju/db6/2614_db6.kaiju.tsv").text.contains("ERR3201952.3225565"),file ("$outputDir/kaiju/db6/ERR3201952_db6.kaiju.tsv").text.contains("ERR3201952.1159044"),stable_content_kaiju, stable_name_kaiju ).match("kaiju") }, | ||
| { assert snapshot ( stable_name_kmcp, file ("$outputDir/kmcp/db1/2613_db1.kmcp.profile").text.contains("NW_024067565.1"),file ("$outputDir/kmcp/db1/2612_db1.kmcp.profile").text.contains("NW_024067565.1"),file ("$outputDir/kmcp/db1/2611_db1.kmcp.profile").text.contains("NW_024067565.1"), | ||
| path("$outputDir/kmcp/db1")) | ||
| .match("kmcp") }, | ||
| { assert snapshot ( stable_name_krona, path("$outputDir/krona")).match("krona" ) }, | ||
| { assert snapshot ( stable_name_metaphlan, file ("$outputDir/metaphlan/metaphlan4/2613_metaphlan4.metaphlan_profile.txt").text.contains("SGB4933_group")).match("metaphlan") }, | ||
| { assert snapshot(path("$outputDir/metaphlan/metaphlan4/2613_metaphlan4.metaphlan_profile.txt").md5).match("metaphlan_profile_md5") }, | ||
| { assert snapshot ( stable_name_nanoq, file ("$outputDir/nanoq/ERR3201952_ERR3201952_filtered.stats").text.contains("Median read quality")).match("nanoq") }, | ||
| { assert snapshot(path("$outputDir/nanoq/ERR3201952_ERR3201952_filtered.stats").md5).match("nanoq_md5") }, | ||
| { assert snapshot ( file ("$outputDir/porechop_abi/ERR3201952_ERR3201952_porechop_abi.log").text.contains("reads were split"), [stable_name_porechopabi, stable_content_porechopabi]).match("porechop_abi") }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list thingy again here... |
||
| { assert snapshot ( stable_name_samtools, file ("$outputDir/samtools/stats/2613_ERR5766181.stats").text.contains("mismatches:")).match("samtools") }, | ||
| { assert snapshot(path("$outputDir/samtools/stats/2613_ERR5766181.stats").md5).match("samtools_md5") }, | ||
| { assert snapshot ( stable_name_taxpasta, file ("$outputDir/taxpasta/metaphlan_metaphlan4.tsv").text.contains("186803")).match("taxpasta") }, | ||
| { assert snapshot(path("$outputDir/taxpasta/metaphlan_metaphlan4.tsv").md5).match("taxpasta_md5") }, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you put content/name as a list here?, they can be independent entries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do so!