Repository: nf-core/modules
Pull request #8472: migrate nf-test for purgedups/histplot.
Author: login: hyunhwan-jeong
Labels: name: nf-test
Created: 2025-05-14T20:25:51Z | Merged: 2025-05-28T12:00:52Z

<!--
# nf-core/modules pull request

Many thanks for contributing to nf-core/modules!

Please fill in the appropriate checklist below (delete whatever is not relevant).
These are the most common things requested on pull requests (PRs).

Remember that PRs should be made against the master branch.

Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/modules/tree/master/.github/CONTRIBUTING.md)
-->

## PR checklist

Closes #7673  <!-- If this PR fixes an issue, please link it here! -->

- [ ] This comment contains a description of changes (with reason).
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] If you've added a new tool - have you followed the module conventions in the [contribution docs](https://github.com/nf-core/modules/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, include test data in your PR.
- [ ] Remove all TODO statements.
- [ ] Emit the `versions.yml` file.
- [ ] Follow the naming conventions.
- [ ] Follow the parameters requirements.
- [ ] Follow the input/output options guidelines.
- [ ] Add a resource `label`
- [ ] Use BioConda and BioContainers if possible to fulfil software requirements.
- Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
  - For modules:
    - [ ] `nf-core modules test <MODULE> --profile docker`
    - [ ] `nf-core modules test <MODULE> --profile singularity`
    - [ ] `nf-core modules test <MODULE> --profile conda`
  - For subworkflows:
    - [ ] `nf-core subworkflows test <SUBWORKFLOW> --profile docker`
    - [ ] `nf-core subworkflows test <SUBWORKFLOW> --profile singularity`
    - [ ] `nf-core subworkflows test <SUBWORKFLOW> --profile conda`


Linked issue #7673: nf-test migration: purgedups/histplot

Diff:
diff --git a/.github/skip_nf_test.json b/.github/skip_nf_test.json
index d5904da7b3ba..e8c13a23a858 100644
--- a/.github/skip_nf_test.json
+++ b/.github/skip_nf_test.json
@@ -66,6 +66,7 @@
         "modules/nf-core/molkartgarage/clahe",
         "modules/nf-core/ncbitools/vecscreen",
         "modules/nf-core/parabricks",
+        "modules/nf-core/purgedups/histplot",
         "modules/nf-core/purgedups/calcuts",
         "modules/nf-core/purgedups/getseqs",
         "modules/nf-core/purgedups/purgedups",
diff --git a/modules/nf-core/purgedups/calcuts/main.nf b/modules/nf-core/purgedups/calcuts/main.nf
index 860336f7d463..e3359ce0ee96 100644
--- a/modules/nf-core/purgedups/calcuts/main.nf
+++ b/modules/nf-core/purgedups/calcuts/main.nf
@@ -4,8 +4,8 @@ process PURGEDUPS_CALCUTS {
 
     conda "${moduleDir}/environment.yml"
     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
-        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--h7132678_0':
-        'biocontainers/purge_dups:1.2.6--h7132678_0' }"
+        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--py39h7132678_1':
+        'biocontainers/purge_dups:1.2.6--py39h7132678_1' }"
 
     input:
     tuple val(meta), path(stat)
