Skip to content

Commit

Permalink
Added version warn and trio mode test
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp committed May 22, 2024
1 parent 0e2e61c commit 99eeb50
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/nf-core/merqury/merqury/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ process MERQURY_MERQURY {
tag "$meta.id"
label 'process_low'

// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/merqury:1.3--hdfd78af_1':
Expand Down Expand Up @@ -35,7 +36,7 @@ process MERQURY_MERQURY {
script:
// def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = 1.3
def VERSION = 1.3 // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
# Nextflow changes the container --entrypoint to /bin/bash (container default entrypoint: /usr/local/env-execute)
# Check for container variable initialisation script and source it.
Expand All @@ -60,7 +61,7 @@ process MERQURY_MERQURY {

stub:
prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = 1.3
def VERSION = 1.3 // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
touch ${prefix}_only.bed
touch ${prefix}_only.wig
Expand Down
80 changes: 80 additions & 0 deletions modules/nf-core/merqury/merqury/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,86 @@ nextflow_process {

}

test("homo_sapiens-genome-trio") {

setup {
run("MERYL_COUNT", alias: "MATERNAL_COUNT") {
script "../../../meryl/count"
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['homo_sapiens']['illumina']['test2_1_fastq_gz'], checkIfExists: true)
]
]
input[1] = 21
"""
}
}

run("MERYL_COUNT", alias: "PATERNAL_COUNT") {
script "../../../meryl/count"
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['homo_sapiens']['illumina']['test2_2_fastq_gz'], checkIfExists: true)
]
]
input[1] = 21
"""
}
}
}

when {
process {
"""
ch_assembly = Channel.value([
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
])
ch_input = MERYL_UNIONSUM.out.meryl_db
| join( MATERNAL_COUNT.out.meryl_db )
| join( PATERNAL_COUNT.out.meryl_db )
| join( ch_assembly )
| map { meta, meryl, mat_meryl, pat_meryl, fasta -> [ meta, [ meryl, mat_meryl, pat_meryl ], fasta ] }
input[0] = ch_input
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.assembly_only_kmers_bed,
process.out.assembly_only_kmers_wig,
process.out.stats,
process.out.dist_hist,
process.out.spectra_cn_hist,
process.out.spectra_asm_hist,
process.out.assembly_qv,
process.out.scaffold_qv,
process.out.read_ploidy,
process.out.versions,
process.out.spectra_cn_fl_png[0][1] .collect { file(it).name }.join(','),
process.out.spectra_cn_ln_png[0][1] .collect { file(it).name }.join(','),
process.out.spectra_cn_st_png[0][1] .collect { file(it).name }.join(','),
file(process.out.spectra_asm_fl_png[0][1]).name,
file(process.out.spectra_asm_ln_png[0][1]).name,
file(process.out.spectra_asm_st_png[0][1]).name,
file(process.out.hapmers_blob_png[0][1]).name,
).match()
}
)
}

}

test("homo_sapiens-genome-stub") {

options '-stub'
Expand Down
100 changes: 100 additions & 0 deletions modules/nf-core/merqury/merqury/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,105 @@
"nextflow": "23.10.1"
},
"timestamp": "2024-05-22T21:52:39.004978"
},
"homo_sapiens-genome-trio": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"genome_only.bed:md5,b611f22cde0e410a2ca07c1eefd042d3"
]
],
[
[
{
"id": "test",
"single_end": false
},
"genome_only.wig:md5,19cf44989af72af597ef80d3489b4882"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.completeness.stats:md5,58b3933129832d64652babd80688eec3"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.dist_only.hist:md5,e2e6b54b0febef1f0fcf24cd2afd0b7a"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.genome.spectra-cn.hist:md5,6140a138ba47cb2b97814c93f80b2575"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.spectra-asm.hist:md5,541c9d1f87ab5c44df5e9e0acc440f8d"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.qv:md5,6e04952bc182221c8b9e242dc3298808"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.genome.qv:md5,c554315aabcc4207c367805cf3090da3"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.unionsum.hist.ploidy:md5,16cf2fd89ed870c9cceb269e8430169a"
]
],
[
"versions.yml:md5,825a4c61369638389227eee16dfb08b5"
],
"test.genome.read.test2_1.spectra-cn.fl.png,test.genome.read.test2_2.spectra-cn.fl.png,test.genome.spectra-cn.fl.png",
"test.genome.read.test2_1.spectra-cn.ln.png,test.genome.read.test2_2.spectra-cn.ln.png,test.genome.spectra-cn.ln.png",
"test.genome.read.test2_1.spectra-cn.st.png,test.genome.read.test2_2.spectra-cn.st.png,test.genome.spectra-cn.st.png",
"test.spectra-asm.fl.png",
"test.spectra-asm.ln.png",
"test.spectra-asm.st.png",
"test.hapmers.blob.png"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-05-23T10:37:10.601154"
}
}

0 comments on commit 99eeb50

Please sign in to comment.