-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathdefault.nf.test
More file actions
93 lines (85 loc) · 4.97 KB
/
Copy pathdefault.nf.test
File metadata and controls
93 lines (85 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
nextflow_pipeline {
name "Test pipeline"
script "../main.nf"
tag "pipeline"
profile "test"
test("-profile test") {
when {
params {
outdir = "$outputDir"
}
}
then {
// stable_path: All files + folders in ${params.outdir}/ with a stable path and file name
def stable_path = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
assert workflow.success
assertAll(
{ 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_ampliseq_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_path,
// Manually chosen files for content checks
path("$outputDir/overall_summary.tsv"),
path("$outputDir/asv_length_filter/").list(),
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"),
path("$outputDir/cutadapt/cutadapt_summary.tsv"),
path("$outputDir/dada2/ASV_seqs.fasta"),
path("$outputDir/dada2/ASV_table.tsv"),
path("$outputDir/dada2/ref_taxonomy.gtdb_R07-RS207.txt"),
path("$outputDir/dada2/DADA2_stats.tsv"),
path("$outputDir/dada2/DADA2_table.tsv"),
path("$outputDir/decontam/decontaminated.tsv"),
path("$outputDir/decontam/decontaminated_counts.tsv"),
path("$outputDir/decontam/decontaminated_details.tsv").readLines().size(),
path("$outputDir/decontam/decontaminated_log.tsv"),
path("$outputDir/input/Samplesheet_v3.tsv"),
path("$outputDir/input/Metadata.tsv"),
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"),
path("$outputDir/SBDI/dna.tsv"),
path("$outputDir/SBDI/emof.tsv"),
path("$outputDir/SBDI/event.tsv"),
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.fna"),
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.stats.tsv"),
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.table.tsv"),
path("$outputDir/qiime2/ancombc2/Category-treatment1-ASV/ASV-treatment1::b.volcano_plot.tsv"),
path("$outputDir/qiime2/ancombc2/Category-treatment1-level-2/lvl2-treatment1::b.volcano_plot.tsv"),
path("$outputDir/qiime2/ancombc2_formula/Category-treatment1-ASV/ASV-treatment1::a.volcano_plot.tsv")
).match() },
{ assert path("$outputDir/decontam/decontaminated_details.tsv").csv(sep: '\t', header: true).columns["freq"].sum() > 0.99999 },
)
}
}
test("-profile test, --report_abstract, --metadata_category") {
// Covers 2 params whose channel construction (in PIPELINE_INITIALISATION) isn't
// exercised by any other test profile: --report_abstract and --metadata_category.
// By default (no --metadata_category), all suitable metadata columns are auto-detected
// for diversity/ancom (e.g. both "treatment1" and "mix8" beta-diversity dirs, see
// tests/default.nf.test.snap); restricting to "treatment1" here should exclude "mix8".
// (Note: alpha-rarefaction plots every metadata column regardless of --metadata_category,
// since QIIME2 reads the metadata file directly there, so it isn't a useful signal.)
when {
params {
outdir = "$outputDir"
report_abstract = "$projectDir/tower.yml"
metadata_category = "treatment1"
}
}
then {
assert workflow.success
assertAll(
{ assert path("$outputDir/summary_report/summary_report.html").text.contains("MultiQC HTML report") },
{ assert path("$outputDir/qiime2/diversity/beta_diversity/bray_curtis_distance_matrix-treatment1/index.html").exists() },
{ assert !file("$outputDir/qiime2/diversity/beta_diversity/bray_curtis_distance_matrix-mix8").exists() },
)
}
}
}