Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions tests/.nftignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@ multiqc/multiqc_plots/{svg,pdf,png}/*.{svg,pdf,png}
multiqc/multiqc_report.html
pipeline_info/*.{html,json,txt,yml}
Assembly/MEGAHIT/*.log
Assembly/SPAdes/*.log
Assembly/MEGAHIT/QC/*/*.bowtie2.log
Assembly/**/QUAST/**/*.{pdf,log,html,pdf}
Assembly/**/QC/**/*.{html,log,pdf}
GenomeBinning/depths/**/*-depth.txt.gz
GenomeBinning/depths/bins/*.png
GenomeBinning/MetaBAT2/unbinned/discarded/*.unbinned.pooled.fa.gz
GenomeBinning/QC/CheckM2/**/DIAMOND_RESULTS.tsv
GenomeBinning/QC/CheckM2/*/checkm2.log
GenomeBinning/QC/BUSCO/**/*.log
GenomeBinning/QC/BUSCO/**/.checkpoint
GenomeBinning/QC/BUSCO/**/*.json
GenomeBinning/QC/BUSCO/**/*.txt
QC_shortreads/fastqc/*_fastqc.{html,zip}
GenomeBinning/QC/BUSCO/**/logs/**
GenomeBinning/QC/BUSCO/**/*.{fa,json,txt,log,checkpoint,faa,fna,tsv}
GenomeBinning/QC/BUSCO/**/busco_sequences/**
GenomeBinning/QC/QUAST/**/*.{pdf,log,html,tsv}
GenomeBinning/QC/QUAST/*.tsv
GenomeBinning/QC/*.tsv
GenomeBinning/depths/bins/*.tsv
GenomeBinning/*.tsv
Annotation/Prokka/**/*.{log,gbk,sqn}
QC_shortreads/fastqc/*.{html,zip}
QC_shortreads/fastp/**/*.{html,json}
QC_shortreads/remove_phix/*.log
Taxonomy/CAT/**/bins/*.log
Taxonomy/CAT/*.tsv
Taxonomy/GTDB-Tk/*.tsv
93 changes: 74 additions & 19 deletions tests/default.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,84 @@ nextflow_pipeline {
}

then {
// Output directory: multiqc
def stable_name_multiqc = getAllFilesFromDir(
params.outdir, include: ['multiqc/**'], relative: true, includeDir: false
def stable_name = getAllFilesFromDir(
params.outdir,
relative: true,
includeDir: true,
ignore: ['pipeline_info/*.{html,json,txt}']
)
def stable_path_multiqc = getAllFilesFromDir(
params.outdir, include: ['multiqc/**'], ignoreFile: 'tests/.nftignore'

def stable_path = getAllFilesFromDir(
params.outdir,
ignoreFile: 'tests/.nftignore'
)
// // 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_path: All files in ${params.outdir}/ with stable content
// def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')

assertAll(
{ assert workflow.success},
{ assert snapshot(
// 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_mag_software_mqc_versions.yml"),
// // All stable path name, with a relative path
// stable_name,
// // All files with stable contents
// stable_path
).match() },
{ assert snapshot(stable_name_multiqc, stable_path_multiqc).match('multiqc') },
{ 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
removeNextflowVersion("${outputDir}/pipeline_info/nf_core_mag_software_mqc_versions.yml"),
// All stable path names (relative)
stable_name,
// All files with stable contents
stable_path,

// QC_shortreads
path("${params.outdir}/QC_shortreads/remove_phix/test_minigut_run1_phix_removed.bowtie2.log")
.readLines()
.last() ==~ /[0-9.]+% overall alignment rate/,

// GenomeBinning
path("${params.outdir}/GenomeBinning/bin_summary.tsv")
.readLines()
.size() == 18,
path("${params.outdir}/GenomeBinning/MaxBin2/bins/MEGAHIT-MaxBin2-test_minigut.001.fa.gz")
.linesGzip
.size() > 100,
path("${params.outdir}/GenomeBinning/MetaBAT2/bins/MEGAHIT-MetaBAT2-test_minigut.1.fa.gz")
.linesGzip
.size() > 100,
path("${params.outdir}/GenomeBinning/QC/busco_summary.tsv")
.findAll { l -> l.contains('n_markers') },
path("${params.outdir}/GenomeBinning/QC/busco_summary.tsv")
.findAll { l -> l.contains('Assembly') },

// Assembly
(path("${params.outdir}/Assembly/MEGAHIT/MEGAHIT-test_minigut.log")
.readLines()
.last() =~ /ALL DONE. Time elapsed: [0-9.]+ seconds/)
.find(),
path("${params.outdir}/Assembly/MEGAHIT/MEGAHIT-test_minigut.contigs.fa.gz")
.linesGzip
.size() > 100,
path("${params.outdir}/Assembly/SPAdes/SPAdes-test_minigut.spades.log")
.readLines()
.findAll { l -> l.contains('SPAdes pipeline finished.') },
path("${params.outdir}/Assembly/SPAdes/SPAdes-test_minigut.contigs.fa.gz")
.linesGzip
.size() > 100,
path("${params.outdir}/Assembly/SPAdes/SPAdes-test_minigut.scaffolds.fa.gz")
.linesGzip
.size() > 100,

// Annotation
path("${params.outdir}/Annotation/Prodigal/MEGAHIT/test_minigut/MEGAHIT-test_minigut_prodigal_all.txt.gz")
.linesGzip
.size() > 100,
path("${params.outdir}/Annotation/Prodigal/SPAdes/test_minigut/SPAdes-test_minigut_prodigal_all.txt.gz")
.linesGzip
.size() > 100,

// Taxonomy
path("${params.outdir}/Taxonomy/CAT/bat_summary.tsv")
.readLines()
.drop(1)
.any { it.contains('Bacteroides fragilis') }
).match()
}
)
}
}
Expand Down
Loading
Loading