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

Add nf-test for fusionreport_workflow subworkflow #607

Merged
merged 9 commits into from
Jan 22, 2025
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add nf-test to local subworkflow: `FUSIONCATCHER_WORKFLOW` [#591](https://github.com/nf-core/rnafusion/pull/591)
- Add nf-test to local subworkflow: `STARFUSION_WORKFLOW`. [#597](https://github.com/nf-core/rnafusion/pull/597)
- Add nf-test to local module: `FUSIONINSPECTOR`. [#601](https://github.com/nf-core/rnafusion/pull/601)
- Add nf-test to local subworkflow: `FUSIONREPORT_WORKFLOW`. [#607](https://github.com/nf-core/rnafusion/pull/607)

### Changed

Expand Down
6 changes: 6 additions & 0 deletions modules/local/fusionreport/detect/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::fusion-report=3.1.1
- conda-forge::openpyxl=3.1.5
5 changes: 4 additions & 1 deletion modules/local/fusionreport/detect/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ process FUSIONREPORT {
tag "$meta.id"
label 'process_medium'

container "docker.io/clinicalgenomics/fusion-report:3.1.0"
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/d9/d9d1075dc45da6b08ec99c6e8bcc83e0ab71a674e7efdc7a36e459539793fcf9/data' :
'community.wave.seqera.io/library/fusion-report_openpyxl:6748677442b83a9a'}"


input:
Expand Down
6 changes: 6 additions & 0 deletions modules/local/fusionreport/download/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::fusion-report=3.1.1
- conda-forge::openpyxl=3.1.5
6 changes: 4 additions & 2 deletions modules/local/fusionreport/download/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ process FUSIONREPORT_DOWNLOAD {
tag 'fusionreport'
label 'process_medium'

conda "bioconda::star=2.7.9a"
container "docker.io/clinicalgenomics/fusion-report:3.1.0"
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/d9/d9d1075dc45da6b08ec99c6e8bcc83e0ab71a674e7efdc7a36e459539793fcf9/data' :
'community.wave.seqera.io/library/fusion-report_openpyxl:6748677442b83a9a'}"

output:
tuple val(meta), path("fusion_report_db"), emit: fusionreport_ref
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include { FUSIONREPORT } from '../../modules/local/fusionreport/detect/main'
include { FUSIONREPORT } from '../../../modules/local/fusionreport/detect/main'


workflow FUSIONREPORT_WORKFLOW {
Expand Down
77 changes: 77 additions & 0 deletions subworkflows/local/fusionreport_workflow/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
nextflow_workflow {

name "Test Subworkflow FUSIONREPORT_WORKFLOW"
script "../main.nf"
workflow "FUSIONREPORT_WORKFLOW"

tag "subworkflow"
tag "fusionreport_workflow"
tag "fusionreport"

test("FUSIONREPORT_WORKFLOW - Full Test") {

setup {
run("FUSIONREPORT_DOWNLOAD") {
script "../../../../modules/local/fusionreport/download/main.nf"
process {
"""
"""
}
}
}

when {
workflow {
"""
// Input channels
input[0] = Channel.of(
[ [ id:'test_sample' ],
file("https://github.com/nf-core/test-datasets/raw/rnafusion/testdata/human/reads_1.fq.gz") ]
)

input[1] = FUSIONREPORT_DOWNLOAD.out.fusionreport_ref

input[2] = Channel.of(
[[ id:'test_sample' ],
file("https://github.com/Clinical-Genomics/fusion-report/raw/master/tests/test_data/arriba.tsv") ]
)

input[3] = Channel.of(
[[ id:'test_sample' ],
file("https://github.com/Clinical-Genomics/fusion-report/raw/master/tests/test_data/starfusion.tsv") ]
)

input[4] = Channel.of(
[[ id:'test_sample' ],
file("https://github.com/Clinical-Genomics/fusion-report/raw/master/tests/test_data/fusioncatcher.txt") ]
)

"""
}
params {
fusioninspector_only = false
tools_cutoff = 1
arriba = true
starfusion = true
fusioncatcher = true
no_cosmic = true
outdir = "$outputDir"
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(
workflow.out.fusion_list,
workflow.out.fusion_list_filtered,
workflow.out.report,
workflow.out.csv,
workflow.out.versions
).match() }
)
}
}


}
46 changes: 46 additions & 0 deletions subworkflows/local/fusionreport_workflow/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"FUSIONREPORT_WORKFLOW - Full Test": {
"content": [
[
[
{
"id": "test_sample"
},
"test_sample.fusionreport.tsv:md5,3593b7021f26cc5427fdc96f0d1c72f0"
]
],
[
[
{
"id": "test_sample"
},
"test_sample.fusionreport_filtered.tsv:md5,3593b7021f26cc5427fdc96f0d1c72f0"
]
],
[
[
{
"id": "test_sample"
},
"test_sample_fusionreport_index.html:md5,3513bcaa58446399c0957db69402d3bd"
]
],
[
[
{
"id": "test_sample"
},
"test_sample.fusions.csv:md5,49f378c2112d7e0b3b17d9095c79e6bd"
]
],
[
"versions.yml:md5,90749dbf8e3e7b259c935eabb8c6ce1e"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2025-01-07T13:31:41.215356596"
}
}
2 changes: 2 additions & 0 deletions tests/.nftignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ starfusion/ctat_genome_lib_build_dir/ref_genome.fa.star.idx/Log.out
starfusion/ctat_genome_lib_build_dir/trans.blast.align_coords.align_coords.dbm
references/star/genomeParameters.txt
starfusion/ctat_genome_lib_build_dir/ref_genome.fa.star.idx/genomeParameters.txt
references/fusion_report_db/mitelman.db
references/fusion_report_db/fusiongdb2.db
4 changes: 2 additions & 2 deletions tests/test_build.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,6 @@
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2024-12-30T13:35:33.573499693"
"timestamp": "2025-01-14T13:08:24.564679638"
}
}
}
Loading