Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update decoupler #7068

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions modules/nf-core/decoupler/decoupler/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
# renovate: datasource=conda depName=conda-forge/decoupler-py
- conda-forge::decoupler-py=1.8.0
38 changes: 29 additions & 9 deletions modules/nf-core/decoupler/decoupler/main.nf
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
process DECOUPLER {
tag "$meta.id"
tag "${meta.id}"
label 'process_medium'

conda "conda-forge::decoupler-py=1.6.0"
container = "ghcr.io/saezlab/publish-packages/decoupler:sha-5838309"
conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/cf/cf3578c5f4a5ad40d10b535d496daa29f47e908fbbbc789f85e3341b8f9341ba/data'
: 'community.wave.seqera.io/library/decoupler-py:1.8.0--b139c6574c0ac2a6'}"

input:
tuple val(meta), path(mat)
path(net)
path net

output:
tuple val(meta), path("*estimate__decoupler.tsv"), emit: dc_estimate
tuple val(meta), path("*pvals__decoupler.tsv"), emit: dc_pvals
path("versions.yml"), emit: versions
tuple val(meta), path("*estimate__decoupler.tsv") , emit: dc_estimate
tuple val(meta), path("*pvals__decoupler.tsv") , emit: dc_pvals
path("versions.yml") , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -66,6 +67,25 @@ process DECOUPLER {
## VERSIONS FILE
with open('versions.yml', 'a') as version_file:
version_file.write('"${task.process}":' + "\\n")
version_file.write("\tdecoupler-py: " + dc.__version__ + "\\n")
version_file.write(f" decoupler-py: {dc.__version__}\\n")
"""

stub:
"""
#!/usr/bin/env python3
import decoupler as dc

## dc_estimate
with open('consensus_estimate__decoupler.tsv', 'a') as tsv_file:
tsv_file.write('')

## dc_pvals
with open('consensus_pvals__decoupler.tsv', 'a') as tsv_file:
tsv_file.write('')

## VERSIONS FILE
with open('versions.yml', 'a') as version_file:
version_file.write('"${task.process}":' + "\\n")
version_file.write(f" decoupler-py: {dc.__version__}\\n")
"""
}
34 changes: 31 additions & 3 deletions modules/nf-core/decoupler/decoupler/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,38 @@ nextflow_process {
"""
input[0] = [
[ id: 'test' ],
file(params.test_data['generic']['tsv']['expression'], checkIfExists: true)
file(params.modules_testdata_base_path + 'generic/tsv/expression.tsv', checkIfExists: true)
]
input[1] = [
file(params.test_data['generic']['tsv']['network'], checkIfExists: true)
file(params.modules_testdata_base_path + 'generic/tsv/network.tsv', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert snapshot(path(process.out.versions.get(0)).yaml).match("versions") },
)
}

}

