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 local module FUSIONINSPECTOR #601

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added a new module `CTATSPLICING_STARTOCANCERINTRONS` and a new parameter `--ctatsplicing`. This options creates reports on cancer splicing abberations and requires one or both of `--arriba` and `--starfusion` to be given. [#587](https://github.com/nf-core/rnafusion/pull/587)
- Add parameter `--references_only` when no data should be analysed, but only the references should be built [#505](https://github.com/nf-core/rnafusion/pull/505)
- 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)

### Changed

Expand All @@ -40,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Integrate reference building in the main workflow [#505](https://github.com/nf-core/rnafusion/pull/505)
- Move from ensembl to gencode base [#505](https://github.com/nf-core/rnafusion/pull/505)
- Update from ensembl 102 to gencode 46 default references [#505](https://github.com/nf-core/rnafusion/pull/505)
- Update`FUSIONINSPECTOR` to v2.10.0. [#601](https://github.com/nf-core/rnafusion/pull/601)
- Remove local module `STARFUSION_DOWNLOAD` [#598](https://github.com/nf-core/rnafusion/pull/598)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ process {
]
}

withName: 'FUSIONINSPECTOR' {
withName: '.*FUSIONINSPECTOR_WORKFLOW:.*:FUSIONINSPECTOR' {
ext.when = { !params.skip_vis }
ext.args = { ${params.fusioninspector_limitSjdbInsertNsj} != 1000000 ? "--STAR_xtra_params \"--limitSjdbInsertNsj ${params.fusioninspector_limitSjdbInsertNsj}\"" : '' }
ext.args2 = '--annotate --examine_coding_effect'
Expand Down
12 changes: 8 additions & 4 deletions modules/local/fusioninspector/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::dfam=3.7
- bioconda::hmmer=3.4
- bioconda::minimap2=2.28
- bioconda::star-fusion=1.14.0
- bioconda::fusion-inspector=2.10.0
- bioconda::igv-reports=1.14.1
- bioconda::perl-json-xs=4.03
- bioconda::pysam=0.22.1
- conda-forge::perl-carp-assert=0.21
- pip
- pip:
- intervaltree==3.1.0
6 changes: 3 additions & 3 deletions modules/local/fusioninspector/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process FUSIONINSPECTOR {

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/be/bed86145102fdf7e381e1a506a4723676f98b4bbe1db5085d02213cef18525c9/data' :
'community.wave.seqera.io/library/dfam_hmmer_minimap2_star-fusion:aa3a8e3951498552'}"
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/13/139b94a1f10c6e23a8c27eaed1e5a689db978a513d0ee155e74d35f0970814fe/data' :
'community.wave.seqera.io/library/fusion-inspector_igv-reports_perl-json-xs_pysam_pruned:c6147971d107ab11'}"

input:
tuple val(meta), path(reads), path(fusion_list)
Expand All @@ -15,7 +15,7 @@ process FUSIONINSPECTOR {
tuple val(meta), path("*FusionInspector.fusions.tsv") , emit: tsv
tuple val(meta), path("*.coding_effect") , optional:true, emit: tsv_coding_effect
tuple val(meta), path("*.gtf") , optional:true, emit: out_gtf
path "*" , emit: output
tuple val(meta), path("*FusionInspector.log") , emit: log
path "versions.yml" , emit: versions

when:
Expand Down
100 changes: 100 additions & 0 deletions modules/local/fusioninspector/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
nextflow_process {

name "Test Process FUSIONINSPECTOR"
script "../main.nf"
process "FUSIONINSPECTOR"
tag "modules"
tag "modules_local"
tag "fusioninspector"

test("FUSIONINSPECTOR") {
config './nextflow.config'

setup {
run("STARFUSION_BUILD") {
script "../../starfusion/build/main.nf"
process {
"""
input[0] = [
[ id:'minigenome fasta' ],
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.fa")
]
input[1] = [
[ id:'minigenome gtf' ],
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.gtf")
]

input [2] = file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/CTAT_HumanFusionLib.mini.dat.gz")
input [3] = "human"
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/v0.0.1/rnaseq_1.fastq.gz"),
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/v0.0.1/rnaseq_2.fastq.gz")
], // reads
[
file("https://github.com/FusionInspector/FusionInspector/raw/master/test/fusion_targets.A.txt")
]
]
input[1] = STARFUSION_BUILD.out.reference.map { it[1] }
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.tsv[0][1]).name,
process.out.tsv_coding_effect, // TODO: These files do not seem to be produced. Consult Annick.
process.out.out_gtf, // TODO: These files do not seem to be produced. Consult Annick.
file(process.out.log[0][1]).name,
process.out.versions
).match() }
)
}

}

test("FUSIONINSPECTOR - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/v0.0.1/rnaseq_1.fastq.gz"),
file("https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/v0.0.1/rnaseq_2.fastq.gz")
], // reads
[
file("https://github.com/FusionInspector/FusionInspector/raw/master/test/fusion_targets.A.txt")
]
]
input[1] = []
"""
}
}

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

}


}
111 changes: 111 additions & 0 deletions modules/local/fusioninspector/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"FUSIONINSPECTOR - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.FusionInspector.fusions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.FusionInspector.fusions.tsv.annotated.coding_effect:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test",
"single_end": false
},
"test.gtf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
[
{
"id": "test",
"single_end": false
},
"test.FusionInspector.log:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"4": [
"versions.yml:md5,ad8d0da5929dfa70794bccf8765ddb23"
],
"log": [
[
{
"id": "test",
"single_end": false
},
"test.FusionInspector.log:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"out_gtf": [
[
{
"id": "test",
"single_end": false
},
"test.gtf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.FusionInspector.fusions.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"tsv_coding_effect": [
[
{
"id": "test",
"single_end": false
},
"test.FusionInspector.fusions.tsv.annotated.coding_effect:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,ad8d0da5929dfa70794bccf8765ddb23"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2024-12-26T23:13:02.858688488"
},
"FUSIONINSPECTOR": {
"content": [
"test.FusionInspector.fusions.tsv",
[

],
[

],
"FusionInspector.log",
[
"versions.yml:md5,ad8d0da5929dfa70794bccf8765ddb23"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2024-12-27T16:38:17.787825557"
}
}
5 changes: 5 additions & 0 deletions modules/local/fusioninspector/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: 'FUSIONINSPECTOR' {
ext.args = '--annotate --examine_coding_effect'
}
}
Loading