From 30c76b5cd82860fd00ccdd1f5d33ef0c4f3bab86 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Fri, 29 Mar 2024 09:51:51 -0500 Subject: [PATCH 1/6] test(#392): Add boilerplate for tests --- tests/pipeline/bismark/assets/samplesheet.csv | 5 ++ tests/pipeline/bismark/samplesheet.nf.test | 71 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 tests/pipeline/bismark/assets/samplesheet.csv create mode 100644 tests/pipeline/bismark/samplesheet.nf.test diff --git a/tests/pipeline/bismark/assets/samplesheet.csv b/tests/pipeline/bismark/assets/samplesheet.csv new file mode 100644 index 00000000..847cce36 --- /dev/null +++ b/tests/pipeline/bismark/assets/samplesheet.csv @@ -0,0 +1,5 @@ +sample,fastq_1,fastq_2,genome +GSM7506206_test1,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz,, +GSM7506206_test2,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub2.fastq.gz,, +GSM7431885_test1,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub3.fastq.gz,, +GSM7431885_test2,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, diff --git a/tests/pipeline/bismark/samplesheet.nf.test b/tests/pipeline/bismark/samplesheet.nf.test new file mode 100644 index 00000000..92e5c7c0 --- /dev/null +++ b/tests/pipeline/bismark/samplesheet.nf.test @@ -0,0 +1,71 @@ +nextflow_pipeline { + + name "Test Replicate Handling" + script "../main.nf" + config "../conf/test.config" + + tag "pipeline" + + + test("Should ____") { + when { + params { + input = "$baseDir/tests/pipeline/bismark/assets/samplesheet.csv" + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + // TODO Output names should be as expected + // { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("single_end_software_versions") }, + // { assert snapshot(path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.flagstat"), + // path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.stats"), + // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.flagstat"), + // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.stats"), + // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.flagstat"), + // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.stats"), + // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.flagstat"), + // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.stats"), + // path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam"), + // path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam.bai"), + // path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam"), + // path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam.bai"), + // path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam"), + // path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam.bai"), + // path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam"), + // path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam.bai"), + // path("$outputDir/bwameth/reference_genome/").list(), + // path("$outputDir/methyldackel/Ecoli.markdup.sorted_CpG.bedGraph"), + // path("$outputDir/methyldackel/SRR389222_sub1.markdup.sorted_CpG.bedGraph"), + // path("$outputDir/methyldackel/SRR389222_sub2.markdup.sorted_CpG.bedGraph"), + // path("$outputDir/methyldackel/SRR389222_sub3.markdup.sorted_CpG.bedGraph"), + // path("$outputDir/methyldackel/mbias/Ecoli.mbias.txt"), + // path("$outputDir/methyldackel/mbias/SRR389222_sub1.mbias.txt"), + // path("$outputDir/methyldackel/mbias/SRR389222_sub2.mbias.txt"), + // path("$outputDir/methyldackel/mbias/SRR389222_sub3.mbias.txt"), + // path("$outputDir/qualimap/Ecoli/genome_results.txt"), + // path("$outputDir/qualimap/SRR389222_sub1/genome_results.txt"), + // path("$outputDir/qualimap/SRR389222_sub2/genome_results.txt"), + // path("$outputDir/qualimap/SRR389222_sub3/genome_results.txt")).match("single_end") }, + // { assert new File("$outputDir/fastqc/Ecoli_1_fastqc.html").exists() }, + // { assert new File("$outputDir/fastqc/Ecoli_2_fastqc.html").exists() }, + // { assert new File("$outputDir/fastqc/SRR389222_sub1_fastqc.html").exists() }, + // { assert new File("$outputDir/fastqc/SRR389222_sub2_fastqc.html").exists() }, + // { assert new File("$outputDir/fastqc/SRR389222_sub3_fastqc.html").exists() }, + // { assert new File("$outputDir/multiqc/bwameth/multiqc_report.html").exists() }, + // { assert new File("$outputDir/trimgalore/logs/Ecoli_1.fastq.gz_trimming_report.txt").exists() }, + // { assert new File("$outputDir/trimgalore/logs/Ecoli_2.fastq.gz_trimming_report.txt").exists() }, + // { assert new File("$outputDir/trimgalore/logs/SRR389222_sub1.fastq.gz_trimming_report.txt").exists() }, + // { assert new File("$outputDir/trimgalore/logs/SRR389222_sub2.fastq.gz_trimming_report.txt").exists() }, + // { assert new File("$outputDir/trimgalore/logs/SRR389222_sub3.fastq.gz_trimming_report.txt").exists() }, + // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/Ecoli.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, + // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub1.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, + // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub2.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, + // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub3.markdup.sorted.MarkDuplicates.metrics.txt").exists() } + ) + } + } + +} From 825d4414f2393d8d32b18add6dbd5e3086585b89 Mon Sep 17 00:00:00 2001 From: Felix Krueger Date: Sat, 30 Mar 2024 17:46:18 +0100 Subject: [PATCH 2/6] Update samplesheet.csv This should now have both unique samples and samples that need to be merged for both single-end and paired-end scenarios. --- tests/pipeline/bismark/assets/samplesheet.csv | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/pipeline/bismark/assets/samplesheet.csv b/tests/pipeline/bismark/assets/samplesheet.csv index 847cce36..0a652350 100644 --- a/tests/pipeline/bismark/assets/samplesheet.csv +++ b/tests/pipeline/bismark/assets/samplesheet.csv @@ -1,5 +1,10 @@ sample,fastq_1,fastq_2,genome -GSM7506206_test1,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz,, -GSM7506206_test2,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub2.fastq.gz,, -GSM7431885_test1,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub3.fastq.gz,, -GSM7431885_test2,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, +SRR389222_sub1,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz,, +SRR389222_sub2,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub2.fastq.gz,, +SRR389222_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz,, +SRR389222_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub2.fastq.gz,, +SRR389222_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub3.fastq.gz,, +Ecoli_uniq1,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, +Ecoli_uniq2,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, +Ecoli_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, +Ecoli_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, From 86b4f7b6f9adb479d46e04c5f98abcb1b2ba85af Mon Sep 17 00:00:00 2001 From: Felix Krueger Date: Thu, 4 Apr 2024 11:25:52 +0200 Subject: [PATCH 3/6] Update samplesheet.csv Switching R1 and R2 round for the last test merge, which should also work (both for merging and for processing even though it won't align in directional mode). --- tests/pipeline/bismark/assets/samplesheet.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pipeline/bismark/assets/samplesheet.csv b/tests/pipeline/bismark/assets/samplesheet.csv index 0a652350..d51cf60f 100644 --- a/tests/pipeline/bismark/assets/samplesheet.csv +++ b/tests/pipeline/bismark/assets/samplesheet.csv @@ -7,4 +7,4 @@ SRR389222_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/ Ecoli_uniq1,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, Ecoli_uniq2,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, Ecoli_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, -Ecoli_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz, +Ecoli_merge,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R2.fastq.gz,https://github.com/nf-core/test-datasets/raw/methylseq/testdata/Ecoli_10K_methylated_R1.fastq.gz, From 880e473eb7e4019686864bbcab95a3575b77f0ba Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 4 Apr 2024 11:29:45 +0200 Subject: [PATCH 4/6] fix paths --- tests/pipeline/bismark/samplesheet.nf.test | 94 +++++++++++----------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/tests/pipeline/bismark/samplesheet.nf.test b/tests/pipeline/bismark/samplesheet.nf.test index 92e5c7c0..2f5f9a17 100644 --- a/tests/pipeline/bismark/samplesheet.nf.test +++ b/tests/pipeline/bismark/samplesheet.nf.test @@ -1,8 +1,8 @@ nextflow_pipeline { name "Test Replicate Handling" - script "../main.nf" - config "../conf/test.config" + script "../../../main.nf" + config "../../../conf/test.config" tag "pipeline" @@ -19,51 +19,51 @@ nextflow_pipeline { assertAll( { assert workflow.success }, // TODO Output names should be as expected - // { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("single_end_software_versions") }, - // { assert snapshot(path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.flagstat"), - // path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.stats"), - // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.flagstat"), - // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.stats"), - // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.flagstat"), - // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.stats"), - // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.flagstat"), - // path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.stats"), - // path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam"), - // path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam.bai"), - // path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam"), - // path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam.bai"), - // path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam"), - // path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam.bai"), - // path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam"), - // path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam.bai"), - // path("$outputDir/bwameth/reference_genome/").list(), - // path("$outputDir/methyldackel/Ecoli.markdup.sorted_CpG.bedGraph"), - // path("$outputDir/methyldackel/SRR389222_sub1.markdup.sorted_CpG.bedGraph"), - // path("$outputDir/methyldackel/SRR389222_sub2.markdup.sorted_CpG.bedGraph"), - // path("$outputDir/methyldackel/SRR389222_sub3.markdup.sorted_CpG.bedGraph"), - // path("$outputDir/methyldackel/mbias/Ecoli.mbias.txt"), - // path("$outputDir/methyldackel/mbias/SRR389222_sub1.mbias.txt"), - // path("$outputDir/methyldackel/mbias/SRR389222_sub2.mbias.txt"), - // path("$outputDir/methyldackel/mbias/SRR389222_sub3.mbias.txt"), - // path("$outputDir/qualimap/Ecoli/genome_results.txt"), - // path("$outputDir/qualimap/SRR389222_sub1/genome_results.txt"), - // path("$outputDir/qualimap/SRR389222_sub2/genome_results.txt"), - // path("$outputDir/qualimap/SRR389222_sub3/genome_results.txt")).match("single_end") }, - // { assert new File("$outputDir/fastqc/Ecoli_1_fastqc.html").exists() }, - // { assert new File("$outputDir/fastqc/Ecoli_2_fastqc.html").exists() }, - // { assert new File("$outputDir/fastqc/SRR389222_sub1_fastqc.html").exists() }, - // { assert new File("$outputDir/fastqc/SRR389222_sub2_fastqc.html").exists() }, - // { assert new File("$outputDir/fastqc/SRR389222_sub3_fastqc.html").exists() }, - // { assert new File("$outputDir/multiqc/bwameth/multiqc_report.html").exists() }, - // { assert new File("$outputDir/trimgalore/logs/Ecoli_1.fastq.gz_trimming_report.txt").exists() }, - // { assert new File("$outputDir/trimgalore/logs/Ecoli_2.fastq.gz_trimming_report.txt").exists() }, - // { assert new File("$outputDir/trimgalore/logs/SRR389222_sub1.fastq.gz_trimming_report.txt").exists() }, - // { assert new File("$outputDir/trimgalore/logs/SRR389222_sub2.fastq.gz_trimming_report.txt").exists() }, - // { assert new File("$outputDir/trimgalore/logs/SRR389222_sub3.fastq.gz_trimming_report.txt").exists() }, - // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/Ecoli.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, - // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub1.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, - // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub2.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, - // { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub3.markdup.sorted.MarkDuplicates.metrics.txt").exists() } + { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("single_end_software_versions") }, + { assert snapshot(path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.flagstat"), + path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.stats"), + path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.flagstat"), + path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.stats"), + path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.flagstat"), + path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.stats"), + path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.flagstat"), + path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.stats"), + path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam"), + path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam.bai"), + path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam"), + path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam.bai"), + path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam"), + path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam.bai"), + path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam"), + path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam.bai"), + path("$outputDir/bwameth/reference_genome/").list(), + path("$outputDir/methyldackel/Ecoli.markdup.sorted_CpG.bedGraph"), + path("$outputDir/methyldackel/SRR389222_sub1.markdup.sorted_CpG.bedGraph"), + path("$outputDir/methyldackel/SRR389222_sub2.markdup.sorted_CpG.bedGraph"), + path("$outputDir/methyldackel/SRR389222_sub3.markdup.sorted_CpG.bedGraph"), + path("$outputDir/methyldackel/mbias/Ecoli.mbias.txt"), + path("$outputDir/methyldackel/mbias/SRR389222_sub1.mbias.txt"), + path("$outputDir/methyldackel/mbias/SRR389222_sub2.mbias.txt"), + path("$outputDir/methyldackel/mbias/SRR389222_sub3.mbias.txt"), + path("$outputDir/qualimap/Ecoli/genome_results.txt"), + path("$outputDir/qualimap/SRR389222_sub1/genome_results.txt"), + path("$outputDir/qualimap/SRR389222_sub2/genome_results.txt"), + path("$outputDir/qualimap/SRR389222_sub3/genome_results.txt")).match("single_end") }, + { assert new File("$outputDir/fastqc/Ecoli_1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/Ecoli_2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/SRR389222_sub1_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/SRR389222_sub2_fastqc.html").exists() }, + { assert new File("$outputDir/fastqc/SRR389222_sub3_fastqc.html").exists() }, + { assert new File("$outputDir/multiqc/bwameth/multiqc_report.html").exists() }, + { assert new File("$outputDir/trimgalore/logs/Ecoli_1.fastq.gz_trimming_report.txt").exists() }, + { assert new File("$outputDir/trimgalore/logs/Ecoli_2.fastq.gz_trimming_report.txt").exists() }, + { assert new File("$outputDir/trimgalore/logs/SRR389222_sub1.fastq.gz_trimming_report.txt").exists() }, + { assert new File("$outputDir/trimgalore/logs/SRR389222_sub2.fastq.gz_trimming_report.txt").exists() }, + { assert new File("$outputDir/trimgalore/logs/SRR389222_sub3.fastq.gz_trimming_report.txt").exists() }, + { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/Ecoli.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, + { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub1.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, + { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub2.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, + { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub3.markdup.sorted.MarkDuplicates.metrics.txt").exists() } ) } } From 94a38562beb722b205edf890c7feb83e1246ee6e Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 4 Apr 2024 11:38:39 +0200 Subject: [PATCH 5/6] fix: fix path to script --- tests/pipeline/bismark/samplesheet.nf.test | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/pipeline/bismark/samplesheet.nf.test b/tests/pipeline/bismark/samplesheet.nf.test index 2f5f9a17..6e1534a2 100644 --- a/tests/pipeline/bismark/samplesheet.nf.test +++ b/tests/pipeline/bismark/samplesheet.nf.test @@ -1,8 +1,7 @@ nextflow_pipeline { name "Test Replicate Handling" - script "../../../main.nf" - config "../../../conf/test.config" + script "main.nf" tag "pipeline" From f36cbdf5f9d9ec83442268fd48ccc876ed54f2c1 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Fri, 17 May 2024 14:57:16 +0200 Subject: [PATCH 6/6] add very simple tests --- tests/pipeline/bismark/samplesheet.nf.test | 58 ++----------------- .../pipeline/bismark/samplesheet.nf.test.snap | 12 ++++ 2 files changed, 18 insertions(+), 52 deletions(-) create mode 100644 tests/pipeline/bismark/samplesheet.nf.test.snap diff --git a/tests/pipeline/bismark/samplesheet.nf.test b/tests/pipeline/bismark/samplesheet.nf.test index 6e1534a2..ca5e29fe 100644 --- a/tests/pipeline/bismark/samplesheet.nf.test +++ b/tests/pipeline/bismark/samplesheet.nf.test @@ -5,66 +5,20 @@ nextflow_pipeline { tag "pipeline" - - test("Should ____") { + test("Should handle replicates and works") { when { params { - input = "$baseDir/tests/pipeline/bismark/assets/samplesheet.csv" - outdir = "$outputDir" + aligner = "bismark" + save_reference = true + input = "$baseDir/tests/pipeline/bismark/assets/samplesheet.csv" + outdir = "$outputDir" } } then { assertAll( - { assert workflow.success }, - // TODO Output names should be as expected - { assert snapshot(UTILS.removeNextflowVersion("$outputDir")).match("single_end_software_versions") }, - { assert snapshot(path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.flagstat"), - path("$outputDir/bwameth/alignments/samtools_stats/Ecoli.stats"), - path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.flagstat"), - path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub1.stats"), - path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.flagstat"), - path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub2.stats"), - path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.flagstat"), - path("$outputDir/bwameth/alignments/samtools_stats/SRR389222_sub3.stats"), - path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam"), - path("$outputDir/bwameth/deduplicated/Ecoli.markdup.sorted.bam.bai"), - path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam"), - path("$outputDir/bwameth/deduplicated/SRR389222_sub1.markdup.sorted.bam.bai"), - path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam"), - path("$outputDir/bwameth/deduplicated/SRR389222_sub2.markdup.sorted.bam.bai"), - path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam"), - path("$outputDir/bwameth/deduplicated/SRR389222_sub3.markdup.sorted.bam.bai"), - path("$outputDir/bwameth/reference_genome/").list(), - path("$outputDir/methyldackel/Ecoli.markdup.sorted_CpG.bedGraph"), - path("$outputDir/methyldackel/SRR389222_sub1.markdup.sorted_CpG.bedGraph"), - path("$outputDir/methyldackel/SRR389222_sub2.markdup.sorted_CpG.bedGraph"), - path("$outputDir/methyldackel/SRR389222_sub3.markdup.sorted_CpG.bedGraph"), - path("$outputDir/methyldackel/mbias/Ecoli.mbias.txt"), - path("$outputDir/methyldackel/mbias/SRR389222_sub1.mbias.txt"), - path("$outputDir/methyldackel/mbias/SRR389222_sub2.mbias.txt"), - path("$outputDir/methyldackel/mbias/SRR389222_sub3.mbias.txt"), - path("$outputDir/qualimap/Ecoli/genome_results.txt"), - path("$outputDir/qualimap/SRR389222_sub1/genome_results.txt"), - path("$outputDir/qualimap/SRR389222_sub2/genome_results.txt"), - path("$outputDir/qualimap/SRR389222_sub3/genome_results.txt")).match("single_end") }, - { assert new File("$outputDir/fastqc/Ecoli_1_fastqc.html").exists() }, - { assert new File("$outputDir/fastqc/Ecoli_2_fastqc.html").exists() }, - { assert new File("$outputDir/fastqc/SRR389222_sub1_fastqc.html").exists() }, - { assert new File("$outputDir/fastqc/SRR389222_sub2_fastqc.html").exists() }, - { assert new File("$outputDir/fastqc/SRR389222_sub3_fastqc.html").exists() }, - { assert new File("$outputDir/multiqc/bwameth/multiqc_report.html").exists() }, - { assert new File("$outputDir/trimgalore/logs/Ecoli_1.fastq.gz_trimming_report.txt").exists() }, - { assert new File("$outputDir/trimgalore/logs/Ecoli_2.fastq.gz_trimming_report.txt").exists() }, - { assert new File("$outputDir/trimgalore/logs/SRR389222_sub1.fastq.gz_trimming_report.txt").exists() }, - { assert new File("$outputDir/trimgalore/logs/SRR389222_sub2.fastq.gz_trimming_report.txt").exists() }, - { assert new File("$outputDir/trimgalore/logs/SRR389222_sub3.fastq.gz_trimming_report.txt").exists() }, - { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/Ecoli.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, - { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub1.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, - { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub2.markdup.sorted.MarkDuplicates.metrics.txt").exists() }, - { assert new File("$outputDir/bwameth/deduplicated/picard_metrics/SRR389222_sub3.markdup.sorted.MarkDuplicates.metrics.txt").exists() } + { assert workflow.success } ) } } - } diff --git a/tests/pipeline/bismark/samplesheet.nf.test.snap b/tests/pipeline/bismark/samplesheet.nf.test.snap new file mode 100644 index 00000000..916a0ad8 --- /dev/null +++ b/tests/pipeline/bismark/samplesheet.nf.test.snap @@ -0,0 +1,12 @@ +{ + "single_end_software_versions": { + "content": [ + "{BISMARK_ALIGN={bismark=0.24.0}, BISMARK_GENOMEPREPARATION={bismark=0.24.0}, FASTQC={fastqc=0.12.1}, QUALIMAP_BAMQC={qualimap=2.2.2-dev}, TRIMGALORE={trimgalore=0.6.7, cutadapt=3.4}, Workflow={nf-core/methylseq=v2.7.0dev}}" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.0" + }, + "timestamp": "2024-05-17T14:37:44.368983" + } +} \ No newline at end of file