test("decoupler_test - stub") {

options '-stub'

when {
process {
"""
input[0] = [
[ id: 'test' ],
file(params.modules_testdata_base_path + 'generic/tsv/expression.tsv', checkIfExists: true)
]
input[1] = [
file(params.modules_testdata_base_path + 'generic/tsv/network.tsv', checkIfExists: true)
]
"""
}
Expand All @@ -35,4 +63,4 @@ nextflow_process {

}

}
}
101 changes: 82 additions & 19 deletions modules/nf-core/decoupler/decoupler/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,67 @@
{
"decoupler_test - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"consensus_estimate__decoupler.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"consensus_pvals__decoupler.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,8fd115b4099050429b348981ca1d5e86"
],
"dc_estimate": [
[
{
"id": "test"
},
"consensus_estimate__decoupler.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"dc_pvals": [
[
{
"id": "test"
},
"consensus_pvals__decoupler.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,8fd115b4099050429b348981ca1d5e86"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-25T11:03:58.583432"
},
"versions": {
"content": [
{
"DECOUPLER": {
"decoupler-py": "1.8.0"
}
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-11-22T15:53:36.673249"
},
"decoupler_test": {
"content": [
{
Expand All @@ -8,10 +71,10 @@
"id": "test"
},
[
"consensus_estimate__decoupler.tsv:md5,f762d3282a81c61b127e97d044e9ddd7",
"mlm_estimate__decoupler.tsv:md5,ce7ce3c710fe188035b6706512ffbf54",
"ulm_estimate__decoupler.tsv:md5,14773953134037a208fe3c95c893acae",
"wsum_estimate__decoupler.tsv:md5,2488716cfe85c1306cb76cf117808d97"
"consensus_estimate__decoupler.tsv:md5,3adfc527d7491baaec5a9ba003345b06",
"mlm_estimate__decoupler.tsv:md5,10f0a0a82dc252e2843df04430daa30c",
"ulm_estimate__decoupler.tsv:md5,3f38c1f33d6fdf352bc311e269662c79",
"wsum_estimate__decoupler.tsv:md5,5e6c68334b105b341042507638e3a950"
]
]
],
Expand All @@ -21,26 +84,26 @@
"id": "test"
},
[
"consensus_pvals__decoupler.tsv:md5,35850081a4308deba35d171a266bedd0",
"mlm_pvals__decoupler.tsv:md5,016a15c3dcf688fcdf3ccbd40e06d64f",
"ulm_pvals__decoupler.tsv:md5,531a3ed641bf3c1b0b105cfaee5864cd",
"consensus_pvals__decoupler.tsv:md5,01b956e8cd0c0f24858c83382792f3ba",
"mlm_pvals__decoupler.tsv:md5,70e53ea27d51f0b74de08e09cfa0d22a",
"ulm_pvals__decoupler.tsv:md5,024d29e68941f56d4f2e878826ad4ded",
"wsum_pvals__decoupler.tsv:md5,fac9e18b9495ca8a9ae92a015eed3043"
]
]
],
"2": [
"versions.yml:md5,01a24ec9e3499a0d2f54e7fb173537be"
"versions.yml:md5,8fd115b4099050429b348981ca1d5e86"
],
"dc_estimate": [
[
{
"id": "test"
},
[
"consensus_estimate__decoupler.tsv:md5,f762d3282a81c61b127e97d044e9ddd7",
"mlm_estimate__decoupler.tsv:md5,ce7ce3c710fe188035b6706512ffbf54",
"ulm_estimate__decoupler.tsv:md5,14773953134037a208fe3c95c893acae",
"wsum_estimate__decoupler.tsv:md5,2488716cfe85c1306cb76cf117808d97"
"consensus_estimate__decoupler.tsv:md5,3adfc527d7491baaec5a9ba003345b06",
"mlm_estimate__decoupler.tsv:md5,10f0a0a82dc252e2843df04430daa30c",
"ulm_estimate__decoupler.tsv:md5,3f38c1f33d6fdf352bc311e269662c79",
"wsum_estimate__decoupler.tsv:md5,5e6c68334b105b341042507638e3a950"
]
]
],
Expand All @@ -50,22 +113,22 @@
"id": "test"
},
[
"consensus_pvals__decoupler.tsv:md5,35850081a4308deba35d171a266bedd0",
"mlm_pvals__decoupler.tsv:md5,016a15c3dcf688fcdf3ccbd40e06d64f",
"ulm_pvals__decoupler.tsv:md5,531a3ed641bf3c1b0b105cfaee5864cd",
"consensus_pvals__decoupler.tsv:md5,01b956e8cd0c0f24858c83382792f3ba",
"mlm_pvals__decoupler.tsv:md5,70e53ea27d51f0b74de08e09cfa0d22a",
"ulm_pvals__decoupler.tsv:md5,024d29e68941f56d4f2e878826ad4ded",
"wsum_pvals__decoupler.tsv:md5,fac9e18b9495ca8a9ae92a015eed3043"
]
]
],
"versions": [
"versions.yml:md5,01a24ec9e3499a0d2f54e7fb173537be"
"versions.yml:md5,8fd115b4099050429b348981ca1d5e86"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-03-21T15:58:23.677564728"
"timestamp": "2024-11-22T15:53:36.587951"
}
}
Loading