From 36960ec12838701e7518aef648f4a823ec868c97 Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:23:33 +0100 Subject: [PATCH 1/6] test: add nf-test --- .../main.nf} | 2 +- .../fusionreport_workflow/tests/main.nf.test | 73 +++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) rename subworkflows/local/{fusionreport_workflow.nf => fusionreport_workflow/main.nf} (94%) create mode 100644 subworkflows/local/fusionreport_workflow/tests/main.nf.test diff --git a/subworkflows/local/fusionreport_workflow.nf b/subworkflows/local/fusionreport_workflow/main.nf similarity index 94% rename from subworkflows/local/fusionreport_workflow.nf rename to subworkflows/local/fusionreport_workflow/main.nf index 04019e12..eac40e32 100644 --- a/subworkflows/local/fusionreport_workflow.nf +++ b/subworkflows/local/fusionreport_workflow/main.nf @@ -1,4 +1,4 @@ -include { FUSIONREPORT } from '../../modules/local/fusionreport/detect/main' +include { FUSIONREPORT } from '../../../modules/local/fusionreport/detect/main' workflow FUSIONREPORT_WORKFLOW { diff --git a/subworkflows/local/fusionreport_workflow/tests/main.nf.test b/subworkflows/local/fusionreport_workflow/tests/main.nf.test new file mode 100644 index 00000000..2b7da3d3 --- /dev/null +++ b/subworkflows/local/fusionreport_workflow/tests/main.nf.test @@ -0,0 +1,73 @@ +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 + 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() } + ) + } + } + + +} From 1516bcadd2bc907a43d345aff98207a532ab6d91 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:35:20 +0000 Subject: [PATCH 2/6] feat: update `fusion-report` to 3.1.1 --- modules/local/fusionreport/detect/environment.yml | 6 ++++++ modules/local/fusionreport/detect/main.nf | 5 ++++- modules/local/fusionreport/download/environment.yml | 6 ++++++ modules/local/fusionreport/download/main.nf | 6 ++++-- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 modules/local/fusionreport/detect/environment.yml create mode 100644 modules/local/fusionreport/download/environment.yml diff --git a/modules/local/fusionreport/detect/environment.yml b/modules/local/fusionreport/detect/environment.yml new file mode 100644 index 00000000..0d260fdb --- /dev/null +++ b/modules/local/fusionreport/detect/environment.yml @@ -0,0 +1,6 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::fusion-report=3.1.1 + - conda-forge::openpyxl=3.1.5 diff --git a/modules/local/fusionreport/detect/main.nf b/modules/local/fusionreport/detect/main.nf index 56a29ab4..3670eec0 100644 --- a/modules/local/fusionreport/detect/main.nf +++ b/modules/local/fusionreport/detect/main.nf @@ -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: diff --git a/modules/local/fusionreport/download/environment.yml b/modules/local/fusionreport/download/environment.yml new file mode 100644 index 00000000..0d260fdb --- /dev/null +++ b/modules/local/fusionreport/download/environment.yml @@ -0,0 +1,6 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::fusion-report=3.1.1 + - conda-forge::openpyxl=3.1.5 diff --git a/modules/local/fusionreport/download/main.nf b/modules/local/fusionreport/download/main.nf index 89f631db..ec62c75e 100644 --- a/modules/local/fusionreport/download/main.nf +++ b/modules/local/fusionreport/download/main.nf @@ -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 From f40e9f5f8532e06195654a3eb9e3f90a0ccba959 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:37:13 +0000 Subject: [PATCH 3/6] test: add required params --- .../fusionreport_workflow/tests/main.nf.test | 14 ++++-- .../tests/main.nf.test.snap | 46 +++++++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 subworkflows/local/fusionreport_workflow/tests/main.nf.test.snap diff --git a/subworkflows/local/fusionreport_workflow/tests/main.nf.test b/subworkflows/local/fusionreport_workflow/tests/main.nf.test index 2b7da3d3..61aaf023 100644 --- a/subworkflows/local/fusionreport_workflow/tests/main.nf.test +++ b/subworkflows/local/fusionreport_workflow/tests/main.nf.test @@ -26,23 +26,23 @@ nextflow_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") ] + 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' ], + [[ 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' ], + [[ 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' ], + [[ id:'test_sample' ], file("https://github.com/Clinical-Genomics/fusion-report/raw/master/tests/test_data/fusioncatcher.txt") ] ) @@ -51,6 +51,10 @@ nextflow_workflow { params { fusioninspector_only = false tools_cutoff = 1 + arriba = true + starfusion = true + fusioncatcher = true + no_cosmic = true outdir = "$outputDir" } } @@ -69,5 +73,5 @@ nextflow_workflow { } } - + } diff --git a/subworkflows/local/fusionreport_workflow/tests/main.nf.test.snap b/subworkflows/local/fusionreport_workflow/tests/main.nf.test.snap new file mode 100644 index 00000000..2c384e5a --- /dev/null +++ b/subworkflows/local/fusionreport_workflow/tests/main.nf.test.snap @@ -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" + } +} \ No newline at end of file From b7c928b02b2e532d4128e5edd86a3b2937cf2242 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:10:10 +0000 Subject: [PATCH 4/6] test: update tests and snapshot --- tests/.nftignore | 1 + tests/test_build.nf.test.snap | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/.nftignore b/tests/.nftignore index 7b5b6859..07c82b43 100644 --- a/tests/.nftignore +++ b/tests/.nftignore @@ -3,6 +3,7 @@ references/arriba/blacklist_hg38_GRCh38_v2.4.0.tsv.gz references/arriba/known_fusions_hg38_GRCh38_v2.4.0.tsv.gz references/ensembl/Homo_sapiens.GRCh38.102.dna.primary_assembly.fa references/hgnc/HGNC-DB-timestamp.txt +references/hgnc/hgnc_complete_set.txt references/fusion_report_db/DB-timestamp.txt references/salmon/salmon/ctable.bin references/salmon/salmon/pos.bin diff --git a/tests/test_build.nf.test.snap b/tests/test_build.nf.test.snap index f2e1bc38..d1d798fc 100644 --- a/tests/test_build.nf.test.snap +++ b/tests/test_build.nf.test.snap @@ -191,13 +191,12 @@ "cytobands_hg38_GRCh38_v2.4.0.tsv:md5,7bd504feefb33fcfc9be0517439a423c", "protein_domains_hg38_GRCh38_v2.4.0.gff3:md5,43c387a784ebeed71b4147076cebf978", "fusion_report.log:md5,d41d8cd98f00b204e9800998ecf8427e", - "fusiongdb2.db:md5,e1ac123a744e515d3e5f85b8344d526a", - "mitelman.db:md5,1363795c97f77c641065ecd9ad0e484a", + "fusiongdb2.db:md5,715b52d8fa4270c510240c48fb88e9c7", + "mitelman.db:md5,51e307dbf4c35c425a3473baa44939c0", "minigenome.fa.fai:md5,e3f74a27219b33ae80fd5de5cbeaf32b", "minigenome.gtf.interval_list:md5,9111fe876b17e5c18314206e9f985b8c", "minigenome.gtf.refflat:md5,ed76bc063c98087f1100a928923758c7", "minigenome.gtf.fasta:md5,349d42b5dbd73e163cdbad3453d8cd3a", - "hgnc_complete_set.txt:md5,ba66fe5d27ce643b5636a2a85b1b32cb", "complete_ref_lens.bin:md5,3b6d71ddb3eb8239be6623ab350a636d", "ctg_offsets.bin:md5,174ead59c00c5264300d3ff1de673074", "duplicate_clusters.tsv:md5,d30ab58d133298ed9ba51f1ba20ce89c", @@ -282,6 +281,6 @@ "nf-test": "0.9.2", "nextflow": "24.10.3" }, - "timestamp": "2024-12-30T13:35:33.573499693" + "timestamp": "2025-01-14T13:08:24.564679638" } -} +} \ No newline at end of file From 675c0a3b835c7b434a6faa76187186191ff5f3b5 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:12:05 +0000 Subject: [PATCH 5/6] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 010d1619..3738dca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 From 2d5d9bb557a2d3c12e7dbd1536648fdc324b6b06 Mon Sep 17 00:00:00 2001 From: atrigila <18577080+atrigila@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:11:46 +0000 Subject: [PATCH 6/6] fix: add unstable files to nftignore --- tests/.nftignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/.nftignore b/tests/.nftignore index 9d6a156e..cb651aed 100644 --- a/tests/.nftignore +++ b/tests/.nftignore @@ -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