@@ -24,12 +24,13 @@ process PURGEDUPS_CALCUTS {
     }
     def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     calcuts $args $stat > ${prefix}.cutoffs 2> >(tee ${prefix}.calcuts.log >&2)
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        purgedups: \$( purge_dups -h |& sed '3!d; s/.*: //' )
+        purgedups: $VERSION
     END_VERSIONS
     """
 
@@ -38,14 +39,14 @@ process PURGEDUPS_CALCUTS {
         error "PURGEDUPS modules give segmentation faults when testing using conda and so are currently not recommended"
     }
     def prefix = task.ext.prefix ?: "${meta.id}"
-
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version ( \$( purge_dups -h |& sed '3!d; s/.*: //' ))
     """
     touch "${prefix}.cutoffs"
     touch "${prefix}.calcuts.log"
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        purgedups: \$( purge_dups -h |& sed '3!d; s/.*: //' )
+        purgedups: $VERSION
     END_VERSIONS
     """
 }
diff --git a/modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap b/modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap
index 8ac60939bf82..2aa827152924 100644
--- a/modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap
+++ b/modules/nf-core/purgedups/calcuts/tests/main.nf.test.snap
@@ -19,7 +19,7 @@
                     ]
                 ],
                 "2": [
-                    "versions.yml:md5,df5b856012c4a77707e608b2a73f6dde"
+                    "versions.yml:md5,51bda5d1a043a097989a4c8de60cc06e"
                 ],
                 "cutoff": [
                     [
@@ -38,15 +38,15 @@
                     ]
                 ],
                 "versions": [
-                    "versions.yml:md5,df5b856012c4a77707e608b2a73f6dde"
+                    "versions.yml:md5,51bda5d1a043a097989a4c8de60cc06e"
                 ]
             }
         ],
         "meta": {
             "nf-test": "0.9.2",
-            "nextflow": "24.10.5"
+            "nextflow": "25.04.2"
         },
-        "timestamp": "2025-05-27T14:28:04.037534617"
+        "timestamp": "2025-05-27T20:05:32.850702786"
     },
     "test_purgedups_calcuts -- stub": {
         "content": [
@@ -68,7 +68,7 @@
                     ]
                 ],
                 "2": [
-                    "versions.yml:md5,df5b856012c4a77707e608b2a73f6dde"
+                    "versions.yml:md5,51bda5d1a043a097989a4c8de60cc06e"
                 ],
                 "cutoff": [
                     [
@@ -87,19 +87,19 @@
                     ]
                 ],
                 "versions": [
-                    "versions.yml:md5,df5b856012c4a77707e608b2a73f6dde"
+                    "versions.yml:md5,51bda5d1a043a097989a4c8de60cc06e"
                 ]
             },
             {
                 "PURGEDUPS_CALCUTS": {
-                    "purgedups": "1.2.5"
+                    "purgedups": "1.2.6"
                 }
             }
         ],
         "meta": {
             "nf-test": "0.9.2",
-            "nextflow": "24.10.5"
+            "nextflow": "25.04.2"
         },
-        "timestamp": "2025-05-27T14:29:03.022300283"
+        "timestamp": "2025-05-27T20:05:43.920280157"
     }
 }
\ No newline at end of file
diff --git a/modules/nf-core/purgedups/getseqs/main.nf b/modules/nf-core/purgedups/getseqs/main.nf
index 45d6962ba164..06048947d8eb 100644
--- a/modules/nf-core/purgedups/getseqs/main.nf
+++ b/modules/nf-core/purgedups/getseqs/main.nf
@@ -4,8 +4,8 @@ process PURGEDUPS_GETSEQS {
 
     conda "${moduleDir}/environment.yml"
     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
-        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--h7132678_0':
-        'biocontainers/purge_dups:1.2.6--h7132678_0' }"
+        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--py39h7132678_1':
+        'biocontainers/purge_dups:1.2.6--py39h7132678_1' }"
 
     input:
     tuple val(meta), path(assembly), path(bed)
@@ -21,6 +21,7 @@ process PURGEDUPS_GETSEQS {
     script:
     def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     get_seqs \\
         $args \\
@@ -30,19 +31,20 @@ process PURGEDUPS_GETSEQS {
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        purgedups: \$( purge_dups -h |& sed '3!d; s/.*: //' )
+        purgedups: $VERSION
     END_VERSIONS
     """
 
     stub:
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     touch "${prefix}.hap.fa"
     touch "${prefix}.purged.fa"
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        purgedups: \$( purge_dups -h |& sed '3!d; s/.*: //' )
+        purgedups: $VERSION
     END_VERSIONS
     """
 }
diff --git a/modules/nf-core/purgedups/getseqs/tests/main.nf.test.snap b/modules/nf-core/purgedups/getseqs/tests/main.nf.test.snap
index a7d0b0ed993b..fb7aae4192a1 100644
--- a/modules/nf-core/purgedups/getseqs/tests/main.nf.test.snap
+++ b/modules/nf-core/purgedups/getseqs/tests/main.nf.test.snap
@@ -11,14 +11,14 @@
                 ]
             ],
             [
-                "versions.yml:md5,43ab55fc84c41b3389c63ace97f41d17"
+                "versions.yml:md5,b90c276c7772a85ec0e874dc3fc37e62"
             ]
         ],
         "meta": {
             "nf-test": "0.9.2",
-            "nextflow": "24.10.5"
+            "nextflow": "25.04.2"
         },
-        "timestamp": "2025-05-27T14:54:33.225262352"
+        "timestamp": "2025-05-27T14:17:52.695197687"
     },
     "sarcov2 - fasta - bed -- stub": {
         "content": [
@@ -40,7 +40,7 @@
                     ]
                 ],
                 "2": [
-                    "versions.yml:md5,43ab55fc84c41b3389c63ace97f41d17"
+                    "versions.yml:md5,b90c276c7772a85ec0e874dc3fc37e62"
                 ],
                 "haplotigs": [
                     [
@@ -59,19 +59,19 @@
                     ]
                 ],
                 "versions": [
-                    "versions.yml:md5,43ab55fc84c41b3389c63ace97f41d17"
+                    "versions.yml:md5,b90c276c7772a85ec0e874dc3fc37e62"
                 ]
             },
             {
                 "PURGEDUPS_GETSEQS": {
-                    "purgedups": "1.2.5"
+                    "purgedups": "1.2.6"
                 }
             }
         ],
         "meta": {
             "nf-test": "0.9.2",
-            "nextflow": "24.10.5"
+            "nextflow": "25.04.2"
         },
-        "timestamp": "2025-05-27T14:40:38.103605591"
+        "timestamp": "2025-05-27T14:18:03.478972676"
     }
 }
\ No newline at end of file
diff --git a/modules/nf-core/purgedups/histplot/main.nf b/modules/nf-core/purgedups/histplot/main.nf
index 958fead0649b..7d3d53ece6b6 100644
--- a/modules/nf-core/purgedups/histplot/main.nf
+++ b/modules/nf-core/purgedups/histplot/main.nf
@@ -18,8 +18,13 @@ process PURGEDUPS_HISTPLOT {
     task.ext.when == null || task.ext.when
 
     script:
+    // Exit if running this module with -profile conda / -profile mamba
+    if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
+        error "PURGEDUPS modules give segmentation faults when testing using conda and is so is not currently recommended"
+    }
     def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     hist_plot.py \\
         -c $cutoff \\
@@ -29,19 +34,19 @@ process PURGEDUPS_HISTPLOT {
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        hist_plot : \$( hist_plot.py -v | sed 's/hist_plot //' )
+        purgedups: $VERSION
     END_VERSIONS
     """
 
     stub:
