11nextflow_pipeline {
22
3- name "Test pipeline "
3+ name "Test nf-core/mag "
44 script "../main.nf"
55 tag "pipeline"
66 tag "test_alternatives"
@@ -23,6 +23,9 @@ nextflow_pipeline {
2323 def stable_path_qc = getAllFilesFromDir(
2424 params.outdir, include: ['QC_shortreads/**'], ignoreFile: 'tests/.nftignore'
2525 )
26+ def remove_phix_logs = getAllFilesFromDir(
27+ params.outdir, include: ['QC_shortreads/remove_phix/*.log']
28+ )
2629
2730 // Output dir: Assembly
2831 def stable_name_assembly = getAllFilesFromDir(
@@ -31,6 +34,12 @@ nextflow_pipeline {
3134 def stable_path_assembly = getAllFilesFromDir(
3235 params.outdir, include: ['Assembly/**'], ignoreFile: 'tests/.nftignore'
3336 )
37+ def megahit_logs = getAllFilesFromDir(
38+ params.outdir, include: ['Assembly/MEGAHIT/*.log']
39+ )
40+ def bowtie2_logs = getAllFilesFromDir(
41+ params.outdir, include: ['Assembly/MEGAHIT/QC/*/*.bowtie2.log']
42+ )
3443
3544 // Output dir: GenomeBinning
3645 def stable_name_binning = getAllFilesFromDir(
@@ -39,6 +48,12 @@ nextflow_pipeline {
3948 def stable_path_binning = getAllFilesFromDir(
4049 params.outdir, include: ['GenomeBinning/**'], ignoreFile: 'tests/.nftignore'
4150 )
51+ def checkm2_logs = getAllFilesFromDir(
52+ params.outdir, include: ['GenomeBinning/QC/CheckM2/*/checkm2.log']
53+ )
54+ def checkm2_diamond_results = getAllFilesFromDir(
55+ params.outdir, include: ['GenomeBinning/QC/CheckM2/**/DIAMOND_RESULTS.tsv']
56+ )
4257
4358 // Output dir: multiqc
4459 def stable_name_multiqc = getAllFilesFromDir(
@@ -51,16 +66,33 @@ nextflow_pipeline {
5166 assertAll(
5267 { assert workflow.success },
5368 { assert snapshot(
54- // Number of successful tasks
5569 workflow.trace.succeeded().size(),
56- // pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
5770 removeNextflowVersion("${outputDir}/pipeline_info/nf_core_mag_software_mqc_versions.yml"),
5871 ).match()
5972 },
6073 { assert snapshot(stable_name_qc, stable_path_qc ).match('qc') },
6174 { assert snapshot(stable_name_assembly, stable_path_assembly).match('assembly') },
6275 { assert snapshot(stable_name_binning, stable_path_binning ).match('binning') },
6376 { assert snapshot(stable_name_multiqc, stable_path_multiqc ).match('multiqc') },
77+ { assert snapshot(
78+ remove_phix_logs.collect {
79+ log -> (log.readLines().last() =~ /[0-9.]+% overall alignment rate/).find()
80+ },
81+ megahit_logs.collect {
82+ log -> (log.readLines().last() =~ /ALL DONE. Time elapsed: [0-9.]+ seconds/).find()
83+ },
84+ bowtie2_logs.collect {
85+ log -> (log.readLines().last() =~ /[0-9.]+% overall alignment rate/).find()
86+ },
87+ checkm2_logs.collect {
88+ log -> log.readLines().last().contains('CheckM2 finished successfully.')
89+ }
90+ ).match('logs')
91+ },
92+ { assert snapshot(
93+ checkm2_diamond_results.collect { results -> results.text.readLines().size() }
94+ ).match('checkm2_diamond_results')
95+ }
6496 )
6597 }
6698 }
0 commit comments