Skip to content

Commit

Permalink
add very simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed May 17, 2024
1 parent d1c5d0e commit f36cbdf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 52 deletions.
58 changes: 6 additions & 52 deletions tests/pipeline/bismark/samplesheet.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
)
}
}

}
12 changes: 12 additions & 0 deletions tests/pipeline/bismark/samplesheet.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit f36cbdf

Please sign in to comment.