-    def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     touch ${prefix}.png
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        hist_plot : \$( hist_plot.py -v | sed 's/hist_plot //' )
+        purgedups: $VERSION
     END_VERSIONS
     """
 }
diff --git a/modules/nf-core/purgedups/histplot/meta.yml b/modules/nf-core/purgedups/histplot/meta.yml
index f4215c497695..3e1e43b41199 100644
--- a/modules/nf-core/purgedups/histplot/meta.yml
+++ b/modules/nf-core/purgedups/histplot/meta.yml
@@ -25,10 +25,12 @@ input:
         type: file
         description: A Purge dups statistic file
         pattern: "*.stat"
+        ontologies: []
     - cutoff:
         type: file
         description: A Purge dups cutoff file
         pattern: "*.cutoffs"
+        ontologies: []
 output:
   - png:
       - meta:
@@ -40,11 +42,14 @@ output:
           type: file
           description: A png file of the read depth coverage.
           pattern: "*.png"
+          ontologies: []
   - versions:
       - versions.yml:
           type: file
           description: File containing software versions
           pattern: "versions.yml"
+          ontologies:
+            - edam: http://edamontology.org/format_3750 # YAML
 authors:
   - "@mahesh-panchal"
 maintainers:
diff --git a/modules/nf-core/purgedups/histplot/tests/main.nf.test b/modules/nf-core/purgedups/histplot/tests/main.nf.test
new file mode 100644
index 000000000000..f8f6192fe524
--- /dev/null
+++ b/modules/nf-core/purgedups/histplot/tests/main.nf.test
@@ -0,0 +1,78 @@
+nextflow_process {
+
+    name "Test Process PURGEDUPS_HISTPLOT"
+    script "../main.nf"
+    process "PURGEDUPS_HISTPLOT"
+
+    tag "modules"
+    tag "modules_nfcore"
+    tag "purgedups"
+    tag "purgedups/pbcstat"
+    tag "purgedups/calcuts"
+    tag "purgedups/histplot"
+
+    setup {
+        run("PURGEDUPS_PBCSTAT") {
+            script "../../pbcstat/main.nf"
+
+            process {
+                """
+                input[0] = [[ id:'test' ],
+                    file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.paf', checkIfExists:true)
+                    ]
+                """
+            }
+        }
+
+        run("PURGEDUPS_CALCUTS") {
+            script "../../calcuts/main.nf"
+
+            process {
+                """
+                input[0] = PURGEDUPS_PBCSTAT.out.stat
+                """
+            }
+        }
+    }
+
+    test("purgedups_histplot") {
+
+        when {
+            process {
+                """
+                input[0] = PURGEDUPS_PBCSTAT.out.stat.join(PURGEDUPS_CALCUTS.out.cutoff)
+                """
+            }
+        }
+        then {
+            assert process.success
+            assertAll(
+                { assert snapshot(
+                    process.out,
+                    path(process.out.versions[0]).yaml
+                    ).match() }
+            )
+        }
+    }
+
+
+    test("purgedups_histplot -- stub") {
+        options '-stub'
+        when {
+            process {
+                """
+                input[0] = PURGEDUPS_PBCSTAT.out.stat.join(PURGEDUPS_CALCUTS.out.cutoff)
+                """
+            }
+        }
+        then {
+            assert process.success
+            assertAll(
+                { assert snapshot(
+                    process.out,
+                    path(process.out.versions[0]).yaml
+                    ).match() }
+            )
+        }
+    }
+}
\ No newline at end of file
diff --git a/modules/nf-core/purgedups/histplot/tests/main.nf.test.snap b/modules/nf-core/purgedups/histplot/tests/main.nf.test.snap
new file mode 100644
index 000000000000..eac81dc23bb0
--- /dev/null
+++ b/modules/nf-core/purgedups/histplot/tests/main.nf.test.snap
@@ -0,0 +1,78 @@
+{
+    "purgedups_histplot -- stub": {
+        "content": [
+            {
+                "0": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.png:md5,d41d8cd98f00b204e9800998ecf8427e"
+                    ]
+                ],
+                "1": [
+                    "versions.yml:md5,55bfa40b85b825727dcad72763e859be"
+                ],
+                "png": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.png:md5,d41d8cd98f00b204e9800998ecf8427e"
+                    ]
+                ],
+                "versions": [
+                    "versions.yml:md5,55bfa40b85b825727dcad72763e859be"
+                ]
+            },
+            {
+                "PURGEDUPS_HISTPLOT": {
+                    "purgedups": "1.2.6"
+                }
+            }
+        ],
+        "meta": {
+            "nf-test": "0.9.2",
+            "nextflow": "25.04.2"
+        },
+        "timestamp": "2025-05-27T14:18:38.477726704"
+    },
+    "purgedups_histplot": {
+        "content": [
+            {
+                "0": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.png:md5,59c0f25a2f83b244be096a4e9e77cc42"
+                    ]
+                ],
+                "1": [
+                    "versions.yml:md5,55bfa40b85b825727dcad72763e859be"
+                ],
+                "png": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.png:md5,59c0f25a2f83b244be096a4e9e77cc42"
+                    ]
+                ],
+                "versions": [
+                    "versions.yml:md5,55bfa40b85b825727dcad72763e859be"
+                ]
+            },
+            {
+                "PURGEDUPS_HISTPLOT": {
+                    "purgedups": "1.2.6"
+                }
+            }
+        ],
+        "meta": {
+            "nf-test": "0.9.2",
+            "nextflow": "25.04.2"
+        },
+        "timestamp": "2025-05-27T14:23:36.964978252"
+    }
+}
\ No newline at end of file
diff --git a/modules/nf-core/purgedups/pbcstat/main.nf b/modules/nf-core/purgedups/pbcstat/main.nf
index 7a4a33930f3d..20e2552af0d5 100644
--- a/modules/nf-core/purgedups/pbcstat/main.nf
+++ b/modules/nf-core/purgedups/pbcstat/main.nf
@@ -4,8 +4,8 @@ process PURGEDUPS_PBCSTAT {
 
     conda "${moduleDir}/environment.yml"
     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
-        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--h7132678_0':
-        'biocontainers/purge_dups:1.2.6--h7132678_0' }"
+        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--py39h7132678_1':
+        'biocontainers/purge_dups:1.2.6--py39h7132678_1' }"
 
     input:
     tuple val(meta), path(paf_alignment)
@@ -21,6 +21,7 @@ process PURGEDUPS_PBCSTAT {
     script:
     def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     pbcstat \\
         $args \\
@@ -30,7 +31,19 @@ process PURGEDUPS_PBCSTAT {
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        purgedups: \$( purge_dups -h |& sed '3!d; s/.*: //' )
+        purgedups: $VERSION
+    END_VERSIONS
+    """
+    stub:
+    def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
+    """
+    touch ${prefix}.PB.base.cov
+    touch ${prefix}.PB.stat
+
+    cat <<-END_VERSIONS > versions.yml
+    "${task.process}":
+        purgedups: $VERSION
     END_VERSIONS
     """
 }
