From 428ae98965edacb38831f8066d36b67d6008a422 Mon Sep 17 00:00:00 2001 From: Sateesh Date: Thu, 19 Sep 2024 15:22:35 +0000 Subject: [PATCH] use nft-bam plugin - init default --- tests/default.nf.test | 83 +++++++++++++++++++++++++ tests/default.nf.test.snap | 122 +++++++++++++++++++++++++++++++++++++ tests/lib/UTILS.groovy | 2 +- 3 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 tests/default.nf.test create mode 100644 tests/default.nf.test.snap diff --git a/tests/default.nf.test b/tests/default.nf.test new file mode 100644 index 00000000..7656e037 --- /dev/null +++ b/tests/default.nf.test @@ -0,0 +1,83 @@ +nextflow_pipeline { + + name "Test Workflow main.nf" + script "../main.nf" + config "./nextflow.config" + + test("Bismark Single-End") { + when { + params { + aligner = "bismark" + save_reference = true + save_align_intermeds = true + outdir = "$outputDir" + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + bam("$outputDir/bismark/alignments/Ecoli_1_val_1_bismark_bt2_pe.bam").getReadsMD5(), + bam("$outputDir/bismark/alignments/Ecoli.sorted.bam").getReadsMD5(), + bam("$outputDir/bismark/alignments/SRR389222_sub1.sorted.bam").getReadsMD5(), + bam("$outputDir/bismark/alignments/SRR389222_sub1_trimmed_bismark_bt2.bam").getReadsMD5(), + bam("$outputDir/bismark/alignments/SRR389222_sub2.sorted.bam").getReadsMD5(), + bam("$outputDir/bismark/alignments/SRR389222_sub2_trimmed_bismark_bt2.bam").getReadsMD5(), + bam("$outputDir/bismark/alignments/SRR389222_sub3.sorted.bam").getReadsMD5(), + bam("$outputDir/bismark/alignments/SRR389222_sub3_trimmed_bismark_bt2.bam").getReadsMD5(), + + path("$outputDir/bismark/deduplicated/Ecoli_1_val_1_bismark_bt2_pe.deduplicated.bam"), + path("$outputDir/bismark/deduplicated/SRR389222_sub1_trimmed_bismark_bt2.deduplicated.bam"), + path("$outputDir/bismark/deduplicated/SRR389222_sub2_trimmed_bismark_bt2.deduplicated.bam"), + path("$outputDir/bismark/deduplicated/SRR389222_sub3_trimmed_bismark_bt2.deduplicated.bam"), + path("$outputDir/bismark/methylation_calls/bedGraph/Ecoli_1_val_1_bismark_bt2_pe.deduplicated.bedGraph.gz"), + path("$outputDir/bismark/methylation_calls/bedGraph/SRR389222_sub1_trimmed_bismark_bt2.deduplicated.bedGraph.gz"), + path("$outputDir/bismark/methylation_calls/bedGraph/SRR389222_sub2_trimmed_bismark_bt2.deduplicated.bedGraph.gz"), + path("$outputDir/bismark/methylation_calls/bedGraph/SRR389222_sub3_trimmed_bismark_bt2.deduplicated.bedGraph.gz"), + path("$outputDir/bismark/methylation_calls/mbias/Ecoli_1_val_1_bismark_bt2_pe.deduplicated.M-bias.txt"), + path("$outputDir/bismark/methylation_calls/mbias/SRR389222_sub1_trimmed_bismark_bt2.deduplicated.M-bias.txt"), + path("$outputDir/bismark/methylation_calls/mbias/SRR389222_sub2_trimmed_bismark_bt2.deduplicated.M-bias.txt"), + path("$outputDir/bismark/methylation_calls/mbias/SRR389222_sub3_trimmed_bismark_bt2.deduplicated.M-bias.txt"), + path("$outputDir/bismark/methylation_calls/methylation_coverage/Ecoli_1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz"), + path("$outputDir/bismark/methylation_calls/methylation_coverage/SRR389222_sub1_trimmed_bismark_bt2.deduplicated.bismark.cov.gz"), + path("$outputDir/bismark/methylation_calls/methylation_coverage/SRR389222_sub2_trimmed_bismark_bt2.deduplicated.bismark.cov.gz"), + path("$outputDir/bismark/methylation_calls/methylation_coverage/SRR389222_sub3_trimmed_bismark_bt2.deduplicated.bismark.cov.gz"), + path("$outputDir/bismark/methylation_calls/methylation_calls/").list(), + path("$outputDir/bismark/methylation_calls/splitting_report/Ecoli_1_val_1_bismark_bt2_pe.deduplicated_splitting_report.txt"), + path("$outputDir/bismark/methylation_calls/splitting_report/SRR389222_sub1_trimmed_bismark_bt2.deduplicated_splitting_report.txt"), + path("$outputDir/bismark/methylation_calls/splitting_report/SRR389222_sub2_trimmed_bismark_bt2.deduplicated_splitting_report.txt"), + path("$outputDir/bismark/methylation_calls/splitting_report/SRR389222_sub3_trimmed_bismark_bt2.deduplicated_splitting_report.txt"), + path("$outputDir/bismark/reference_genome/BismarkIndex/").list(), + 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 snapshot(UTILS.removeNextflowVersion("$outputDir")).match("single_end_software_versions") }, + { assert new File("$outputDir/bismark/alignments/logs/Ecoli_1_val_1_bismark_bt2_PE_report.txt").exists() }, + { assert new File("$outputDir/bismark/alignments/logs/SRR389222_sub1_trimmed_bismark_bt2_SE_report.txt").exists() }, + { assert new File("$outputDir/bismark/alignments/logs/SRR389222_sub2_trimmed_bismark_bt2_SE_report.txt").exists() }, + { assert new File("$outputDir/bismark/alignments/logs/SRR389222_sub3_trimmed_bismark_bt2_SE_report.txt").exists() }, + { assert new File("$outputDir/bismark/reports/Ecoli_1_val_1_bismark_bt2_PE_report.html").exists() }, + { assert new File("$outputDir/bismark/reports/SRR389222_sub1_trimmed_bismark_bt2_SE_report.html").exists() }, + { assert new File("$outputDir/bismark/reports/SRR389222_sub2_trimmed_bismark_bt2_SE_report.html").exists() }, + { assert new File("$outputDir/bismark/reports/SRR389222_sub3_trimmed_bismark_bt2_SE_report.html").exists() }, + { assert new File("$outputDir/bismark/summary/bismark_summary_report.html").exists() }, + { assert new File("$outputDir/bismark/summary/bismark_summary_report.txt").exists() }, + { 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/bismark/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() } + ) + } + } + +} diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap new file mode 100644 index 00000000..6344e12f --- /dev/null +++ b/tests/default.nf.test.snap @@ -0,0 +1,122 @@ +{ + "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.3 + }, + "TRIMGALORE": { + "trimgalore": "0.6.7", + "cutadapt": 3.4 + }, + "Workflow": { + "nf-core/methylseq": "v2.7.0dev" + } + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-18T19:08:58.67297311" + }, + "single_end": { + "content": [ + "fad4414ebdaafdb15e0584b393400b27", + "a54ab7c96f9523a4ccd25fd69f6905f8", + "3f11ef5fbbda3797fd6217728e4f00d3", + "934288bfc59d40ff7e73706d07815fb", + "b01f29fc1d8d46922a69df09c636b4c4", + "a94aeadc2acebd0a46647bb95acf2d55", + "347195c04c9ffd2a2b10967a6682fc69", + "6579ca7e49b9d7760ea5b3f3456739a1", + "Ecoli_1_val_1_bismark_bt2_pe.deduplicated.bam:md5,caa027599dac71c50c24de1857dbf5c7", + "SRR389222_sub1_trimmed_bismark_bt2.deduplicated.bam:md5,66b4244c9f75ee798a77b0a1e47214ea", + "SRR389222_sub2_trimmed_bismark_bt2.deduplicated.bam:md5,79e4d27508ee03d74bf4c79d23d439fd", + "SRR389222_sub3_trimmed_bismark_bt2.deduplicated.bam:md5,d627ec0448a0bba875895615b90beab6", + "Ecoli_1_val_1_bismark_bt2_pe.deduplicated.bedGraph.gz:md5,58c9ba98d0638c26a30233b006a81172", + "SRR389222_sub1_trimmed_bismark_bt2.deduplicated.bedGraph.gz:md5,d31df76c1c9128299367ebfe740357b9", + "SRR389222_sub2_trimmed_bismark_bt2.deduplicated.bedGraph.gz:md5,010f32001bbc7805f8e041f3ef0d9ea9", + "SRR389222_sub3_trimmed_bismark_bt2.deduplicated.bedGraph.gz:md5,d42e09af121ae14f6e0de5779e317b0b", + "Ecoli_1_val_1_bismark_bt2_pe.deduplicated.M-bias.txt:md5,29f3b882a51b63ce77d3d9c69b0e5f85", + "SRR389222_sub1_trimmed_bismark_bt2.deduplicated.M-bias.txt:md5,ed28b3cce432eecfae73bc4a071ec4ee", + "SRR389222_sub2_trimmed_bismark_bt2.deduplicated.M-bias.txt:md5,b06ce0084e54193ff8c9b9dd0ec9757b", + "SRR389222_sub3_trimmed_bismark_bt2.deduplicated.M-bias.txt:md5,b865b7fb6e1225feeb6aef3372ef0b1d", + "Ecoli_1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz:md5,8e6ba6fe66416d73e7f94b4da9ca77b1", + "SRR389222_sub1_trimmed_bismark_bt2.deduplicated.bismark.cov.gz:md5,5377d9fff4f1bf5b98dc2310fbeb6ec9", + "SRR389222_sub2_trimmed_bismark_bt2.deduplicated.bismark.cov.gz:md5,4713bda7b4f2bb16ce23853aea763cbd", + "SRR389222_sub3_trimmed_bismark_bt2.deduplicated.bismark.cov.gz:md5,f9a07c3e11e0caad6df3cd2e4d94d8ac", + [ + "CHG_OB_Ecoli_1_val_1_bismark_bt2_pe.deduplicated.txt.gz:md5,9c2248d95d96d6c315c65f1b8dc3bc39", + "CHG_OB_SRR389222_sub1_trimmed_bismark_bt2.deduplicated.txt.gz:md5,a10f4263bf7b9b1985b16ff3c1041240", + "CHG_OB_SRR389222_sub2_trimmed_bismark_bt2.deduplicated.txt.gz:md5,1b036ec35b09e0d3b748040381cb1fd5", + "CHG_OB_SRR389222_sub3_trimmed_bismark_bt2.deduplicated.txt.gz:md5,929b960ad908ec05687540b684106de0", + "CHG_OT_Ecoli_1_val_1_bismark_bt2_pe.deduplicated.txt.gz:md5,5e5aefaa3f63e73f30342ad843eb210b", + "CHG_OT_SRR389222_sub1_trimmed_bismark_bt2.deduplicated.txt.gz:md5,87d488061e2d43db2060a37874c346cc", + "CHG_OT_SRR389222_sub2_trimmed_bismark_bt2.deduplicated.txt.gz:md5,2013c67301066dde516bb950731fb04a", + "CHG_OT_SRR389222_sub3_trimmed_bismark_bt2.deduplicated.txt.gz:md5,e4d5f53c056424471038f28ffd49b2df", + "CHH_OB_Ecoli_1_val_1_bismark_bt2_pe.deduplicated.txt.gz:md5,65f2afc6b1c76209af1acd1d4277a1cc", + "CHH_OB_SRR389222_sub1_trimmed_bismark_bt2.deduplicated.txt.gz:md5,172b329b6aabf8d07c8255a152d4105a", + "CHH_OB_SRR389222_sub2_trimmed_bismark_bt2.deduplicated.txt.gz:md5,82e84337d3a4c5ca20260e7455c53022", + "CHH_OB_SRR389222_sub3_trimmed_bismark_bt2.deduplicated.txt.gz:md5,d06408d5bb2071ae66a4d4260a73c491", + "CHH_OT_Ecoli_1_val_1_bismark_bt2_pe.deduplicated.txt.gz:md5,978ad87fef01e39283a620253320ee45", + "CHH_OT_SRR389222_sub1_trimmed_bismark_bt2.deduplicated.txt.gz:md5,20038a010d4258a2a76aa389e05b84ba", + "CHH_OT_SRR389222_sub2_trimmed_bismark_bt2.deduplicated.txt.gz:md5,e585363a40c045ea66c16257e507d3de", + "CHH_OT_SRR389222_sub3_trimmed_bismark_bt2.deduplicated.txt.gz:md5,9b529b04d321e5fc11dcb023345fd136", + "CpG_OB_Ecoli_1_val_1_bismark_bt2_pe.deduplicated.txt.gz:md5,54def6bf13e27f38adbbd3dd06297596", + "CpG_OB_SRR389222_sub1_trimmed_bismark_bt2.deduplicated.txt.gz:md5,d581258ecd66c080c70caeea30e31ca2", + "CpG_OB_SRR389222_sub2_trimmed_bismark_bt2.deduplicated.txt.gz:md5,dee4913db39eef1e706167d6c0f0c389", + "CpG_OB_SRR389222_sub3_trimmed_bismark_bt2.deduplicated.txt.gz:md5,74a9c8092dbd8c2f27d54bb627993f90", + "CpG_OT_Ecoli_1_val_1_bismark_bt2_pe.deduplicated.txt.gz:md5,9712eef973883f44dcc0a307af28ba70", + "CpG_OT_SRR389222_sub1_trimmed_bismark_bt2.deduplicated.txt.gz:md5,ff50e21971733216ea1315ba772bef09", + "CpG_OT_SRR389222_sub2_trimmed_bismark_bt2.deduplicated.txt.gz:md5,94302d0daeb2b275b015622a9a10ac25", + "CpG_OT_SRR389222_sub3_trimmed_bismark_bt2.deduplicated.txt.gz:md5,e2fb1e0f57f5eaf10347b1221e6cd47c" + ], + "Ecoli_1_val_1_bismark_bt2_pe.deduplicated_splitting_report.txt:md5,b759f31785293e8d952f1dd3246f9a7b", + "SRR389222_sub1_trimmed_bismark_bt2.deduplicated_splitting_report.txt:md5,d70ee229a29b68db8634fa7d568b7c53", + "SRR389222_sub2_trimmed_bismark_bt2.deduplicated_splitting_report.txt:md5,6cc81c365aa59992d510cdce467230d6", + "SRR389222_sub3_trimmed_bismark_bt2.deduplicated_splitting_report.txt:md5,13883f84bb3b1cec4593541749571c12", + [ + [ + [ + "BS_CT.1.bt2:md5,d53bef7d951c7d08e327944581c911eb", + "BS_CT.2.bt2:md5,752a03fc364115fc910e5a28ae154382", + "BS_CT.3.bt2:md5,b41e72eefad74e8ede411c78a5bd5dee", + "BS_CT.4.bt2:md5,02b3d1855a67fd9cbb4c411406a22fde", + "BS_CT.rev.1.bt2:md5,52ae603fff473b3b25eecd36c533edb9", + "BS_CT.rev.2.bt2:md5,0e290e05f7dae065cae54e29ed97afe5", + "genome_mfa.CT_conversion.fa:md5,4dd181b65f1f3549f4132c9a3759eee8" + ], + [ + "BS_GA.1.bt2:md5,9aff51b1712758b891b0c427a988977f", + "BS_GA.2.bt2:md5,579241d95941538b2e75bbdb6cfaa73d", + "BS_GA.3.bt2:md5,b41e72eefad74e8ede411c78a5bd5dee", + "BS_GA.4.bt2:md5,6b64fa496ffa2af2af235e1c87f06a25", + "BS_GA.rev.1.bt2:md5,dabf2d6f80ba7e8fc96dfdc203f6bbfd", + "BS_GA.rev.2.bt2:md5,fac2f8b39b0e15dec7aa79a0ecf12b49", + "genome_mfa.GA_conversion.fa:md5,3dee732bc344fd620c3a7322f52c6a5f" + ] + ], + "genome.fa:md5,923a0a268ad29fee3c3437d00f9970de" + ], + "genome_results.txt:md5,886ffc763d05a84ead7f80a1d1db1fa2", + "genome_results.txt:md5,79287f69ff6c8a308f0bb988c97f0e15", + "genome_results.txt:md5,7838069da6060f756821c776cc3a4929", + "genome_results.txt:md5,41aa314da188306ead441ddcb14f79b2" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-18T19:11:13.763004169" + } +} diff --git a/tests/lib/UTILS.groovy b/tests/lib/UTILS.groovy index deacb586..73652fb9 100644 --- a/tests/lib/UTILS.groovy +++ b/tests/lib/UTILS.groovy @@ -1,7 +1,7 @@ // Function to remove Nextflow version from software_versions.yml class UTILS { - public static String removeNextflowVersion(outputDir) { + public static Object removeNextflowVersion(outputDir) { def softwareVersions = path("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml").yaml if (softwareVersions.containsKey("Workflow")) { softwareVersions.Workflow.remove("Nextflow")