Skip to content

Commit

Permalink
Add nf-tests for markdup module
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Apr 30, 2024
1 parent 6bb6f20 commit 1c47bc9
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/markdup/sambamba/main.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
params.sambambaVersion = '0.7.1'
params.container = "grapenf/sambamba:${params.sambambaVersion}"
params.sambambaVersion = '0.7.1--h984e79f_3'
params.container = "quay.io/biocontainers/sambamba:${params.sambambaVersion}"

process markdup {

Expand All @@ -17,7 +17,7 @@ process markdup {
script:
memory = (task.memory ?: 2.GB).toMega()
prefix = "${bam.baseName}.markdup"

def cmd = []
cmd << """\
sambamba markdup -t ${task.cpus} \\
Expand All @@ -31,4 +31,4 @@ process markdup {
sambamba index ${prefix}.bam""".stripIndent()

cmd.join('\n')
}
}
30 changes: 30 additions & 0 deletions tests/modules/markdup/sambamba/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
nextflow_process {

name "Test Process markdup"
script "modules/markdup/sambamba/main.nf"
process "markdup"

test("Should mark duplicates using sambamba") {

when {
params {
// define parameters here. Example:
// outdir = "tests/results"
}
process {
"""
input[0] = Channel.from([
[ "sample3", "test3", file("${baseDir}/data/sample3_m4_n10_toGenome.bam"), "bam", "GenomeAlignments", true]
])
"""
}
}

then {
assert process.success
assert snapshot(process.out).match()
}

}

}
53 changes: 53 additions & 0 deletions tests/modules/markdup/sambamba/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"Should mark duplicates using sambamba": {
"content": [
{
"0": [
[
"sample3",
"test3",
"sample3_m4_n10_toGenome.markdup.bam:md5,c720dedc6b6d94a7a507543fd44b1e3a",
"bam",
"GenomeAlignments",
true
]
],
"1": [
[
"sample3",
"test3",
"sample3_m4_n10_toGenome.markdup.bam.bai:md5,9696c48348b5e0d26d4c45a211fc9bdd",
"bai",
"GenomeAlignmentsIndex",
true
]
],
"dedupedAlignments": [
[
"sample3",
"test3",
"sample3_m4_n10_toGenome.markdup.bam:md5,c720dedc6b6d94a7a507543fd44b1e3a",
"bam",
"GenomeAlignments",
true
]
],
"dedupedAlignmentsIndices": [
[
"sample3",
"test3",
"sample3_m4_n10_toGenome.markdup.bam.bai:md5,9696c48348b5e0d26d4c45a211fc9bdd",
"bai",
"GenomeAlignmentsIndex",
true
]
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-30T19:38:12.840625"
}
}

0 comments on commit 1c47bc9

Please sign in to comment.