diff --git a/modules/nf-core/purgedups/pbcstat/tests/main.nf.test b/modules/nf-core/purgedups/pbcstat/tests/main.nf.test
index 29598cd9b0d9..bd4d93a4d271 100644
--- a/modules/nf-core/purgedups/pbcstat/tests/main.nf.test
+++ b/modules/nf-core/purgedups/pbcstat/tests/main.nf.test
@@ -10,16 +10,34 @@ nextflow_process {
     tag "purgedups"
     tag "purgedups/pbcstat"
 
-    test("test-purgedups-pbcstat") {
-        
+    test("purgedups-pbcstat") {
+
         when {
             process {
                 """
-                input[0] = [
-				[ id:'test', single_end:false ], // meta map
-				file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.paf', checkIfExists: true)
+                input[0] = [[ id:'test' ],
+				    file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.paf', checkIfExists: true)
 				]
+                """
+            }
+        }
 
+        then {
+            assertAll(
+                { assert process.success },
+                { assert snapshot(process.out).match() }
+            )
+        }
+    }
+
+    test("purgedups-pbcstat - stub") {
+        options '-stub'
+        when {
+            process {
+                """
+                input[0] = [[ id:'test' ],
+				    file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.paf', checkIfExists: true)
+				]
                 """
             }
         }
@@ -31,5 +49,5 @@ nextflow_process {
             )
         }
     }
-    
+
 }
