Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions modules/msk/phylowgs/multievolve/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ process PHYLOWGS_MULTIEVOLVE {

output:
tuple val(meta), path("chains/trees.zip") , emit: trees
tuple val(meta), path("*.summ.json.gz") , emit: summ
tuple val(meta), path("*.muts.json.gz") , emit: muts
tuple val(meta), path("*.mutass.zip") , emit: mutass
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
Expand All @@ -26,6 +30,16 @@ process PHYLOWGS_MULTIEVOLVE {
--ssms ${ssm_data} \\
--cnvs ${cnv_data}

python2 \\
/usr/bin/phylowgs/write_results.py \\
${args2} \\
--include-ssm-names \\
${prefix} \\
chains/trees.zip \\
${prefix}.summ.json.gz \\
${prefix}.muts.json.gz \\
${prefix}.mutass.zip

cat <<-END_VERSIONS > versions.yml
"${task.process}":
phylowgs: \$PHYLOWGS_TAG
Expand All @@ -34,10 +48,14 @@ process PHYLOWGS_MULTIEVOLVE {

stub:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir chains
touch chains/trees.zip
touch ${prefix}.summ.json.gz
touch ${prefix}.muts.json.gz
touch ${prefix}.mutass.zip

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
30 changes: 30 additions & 0 deletions modules/msk/phylowgs/multievolve/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,36 @@ output:
type: file
description: Zip file containing the completed trees
pattern: "trees.zip"
- summ:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.summ.json.gz":
type: file
description: Output file for JSON-formatted tree summaries
pattern: "*.summ.json.gz"
- muts:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.muts.json.gz":
type: file
description: Output file for JSON-formatted list of mutations
pattern: "*.muts.json.gz"
- mutass:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.mutass.zip":
type: file
description: Output file for JSON-formatted list of SSMs and CNVs
pattern: "*.mutass.zip"
- versions:
- versions.yml:
type: file
Expand Down
10 changes: 8 additions & 2 deletions modules/msk/phylowgs/multievolve/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.trees[0][1]).name).match() }
{ assert snapshot(file(process.out.trees[0][1]).name,
file(process.out.summ[0][1]).name,
file(process.out.muts[0][1]).name,
file(process.out.mutass[0][1]).name).match() }

)
}
Expand All @@ -54,7 +57,10 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(file(process.out.trees[0][1]).name,
file(process.out.summ[0][1]).name,
file(process.out.muts[0][1]).name,
file(process.out.mutass[0][1]).name).match() }

)
}
Expand Down
47 changes: 18 additions & 29 deletions modules/msk/phylowgs/multievolve/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
{
"phylowgs_multievolve - zip": {
"content": [
"trees.zip"
"trees.zip",
"test.summ.json.gz",
"test.muts.json.gz",
"test.mutass.zip"
],
"timestamp": "2024-06-11T18:01:56.174868"
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.4"
},
"timestamp": "2026-06-04T11:48:34.725751"
},
"phylowgs_multievolve - zip - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"trees.zip:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,2eaafdf0e85898fdc2e5d40dbbfee2f7"
],
"trees": [
[
{
"id": "test",
"single_end": false
},
"trees.zip:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,2eaafdf0e85898fdc2e5d40dbbfee2f7"
]
}
"trees.zip",
"test.summ.json.gz",
"test.muts.json.gz",
"test.mutass.zip"
],
"timestamp": "2024-06-11T18:02:03.678335"
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.4"
},
"timestamp": "2026-06-04T11:56:11.007179"
}
}
10 changes: 3 additions & 7 deletions subworkflows/msk/phylowgs/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ workflow PHYLOWGS {

ch_versions = ch_versions.mix(PHYLOWGS_MULTIEVOLVE.out.versions)

PHYLOWGS_WRITERESULTS(PHYLOWGS_MULTIEVOLVE.out.trees)

ch_versions = ch_versions.mix(PHYLOWGS_WRITERESULTS.out.versions)


emit:

summ = PHYLOWGS_WRITERESULTS.out.summ // channel: [ val(meta), [ summ ] ]
muts = PHYLOWGS_WRITERESULTS.out.muts // channel: [ val(meta), [ muts ] ]
mutass = PHYLOWGS_WRITERESULTS.out.mutass // channel: [ val(meta), [ mutass ] ]
summ = PHYLOWGS_MULTIEVOLVE.out.summ // channel: [ val(meta), [ summ ] ]
muts = PHYLOWGS_MULTIEVOLVE.out.muts // channel: [ val(meta), [ muts ] ]
mutass = PHYLOWGS_MULTIEVOLVE.out.mutass // channel: [ val(meta), [ mutass ] ]
versions = ch_versions // channel: [ versions.yml ]
}

Expand Down
Loading