diff --git a/modules/nf-core/purgedups/pbcstat/tests/main.nf.test.snap b/modules/nf-core/purgedups/pbcstat/tests/main.nf.test.snap
index 00ddb0616bef..96e4653627cd 100644
--- a/modules/nf-core/purgedups/pbcstat/tests/main.nf.test.snap
+++ b/modules/nf-core/purgedups/pbcstat/tests/main.nf.test.snap
@@ -1,12 +1,11 @@
 {
-    "test-purgedups-pbcstat": {
+    "purgedups-pbcstat": {
         "content": [
             {
                 "0": [
                     [
                         {
-                            "id": "test",
-                            "single_end": false
+                            "id": "test"
                         },
                         "test.PB.stat:md5,51e126445de86be9812e4b291f869f9c"
                     ]
@@ -14,20 +13,18 @@
                 "1": [
                     [
                         {
-                            "id": "test",
-                            "single_end": false
+                            "id": "test"
                         },
                         "test.PB.base.cov:md5,fe8c98de33f46406c239cc9a1e124a38"
                     ]
                 ],
                 "2": [
-                    "versions.yml:md5,fe831cb8cfe7b32de33d4836f5c34fd5"
+                    "versions.yml:md5,aba13241f82fb9bd399e4135c3ad4a62"
                 ],
                 "basecov": [
                     [
                         {
-                            "id": "test",
-                            "single_end": false
+                            "id": "test"
                         },
                         "test.PB.base.cov:md5,fe8c98de33f46406c239cc9a1e124a38"
                     ]
@@ -35,21 +32,69 @@
                 "stat": [
                     [
                         {
-                            "id": "test",
-                            "single_end": false
+                            "id": "test"
                         },
                         "test.PB.stat:md5,51e126445de86be9812e4b291f869f9c"
                     ]
                 ],
                 "versions": [
-                    "versions.yml:md5,fe831cb8cfe7b32de33d4836f5c34fd5"
+                    "versions.yml:md5,aba13241f82fb9bd399e4135c3ad4a62"
                 ]
             }
         ],
         "meta": {
-            "nf-test": "0.8.4",
-            "nextflow": "24.04.4"
+            "nf-test": "0.9.2",
+            "nextflow": "25.04.2"
         },
-        "timestamp": "2024-08-23T16:20:14.330937"
+        "timestamp": "2025-05-27T13:30:46.768467679"
+    },
+    "purgedups-pbcstat - stub": {
+        "content": [
+            {
+                "0": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.PB.stat:md5,d41d8cd98f00b204e9800998ecf8427e"
+                    ]
+                ],
+                "1": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.PB.base.cov:md5,d41d8cd98f00b204e9800998ecf8427e"
+                    ]
+                ],
+                "2": [
+                    "versions.yml:md5,aba13241f82fb9bd399e4135c3ad4a62"
+                ],
+                "basecov": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.PB.base.cov:md5,d41d8cd98f00b204e9800998ecf8427e"
+                    ]
+                ],
+                "stat": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.PB.stat:md5,d41d8cd98f00b204e9800998ecf8427e"
+                    ]
+                ],
+                "versions": [
+                    "versions.yml:md5,aba13241f82fb9bd399e4135c3ad4a62"
+                ]
+            }
+        ],
+        "meta": {
+            "nf-test": "0.9.2",
+            "nextflow": "25.04.2"
+        },
+        "timestamp": "2025-05-27T13:30:56.646054881"
     }
 }
\ No newline at end of file
diff --git a/modules/nf-core/purgedups/purgedups/main.nf b/modules/nf-core/purgedups/purgedups/main.nf
index 8d7f90ec0b3a..542c4e80b565 100644
--- a/modules/nf-core/purgedups/purgedups/main.nf
+++ b/modules/nf-core/purgedups/purgedups/main.nf
@@ -21,7 +21,6 @@ process PURGEDUPS_PURGEDUPS {
     script:
     def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
-
     def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     purge_dups \\
diff --git a/modules/nf-core/purgedups/splitfa/main.nf b/modules/nf-core/purgedups/splitfa/main.nf
index bd5cedd0d292..c32019a77dfd 100644
--- a/modules/nf-core/purgedups/splitfa/main.nf
+++ b/modules/nf-core/purgedups/splitfa/main.nf
@@ -4,8 +4,8 @@ process PURGEDUPS_SPLITFA {
 
     conda "${moduleDir}/environment.yml"
     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
-        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--h7132678_0':
-        'biocontainers/purge_dups:1.2.6--h7132678_0' }"
+        'https://depot.galaxyproject.org/singularity/purge_dups:1.2.6--py39h7132678_1':
+        'biocontainers/purge_dups:1.2.6--py39h7132678_1' }"
 
     input:
     tuple val(meta), path(assembly)
@@ -20,12 +20,26 @@ process PURGEDUPS_SPLITFA {
     script:
     def args = task.ext.args ?: ''
     def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
     """
     split_fa $args $assembly | gzip -c > ${prefix}.split.fasta.gz
 
     cat <<-END_VERSIONS > versions.yml
     "${task.process}":
-        purgedups: \$( purge_dups -h |& sed '3!d; s/.*: //' )
+        purgedups: $VERSION
     END_VERSIONS
     """
+
+    stub:
+    def prefix = task.ext.prefix ?: "${meta.id}"
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
+    """
+    echo | gzip > ${prefix}.split.fasta.gz
+
+    cat <<-END_VERSIONS > versions.yml
+    "${task.process}":
+        purgedups: $VERSION
+    END_VERSIONS
+    """
+
 }
diff --git a/modules/nf-core/purgedups/splitfa/tests/main.nf.test b/modules/nf-core/purgedups/splitfa/tests/main.nf.test
index 33b43c0d0039..5c74e149874e 100644
--- a/modules/nf-core/purgedups/splitfa/tests/main.nf.test
+++ b/modules/nf-core/purgedups/splitfa/tests/main.nf.test
@@ -10,28 +10,50 @@ nextflow_process {
     tag "purgedups"
     tag "purgedups/splitfa"
 
-    test("test-purgedups-splitfa") {
+    test("splitfa") {
 
         when {
             process {
                 """
                 input[0] = [
-				[ id:'test' ], // meta map
+				[ id:'test' ],
 				file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
 				]
+                """
+            }
+        }
+
+        then {
+            assert process.success
+            assertAll(
+                { assert snapshot(
+                    process.out,
+                    path(process.out.versions[0]).yaml
+                    ).match() }
+            )
+        }
+    }
 
+    test("splitfa - stub") {
+        options "-stub"
+        when {
+            process {
+                """
+                input[0] = [
+				[ id:'test' ],
+				file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
+				]
                 """
             }
         }
 
         then {
+            assert process.success
             assertAll(
-                { assert process.success },
                 { assert snapshot(
-					path(process.out.split_fasta[0][1]).linesGzip[1][1..10],
-					process.out.versions
-					).match()
-				}
+                    process.out,
+                    path(process.out.versions[0]).yaml
+                    ).match() }
             )
         }
     }
diff --git a/modules/nf-core/purgedups/splitfa/tests/main.nf.test.snap b/modules/nf-core/purgedups/splitfa/tests/main.nf.test.snap
index 93d6cce2f561..f94098badf2a 100644
--- a/modules/nf-core/purgedups/splitfa/tests/main.nf.test.snap
+++ b/modules/nf-core/purgedups/splitfa/tests/main.nf.test.snap
@@ -1,15 +1,78 @@
 {
-    "test-purgedups-splitfa": {
+    "splitfa - stub": {
         "content": [
-            "TTTATACCTT",
-            [
-                "versions.yml:md5,79415a719dd7107c829e8ce0f9e30f85"
-            ]
+            {
+                "0": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.split.fasta.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
+                    ]
+                ],
+                "1": [
+                    "versions.yml:md5,814ffa40b6f009b2652aeb188e694a82"
+                ],
+                "split_fasta": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.split.fasta.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
+                    ]
+                ],
+                "versions": [
+                    "versions.yml:md5,814ffa40b6f009b2652aeb188e694a82"
+                ]
+            },
+            {
+                "PURGEDUPS_SPLITFA": {
+                    "purgedups": "1.2.6"
+                }
+            }
         ],
         "meta": {
-            "nf-test": "0.8.4",
-            "nextflow": "24.04.4"
+            "nf-test": "0.9.2",
+            "nextflow": "25.04.2"
         },
-        "timestamp": "2024-08-23T16:17:21.94648"
+        "timestamp": "2025-05-27T14:13:31.79239265"
+    },
+    "splitfa": {
+        "content": [
+            {
+                "0": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.split.fasta.gz:md5,748b710f523bed65df2dd2a34f5e60d5"
+                    ]
+                ],
+                "1": [
+                    "versions.yml:md5,814ffa40b6f009b2652aeb188e694a82"
+                ],
+                "split_fasta": [
+                    [
+                        {
+                            "id": "test"
+                        },
+                        "test.split.fasta.gz:md5,748b710f523bed65df2dd2a34f5e60d5"
+                    ]
+                ],
+                "versions": [
+                    "versions.yml:md5,814ffa40b6f009b2652aeb188e694a82"
+                ]
+            },
+            {
+                "PURGEDUPS_SPLITFA": {
+                    "purgedups": "1.2.6"
+                }
+            }
+        ],
+        "meta": {
+            "nf-test": "0.9.2",
+            "nextflow": "25.04.2"
+        },
+        "timestamp": "2025-05-27T14:13:21.524397083"
     }
 }
\ No newline at end of file
diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml
index 68a7ef774b78..4daacf24e08b 100644
--- a/tests/config/pytest_modules.yml
+++ b/tests/config/pytest_modules.yml
@@ -7,9 +7,6 @@ jupyternotebook:
 metaphlan3/metaphlan3:
   - modules/nf-core/metaphlan3/metaphlan3/**
   - tests/modules/nf-core/metaphlan3/metaphlan3/**
-purgedups/histplot:
-  - modules/nf-core/purgedups/histplot/**
-  - tests/modules/nf-core/purgedups/histplot/**
 subworkflows/fasta_index_dna:
   - subworkflows/nf-core/fasta_index_dna/**
   - tests/subworkflows/nf-core/fasta_index_dna/**
diff --git a/tests/modules/nf-core/purgedups/histplot/main.nf b/tests/modules/nf-core/purgedups/histplot/main.nf
deleted file mode 100644
index 00fc79867e6b..000000000000
--- a/tests/modules/nf-core/purgedups/histplot/main.nf
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env nextflow
-
-nextflow.enable.dsl = 2
-
-include { PURGEDUPS_PBCSTAT } from '../../../../../modules/nf-core/purgedups/pbcstat/main.nf'
-include { PURGEDUPS_CALCUTS } from '../../../../../modules/nf-core/purgedups/calcuts/main.nf'
-include { PURGEDUPS_HISTPLOT } from '../../../../../modules/nf-core/purgedups/histplot/main.nf'
-
-workflow test_purgedups_histplot {
-
-    input = [
-        [ id:'test' ], // meta map
-        file(params.test_data['sarscov2']['genome']['genome_paf'], checkIfExists: true)
-    ]
-
-    PURGEDUPS_PBCSTAT ( input )
-    PURGEDUPS_CALCUTS ( PURGEDUPS_PBCSTAT.out.stat )
-    PURGEDUPS_HISTPLOT ( PURGEDUPS_PBCSTAT.out.stat.join( PURGEDUPS_CALCUTS.out.cutoff ) )
-}
diff --git a/tests/modules/nf-core/purgedups/histplot/nextflow.config b/tests/modules/nf-core/purgedups/histplot/nextflow.config
deleted file mode 100644
index 64e35dc5e6af..000000000000
--- a/tests/modules/nf-core/purgedups/histplot/nextflow.config
+++ /dev/null
@@ -1,9 +0,0 @@
-process {
-
-    publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
-
-    withName: 'PURGEDUPS_(PBCSTAT|CALCUTS)' {
-        publishDir = [ enabled: false ]
-    }
-
-}
diff --git a/tests/modules/nf-core/purgedups/histplot/test.yml b/tests/modules/nf-core/purgedups/histplot/test.yml
deleted file mode 100644
index 428db51927db..000000000000
--- a/tests/modules/nf-core/purgedups/histplot/test.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-- name: purgedups histplot test_purgedups_histplot
-  command: nextflow run ./tests/modules/nf-core/purgedups/histplot -entry test_purgedups_histplot -c ./tests/config/nextflow.config
-  tags:
-    - purgedups/histplot
-    - purgedups
-  files:
-    - path: output/purgedups/test.png
-      # md5sums different under mamba vs container.
-    - path: output/purgedups/versions.yml


Reviews:
user: login: LouisLeNezet
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-27T15:21:25Z
user: login: SPPearce
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-27T20:05:34Z
user: login: famosab
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-28T08:13:09Z
user: login: SPPearce
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-28T08:49:14Z
user: login: famosab
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-28T08:56:16Z
user: login: LouisLeNezet
body: It seems good from my side !
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-28T11:02:45Z
user: login: famosab
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-28T11:04:22Z

Review comments:
diff_hunk: @@ -0,0 +1,79 @@
+nextflow_process {
+
+    name "Test Process PURGEDUPS_HISTPLOT"
+    script "../main.nf"
+    process "PURGEDUPS_HISTPLOT"
+
+    tag "modules"
+    tag "modules_nfcore"
+    tag "purgedups"
+    tag "purgedups/pbcstat"
+    tag "purgedups/calcuts"
+    tag "purgedups/histplot"
+
+    setup {
+        run("PURGEDUPS_PBCSTAT") {
+            script "../../pbcstat/main.nf"
+
+            process {
+                """
+                input[0] = [
+                    [id:'test'],// meta map
+                    file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.paf',checkIfExists:true)
path: modules/nf-core/purgedups/histplot/tests/main.nf.test
user: login: SPPearce
body: ```suggestion
                    file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.paf', checkIfExists:true)
```
created_at: 2025-05-15T08:27:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,79 @@
+nextflow_process {
+
+    name "Test Process PURGEDUPS_HISTPLOT"
+    script "../main.nf"
+    process "PURGEDUPS_HISTPLOT"
+
+    tag "modules"
+    tag "modules_nfcore"
+    tag "purgedups"
+    tag "purgedups/pbcstat"
+    tag "purgedups/calcuts"
+    tag "purgedups/histplot"
+
+    setup {
+        run("PURGEDUPS_PBCSTAT") {
+            script "../../pbcstat/main.nf"
+
+            process {
+                """
+                input[0] = [
+                    [id:'test'],// meta map
path: modules/nf-core/purgedups/histplot/tests/main.nf.test
user: login: SPPearce
body: ```suggestion
                    [id:'test'],
```
created_at: 2025-05-15T08:27:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,6 +65,7 @@
         "modules/nf-core/molkartgarage/clahe",
         "modules/nf-core/ncbitools/vecscreen",
         "modules/nf-core/parabricks",
+        "modules/nf-core/purgedups/histplot",
path: .github/skip_nf_test.json
user: login: LouisLeNezet
body: Do we still need those ?
created_at: 2025-05-27T15:17:48Z
author_association: CONTRIBUTOR
path: modules/nf-core/purgedups/calcuts/main.nf
user: login: LouisLeNezet
body: Shouldn't you add the version setting here ?
created_at: 2025-05-27T15:18:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,8 +18,13 @@ process PURGEDUPS_HISTPLOT {
     task.ext.when == null || task.ext.when
 
     script:
+    // Exit if running this module with -profile conda / -profile mamba
+    if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
path: modules/nf-core/purgedups/histplot/main.nf
user: login: LouisLeNezet
body: Is it still the case if we force `py39h7132678_1` in conda ?
created_at: 2025-05-27T15:19:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,12 +16,6 @@ metaphlan3/metaphlan3:
 oncocnv:
   - modules/nf-core/oncocnv/**
   - tests/modules/nf-core/oncocnv/**
-purgedups/histplot:
-  - modules/nf-core/purgedups/histplot/**
-  - tests/modules/nf-core/purgedups/histplot/**
-purgedups/purgedups:
path: tests/config/pytest_modules.yml
user: login: LouisLeNezet
body: This one should be deleted in my PR 😉 
created_at: 2025-05-27T15:21:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,12 +16,6 @@ metaphlan3/metaphlan3:
 oncocnv:
   - modules/nf-core/oncocnv/**
   - tests/modules/nf-core/oncocnv/**
-purgedups/histplot:
-  - modules/nf-core/purgedups/histplot/**
-  - tests/modules/nf-core/purgedups/histplot/**
-purgedups/purgedups:
path: tests/config/pytest_modules.yml
user: login: SPPearce
body: Sure, but it was causing this one to fail, and figured it wasn't an issue to remove here.
created_at: 2025-05-27T19:01:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -18,8 +18,13 @@ process PURGEDUPS_HISTPLOT {
     task.ext.when == null || task.ext.when
 
     script:
+    // Exit if running this module with -profile conda / -profile mamba
+    if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
path: modules/nf-core/purgedups/histplot/main.nf
user: login: SPPearce
body: Tried all 3 hashes, all fail on 1.2.6
created_at: 2025-05-27T19:02:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,6 +65,7 @@
         "modules/nf-core/molkartgarage/clahe",
         "modules/nf-core/ncbitools/vecscreen",
         "modules/nf-core/parabricks",
+        "modules/nf-core/purgedups/histplot",
path: .github/skip_nf_test.json
user: login: SPPearce
body: yes? Else it will fail on conda.
created_at: 2025-05-27T20:05:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -24,13 +24,18 @@
                 "versions": [
                     "versions.yml:md5,fe5f0849c3a13e80ccfa84329800e9b3"
                 ]
+            },
+            {
+                "PURGEDUPS_HISTPLOT": {
+                    "hist_plot": "0.0.0"
+                }
path: modules/nf-core/purgedups/histplot/tests/main.nf.test.snap
user: login: famosab
body: This is not the correct version?
created_at: 2025-05-28T08:13:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -24,13 +24,18 @@
                 "versions": [
                     "versions.yml:md5,fe5f0849c3a13e80ccfa84329800e9b3"
                 ]
+            },
+            {
+                "PURGEDUPS_HISTPLOT": {
+                    "hist_plot": "0.0.0"
+                }
path: modules/nf-core/purgedups/histplot/tests/main.nf.test.snap
user: login: SPPearce
body: Think this was a comment on an older commit?
created_at: 2025-05-28T08:49:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,14 +39,14 @@ process PURGEDUPS_CALCUTS {
         error "PURGEDUPS modules give segmentation faults when testing using conda and so are currently not recommended"
     }
     def prefix = task.ext.prefix ?: "${meta.id}"
-
+    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version
path: modules/nf-core/purgedups/calcuts/main.nf
user: login: famosab
body: Maybe we can leave the infor on how to correctly access the version here:
` \$( purge_dups -h |& sed '3!d; s/.*: //' )` in the comment.
```suggestion
    def VERSION = '1.2.6' // WARN: Incorrect version printed inside the container, please check this if bumping version ( \$( purge_dups -h |& sed '3!d; s/.*: //' ))
```
created_at: 2025-05-28T08:56:16Z
author_association: CONTRIBUTOR

PR comments:
user: login: famosab
created_at: 2025-05-20T11:28:31Z
body: See also #8473 
author_association: CONTRIBUTOR
user: login: LouisLeNezet
created_at: 2025-05-25T16:54:03Z
body: Hi @hyunhwan-jeong, do you have some times to finish this PR ?
author_association: CONTRIBUTOR
user: login: hyunhwan-jeong
created_at: 2025-05-27T18:03:31Z
body: > Hi @hyunhwan-jeong, do you have some times to finish this PR ?

Oops, it seems @SPPearce did, sorry for the late response!
author_association: CONTRIBUTOR