From 1d7c518f1e07187215f228bd6f68c92b743dbb4b Mon Sep 17 00:00:00 2001 From: Jack Tierney Date: Mon, 1 Dec 2025 15:31:15 +0000 Subject: [PATCH 1/4] add 3 required ribocode modules --- .../ribocode/metaplots/environment.yml | 6 ++ modules/nf-core/ribocode/metaplots/main.nf | 50 +++++++++ modules/nf-core/ribocode/metaplots/meta.yml | 64 +++++++++++ .../ribocode/metaplots/tests/main.nf.test | 51 +++++++++ .../metaplots/tests/main.nf.test.snap | 55 ++++++++++ .../ribocode/metaplots/tests/nextflow.config | 5 + .../nf-core/ribocode/prepare/environment.yml | 6 ++ modules/nf-core/ribocode/prepare/main.nf | 64 +++++++++++ modules/nf-core/ribocode/prepare/meta.yml | 45 ++++++++ .../ribocode/prepare/tests/main.nf.test | 32 ++++++ .../ribocode/prepare/tests/main.nf.test.snap | 33 ++++++ .../nf-core/ribocode/ribocode/environment.yml | 6 ++ modules/nf-core/ribocode/ribocode/main.nf | 57 ++++++++++ modules/nf-core/ribocode/ribocode/meta.yml | 100 ++++++++++++++++++ .../ribocode/ribocode/tests/main.nf.test | 65 ++++++++++++ .../ribocode/ribocode/tests/main.nf.test.snap | 97 +++++++++++++++++ .../ribocode/ribocode/tests/nextflow.config | 8 ++ 17 files changed, 744 insertions(+) create mode 100644 modules/nf-core/ribocode/metaplots/environment.yml create mode 100644 modules/nf-core/ribocode/metaplots/main.nf create mode 100644 modules/nf-core/ribocode/metaplots/meta.yml create mode 100644 modules/nf-core/ribocode/metaplots/tests/main.nf.test create mode 100644 modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap create mode 100644 modules/nf-core/ribocode/metaplots/tests/nextflow.config create mode 100644 modules/nf-core/ribocode/prepare/environment.yml create mode 100644 modules/nf-core/ribocode/prepare/main.nf create mode 100644 modules/nf-core/ribocode/prepare/meta.yml create mode 100644 modules/nf-core/ribocode/prepare/tests/main.nf.test create mode 100644 modules/nf-core/ribocode/prepare/tests/main.nf.test.snap create mode 100644 modules/nf-core/ribocode/ribocode/environment.yml create mode 100644 modules/nf-core/ribocode/ribocode/main.nf create mode 100644 modules/nf-core/ribocode/ribocode/meta.yml create mode 100644 modules/nf-core/ribocode/ribocode/tests/main.nf.test create mode 100644 modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap create mode 100644 modules/nf-core/ribocode/ribocode/tests/nextflow.config diff --git a/modules/nf-core/ribocode/metaplots/environment.yml b/modules/nf-core/ribocode/metaplots/environment.yml new file mode 100644 index 00000000000..248e76fd71f --- /dev/null +++ b/modules/nf-core/ribocode/metaplots/environment.yml @@ -0,0 +1,6 @@ +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::ribocode=1.2.15 \ No newline at end of file diff --git a/modules/nf-core/ribocode/metaplots/main.nf b/modules/nf-core/ribocode/metaplots/main.nf new file mode 100644 index 00000000000..f07e198f890 --- /dev/null +++ b/modules/nf-core/ribocode/metaplots/main.nf @@ -0,0 +1,50 @@ +process RIBOCODE_METAPLOTS { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ribocode:1.2.15--pyhfa5458b_0': + 'biocontainers/ribocode:1.2.15--pyhfa5458b_0' }" + + input: + tuple val(meta), path(bam) + path annotation + + output: + tuple val(meta), path("*config.txt") , emit: config + tuple val(meta), path("*.pdf") , emit: pdf + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + metaplots \\ + -a $annotation \\ + -r $bam \\ + -o ${prefix} \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(RiboCode --version 2>&1) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_config.txt + touch ${prefix}_report.pdf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(echo "1.2.15") + END_VERSIONS + """ +} diff --git a/modules/nf-core/ribocode/metaplots/meta.yml b/modules/nf-core/ribocode/metaplots/meta.yml new file mode 100644 index 00000000000..6074a441b90 --- /dev/null +++ b/modules/nf-core/ribocode/metaplots/meta.yml @@ -0,0 +1,64 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +name: "ribocode_metaplots" +description: Set up RiboCode ORF calling with metaplots +keywords: + - Ribo-Seq + - Ribosome Profiling + - ORF Calling +tools: + - "ribocode": + description: "A package for detecting the actively translated ORFs using ribosome-profiling + data" + homepage: "https://github.com/xryanglab/RiboCode" + documentation: "https://github.com/xryanglab/RiboCode" + tool_dev_url: "https://github.com/xryanglab/RiboCode" + doi: "10.1093/nar/gky179" + licence: ["MIT"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + ontologies: [] + - annotation: + type: directory + description: Directory containing annotation files + pattern: "annotation" + +output: + config: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - "*config.txt": + type: file + description: RiboCode configuration file containing P-site offsets + pattern: "*_config.txt" + ontologies: [] + pdf: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - "*.pdf": + type: file + description: PDF file containing P-site metaplots for quality control + pattern: "*_report.pdf" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@JackCurragh" diff --git a/modules/nf-core/ribocode/metaplots/tests/main.nf.test b/modules/nf-core/ribocode/metaplots/tests/main.nf.test new file mode 100644 index 00000000000..e3c831c63f5 --- /dev/null +++ b/modules/nf-core/ribocode/metaplots/tests/main.nf.test @@ -0,0 +1,51 @@ +nextflow_process { + + name "Test Process RIBOCODE_METAPLOTS" + script "../main.nf" + process "RIBOCODE_METAPLOTS" + + tag "modules" + tag "modules_nfcore" + tag "ribocode" + tag "ribocode/metaplots" + tag "ribocode/prepare" + + setup { + run("RIBOCODE_PREPARE") { + script "../../prepare/main.nf" + process { + + """ + input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + """ + } + } + } + + test("test_ribocode_metaplots") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887.Aligned.toTranscriptome.out.bam", checkIfExists: true) + ] + input[1] = RIBOCODE_PREPARE.out.annotation + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap b/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap new file mode 100644 index 00000000000..d215ad75a64 --- /dev/null +++ b/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap @@ -0,0 +1,55 @@ +{ + "test_ribocode_metaplots": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_pre_config.txt:md5,6da5a4583c1f94ec908c9556bf7064be" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "testSRX11780887.Aligned.toTranscriptome.out.pdf:md5,464c91bb5532a571ed2c9c6ae6403a86" + ] + ], + "2": [ + "versions.yml:md5,7e9b4c67f04dd073e78f174e1e41720c" + ], + "config": [ + [ + { + "id": "test", + "single_end": false + }, + "test_pre_config.txt:md5,6da5a4583c1f94ec908c9556bf7064be" + ] + ], + "pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "testSRX11780887.Aligned.toTranscriptome.out.pdf:md5,464c91bb5532a571ed2c9c6ae6403a86" + ] + ], + "versions": [ + "versions.yml:md5,7e9b4c67f04dd073e78f174e1e41720c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-01T15:29:32.897378" + } +} \ No newline at end of file diff --git a/modules/nf-core/ribocode/metaplots/tests/nextflow.config b/modules/nf-core/ribocode/metaplots/tests/nextflow.config new file mode 100644 index 00000000000..3ccf4a70c6c --- /dev/null +++ b/modules/nf-core/ribocode/metaplots/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: RIBOCODE_METAPLOTS { + ext.args = '-f0_percent 0.1 -pv1 1 -pv2 1' + } +} diff --git a/modules/nf-core/ribocode/prepare/environment.yml b/modules/nf-core/ribocode/prepare/environment.yml new file mode 100644 index 00000000000..248e76fd71f --- /dev/null +++ b/modules/nf-core/ribocode/prepare/environment.yml @@ -0,0 +1,6 @@ +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::ribocode=1.2.15 \ No newline at end of file diff --git a/modules/nf-core/ribocode/prepare/main.nf b/modules/nf-core/ribocode/prepare/main.nf new file mode 100644 index 00000000000..6f1962dcbec --- /dev/null +++ b/modules/nf-core/ribocode/prepare/main.nf @@ -0,0 +1,64 @@ +process RIBOCODE_PREPARE { + tag "$fasta" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ribocode:1.2.15--pyhfa5458b_0': + 'biocontainers/ribocode:1.2.15--pyhfa5458b_0' }" + + input: + path fasta + path gtf + + output: + path "annotation" , emit: annotation + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + # nf-core: ensure FASTA is uncompressed + GENOME="$fasta" + if [[ "\$GENOME" == *.gz ]]; then + gunzip -c "\$GENOME" > genome.fa + GENOME="genome.fa" + fi + + # Update the GTF + GTFupdate \\ + $gtf \\ + > updated.gtf + + # Run prepare_transcripts with uncompressed FASTA + prepare_transcripts \\ + -g updated.gtf \\ + -f "\$GENOME" \\ + -o annotation + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(RiboCode --version) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + + """ + mkdir annotation + + touch annotation/transcripts_cds.txt + touch annotation/transcripts_sequence.fa + touch annotation/transcripts.pickle + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(echo "1.2.15") + END_VERSIONS + """ +} diff --git a/modules/nf-core/ribocode/prepare/meta.yml b/modules/nf-core/ribocode/prepare/meta.yml new file mode 100644 index 00000000000..782b94e3f35 --- /dev/null +++ b/modules/nf-core/ribocode/prepare/meta.yml @@ -0,0 +1,45 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +name: "ribocode_prepare" +description: Prepare the annotation files for RiboCode ORF calling +keywords: + - Ribo-Seq + - Ribosome Profiling + - ORF calling +tools: + - "ribocode": + description: "A package for detecting the actively translated ORFs using ribosome-profiling + data" + homepage: "https://github.com/xryanglab/RiboCode" + documentation: "https://github.com/xryanglab/RiboCode" + tool_dev_url: "https://github.com/xryanglab/RiboCode" + doi: "10.1093/nar/gky179" + licence: ["MIT"] + identifier: "" + +input: + - fasta: + type: file + description: Reference genome FASTA file + pattern: "*.{fasta,fa,fna}" + ontologies: [] + - gtf: + type: file + description: Reference genome GTF annotation file + pattern: "*.{gtf}" + + ontologies: [] +output: + annotation: + - annotation: + type: directory + description: Directory containing RiboCode annotation files + (transcripts_cds.txt, transcripts_sequence.fa, transcripts.pickle) + pattern: "annotation/" + + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@JackCurragh" diff --git a/modules/nf-core/ribocode/prepare/tests/main.nf.test b/modules/nf-core/ribocode/prepare/tests/main.nf.test new file mode 100644 index 00000000000..81d06823d63 --- /dev/null +++ b/modules/nf-core/ribocode/prepare/tests/main.nf.test @@ -0,0 +1,32 @@ +nextflow_process { + + name "Test Process RIBOCODE_PREPARE" + script "../main.nf" + process "RIBOCODE_PREPARE" + + tag "modules" + tag "modules_nfcore" + tag "ribocode" + tag "ribocode/prepare" + + test("test_ribocode_prepare") { + + when { + process { + """ + input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap b/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap new file mode 100644 index 00000000000..84091112c8e --- /dev/null +++ b/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap @@ -0,0 +1,33 @@ +{ + "test_ribocode_prepare": { + "content": [ + { + "0": [ + [ + "transcripts.pickle:md5,b83be7910166b56d09c4879d38223883", + "transcripts_cds.txt:md5,6fae20439cbe378eb4db60a8bdf6a6af", + "transcripts_sequence.fa:md5,b0401ee625d655ea116528507b038c33" + ] + ], + "1": [ + "versions.yml:md5,1e4f61620a60ab2fcc8c650519e5a034" + ], + "annotation": [ + [ + "transcripts.pickle:md5,b83be7910166b56d09c4879d38223883", + "transcripts_cds.txt:md5,6fae20439cbe378eb4db60a8bdf6a6af", + "transcripts_sequence.fa:md5,b0401ee625d655ea116528507b038c33" + ] + ], + "versions": [ + "versions.yml:md5,1e4f61620a60ab2fcc8c650519e5a034" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-01T13:44:59.168396" + } +} \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/environment.yml b/modules/nf-core/ribocode/ribocode/environment.yml new file mode 100644 index 00000000000..248e76fd71f --- /dev/null +++ b/modules/nf-core/ribocode/ribocode/environment.yml @@ -0,0 +1,6 @@ +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::ribocode=1.2.15 \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/main.nf b/modules/nf-core/ribocode/ribocode/main.nf new file mode 100644 index 00000000000..e6bdf5a6bdd --- /dev/null +++ b/modules/nf-core/ribocode/ribocode/main.nf @@ -0,0 +1,57 @@ +process RIBOCODE_RIBOCODE { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ribocode:1.2.15--pyhfa5458b_0': + 'biocontainers/ribocode:1.2.15--pyhfa5458b_0' }" + + input: + tuple val(meta), path(bam) + path annotation + tuple val(meta3), path(config) + + output: + + tuple val(meta), path("*.txt") , emit: orf_txt + tuple val(meta), path("*_collapsed.txt") , emit: orf_txt_collapsed + tuple val(meta), path("*_ORFs_category.pdf") , emit: orf_pdf, optional: true + tuple val(meta), path("*_psites.hd5") , emit: psites_hd5, optional: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + RiboCode \\ + -a $annotation \\ + -c $config \\ + -o ${prefix} \\ + $args 2>&1 || test -s ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(RiboCode --version 2>&1) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}.txt + touch ${prefix}_collapsed.txt + touch ${prefix}_ORFs_category.pdf + touch ${prefix}_psites.hd5 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(echo "1.2.15") + END_VERSIONS + """ +} diff --git a/modules/nf-core/ribocode/ribocode/meta.yml b/modules/nf-core/ribocode/ribocode/meta.yml new file mode 100644 index 00000000000..27ecf8d33ee --- /dev/null +++ b/modules/nf-core/ribocode/ribocode/meta.yml @@ -0,0 +1,100 @@ +name: "ribocode_ribocode" +description: Call ORFs with RiboCode from Ribo-Seq data +keywords: + - Ribo-Seq + - Ribosome Profiling + - ORF calling +tools: + - "ribocode": + description: "A package for detecting the actively translated ORFs using ribosome-profiling + data" + homepage: "https://github.com/xryanglab/RiboCode" + documentation: "https://github.com/xryanglab/RiboCode" + tool_dev_url: "https://github.com/xryanglab/RiboCode" + doi: "10.1093/nar/gky179" + licence: ["MIT"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + + ontologies: [] + - annotation: + type: directory + description: Directory containing RiboCode annotation files from + ribocode/prepare + pattern: "annotation" + + - - meta3: + type: map + description: | + Groovy Map containing config information + e.g. [ id:'config' ] + - config: + type: file + description: RiboCode configuration file containing P-site offsets from + ribocode/metaplots + pattern: "*_config.txt" + + ontologies: [] +output: + orf_txt: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt": + type: file + description: Text file containing all detected ORFs with detailed + information + pattern: "*.txt" + ontologies: [] + orf_txt_collapsed: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*_collapsed.txt": + type: file + description: Text file containing collapsed ORFs (merged isoforms) + pattern: "*_collapsed.txt" + ontologies: [] + orf_pdf: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*_ORFs_category.pdf": + type: file + description: PDF file with ORF category distribution plots + pattern: "*_ORFs_category.pdf" + ontologies: [] + psites_hd5: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*_psites.hd5": + type: file + description: HDF5 file containing P-site positions + pattern: "*_psites.hd5" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@JackCurragh" diff --git a/modules/nf-core/ribocode/ribocode/tests/main.nf.test b/modules/nf-core/ribocode/ribocode/tests/main.nf.test new file mode 100644 index 00000000000..30a236ddf9f --- /dev/null +++ b/modules/nf-core/ribocode/ribocode/tests/main.nf.test @@ -0,0 +1,65 @@ +nextflow_process { + + name "Test Process RIBOCODE_RIBOCODE" + script "../main.nf" + process "RIBOCODE_RIBOCODE" + + tag "modules" + tag "modules_nfcore" + tag "ribocode" + tag "ribocode/ribocode" + tag "ribocode/prepare" + tag "ribocode/metaplots" + + setup { + run("RIBOCODE_PREPARE") { + script "../../prepare/main.nf" + process { + + """ + input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + """ + } + } + run("RIBOCODE_METAPLOTS") { + script "../../metaplots/main.nf" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887.Aligned.toTranscriptome.out.bam", checkIfExists: true) + ] + input[1] = RIBOCODE_PREPARE.out.annotation + """ + } + } + } + + test("test_ribocode_ribocode") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/aligned_reads/SRX11780887.Aligned.toTranscriptome.out.bam", checkIfExists: true) + ] + input[1] = RIBOCODE_PREPARE.out.annotation + input[2] = RIBOCODE_METAPLOTS.out.config + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap b/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap new file mode 100644 index 00000000000..6b196702704 --- /dev/null +++ b/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap @@ -0,0 +1,97 @@ +{ + "test_ribocode_ribocode": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.txt:md5,89e5dc3e39fb52e98e921a379ee68b69", + "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_ORFs_category.pdf:md5,a56356649534ea846fe7aa3aac6684ff" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "SRX11780887.Aligned.toTranscriptome.out_psites.hd5:md5,802ec4fe5545dec4fe8affd79716faeb" + ] + ], + "4": [ + "versions.yml:md5,2524b02cc4775015c09703548ce5cf66" + ], + "orf_pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_ORFs_category.pdf:md5,a56356649534ea846fe7aa3aac6684ff" + ] + ], + "orf_txt": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.txt:md5,89e5dc3e39fb52e98e921a379ee68b69", + "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" + ] + ] + ], + "orf_txt_collapsed": [ + [ + { + "id": "test", + "single_end": false + }, + "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" + ] + ], + "psites_hd5": [ + [ + { + "id": "test", + "single_end": false + }, + "SRX11780887.Aligned.toTranscriptome.out_psites.hd5:md5,802ec4fe5545dec4fe8affd79716faeb" + ] + ], + "versions": [ + "versions.yml:md5,2524b02cc4775015c09703548ce5cf66" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-01T15:30:33.774086" + } +} \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/tests/nextflow.config b/modules/nf-core/ribocode/ribocode/tests/nextflow.config new file mode 100644 index 00000000000..58b655a69ae --- /dev/null +++ b/modules/nf-core/ribocode/ribocode/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + withName: RIBOCODE_METAPLOTS { + ext.args = '-f0_percent 0.1 -pv1 1 -pv2 1' + } + withName: RIBOCODE_RIBOCODE { + ext.args = '' + } +} From e33ba2df9e2528bb9f1be73ac3691b0ec0fe505d Mon Sep 17 00:00:00 2001 From: Jack Tierney Date: Tue, 2 Dec 2025 20:25:40 +0000 Subject: [PATCH 2/4] GTFUpdate; meta in inputs; No Gzip; --- .../ribocode/gtfupdate/environment.yml | 6 ++ modules/nf-core/ribocode/gtfupdate/main.nf | 48 +++++++++ modules/nf-core/ribocode/gtfupdate/meta.yml | 48 +++++++++ .../ribocode/gtfupdate/tests/main.nf.test | 34 +++++++ modules/nf-core/ribocode/metaplots/main.nf | 2 +- modules/nf-core/ribocode/metaplots/meta.yml | 13 ++- .../ribocode/metaplots/tests/main.nf.test | 35 ++++++- .../metaplots/tests/main.nf.test.snap | 55 ----------- modules/nf-core/ribocode/prepare/main.nf | 30 ++---- modules/nf-core/ribocode/prepare/meta.yml | 47 +++++---- .../ribocode/prepare/tests/main.nf.test | 31 +++++- .../ribocode/prepare/tests/main.nf.test.snap | 33 ------- .../nf-core/ribocode/ribocode/environment.yml | 3 +- modules/nf-core/ribocode/ribocode/main.nf | 2 +- modules/nf-core/ribocode/ribocode/meta.yml | 16 +-- .../ribocode/ribocode/tests/main.nf.test | 37 ++++++- .../ribocode/ribocode/tests/main.nf.test.snap | 97 ------------------- .../ribocode/ribocode/tests/nextflow.config | 3 - 18 files changed, 291 insertions(+), 249 deletions(-) create mode 100644 modules/nf-core/ribocode/gtfupdate/environment.yml create mode 100644 modules/nf-core/ribocode/gtfupdate/main.nf create mode 100644 modules/nf-core/ribocode/gtfupdate/meta.yml create mode 100644 modules/nf-core/ribocode/gtfupdate/tests/main.nf.test delete mode 100644 modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap delete mode 100644 modules/nf-core/ribocode/prepare/tests/main.nf.test.snap delete mode 100644 modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap diff --git a/modules/nf-core/ribocode/gtfupdate/environment.yml b/modules/nf-core/ribocode/gtfupdate/environment.yml new file mode 100644 index 00000000000..248e76fd71f --- /dev/null +++ b/modules/nf-core/ribocode/gtfupdate/environment.yml @@ -0,0 +1,6 @@ +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::ribocode=1.2.15 \ No newline at end of file diff --git a/modules/nf-core/ribocode/gtfupdate/main.nf b/modules/nf-core/ribocode/gtfupdate/main.nf new file mode 100644 index 00000000000..85770161f59 --- /dev/null +++ b/modules/nf-core/ribocode/gtfupdate/main.nf @@ -0,0 +1,48 @@ +process RIBOCODE_GTFUPDATE { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ribocode:1.2.15--pyhfa5458b_0': + 'biocontainers/ribocode:1.2.15--pyhfa5458b_0' }" + + input: + tuple val(meta), path(gtf) + + output: + tuple val(meta), path("*.gtf"), emit: gtf + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + GTFupdate \\ + ${gtf} \\ + $args \\ + > ${prefix}_updated.gtf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(RiboCode --version) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}_updated.gtf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RiboCode: \$(echo "1.2.15") + END_VERSIONS + """ +} diff --git a/modules/nf-core/ribocode/gtfupdate/meta.yml b/modules/nf-core/ribocode/gtfupdate/meta.yml new file mode 100644 index 00000000000..5a6f2f0e47f --- /dev/null +++ b/modules/nf-core/ribocode/gtfupdate/meta.yml @@ -0,0 +1,48 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +name: "ribocode_gtfupdate" +description: Update GTF annotation file for RiboCode compatibility +keywords: + - Ribo-Seq + - Ribosome Profiling + - GTF + - annotation +tools: + - "ribocode": + description: "A package for detecting the actively translated ORFs using ribosome-profiling + data" + homepage: "https://github.com/xryanglab/RiboCode" + documentation: "https://github.com/xryanglab/RiboCode" + tool_dev_url: "https://github.com/xryanglab/RiboCode" + doi: "10.1093/nar/gky179" + licence: ["MIT"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - gtf: + type: file + description: GTF annotation file to update (uncompressed) + pattern: "*.{gtf}" + ontologies: [] +output: + gtf: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - "*.gtf": + type: file + description: Updated GTF annotation file + pattern: "*_updated.gtf" + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@JackCurragh" diff --git a/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test b/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test new file mode 100644 index 00000000000..9c7ff896990 --- /dev/null +++ b/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test @@ -0,0 +1,34 @@ +nextflow_process { + + name "Test Process RIBOCODE_GTFUPDATE" + script "../main.nf" + process "RIBOCODE_GTFUPDATE" + + tag "modules" + tag "modules_nfcore" + tag "ribocode" + tag "ribocode/gtfupdate" + + test("test_ribocode_gtfupdate") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/ribocode/metaplots/main.nf b/modules/nf-core/ribocode/metaplots/main.nf index f07e198f890..7e1fd794d5f 100644 --- a/modules/nf-core/ribocode/metaplots/main.nf +++ b/modules/nf-core/ribocode/metaplots/main.nf @@ -9,7 +9,7 @@ process RIBOCODE_METAPLOTS { input: tuple val(meta), path(bam) - path annotation + tuple val(meta2), path(annotation) output: tuple val(meta), path("*config.txt") , emit: config diff --git a/modules/nf-core/ribocode/metaplots/meta.yml b/modules/nf-core/ribocode/metaplots/meta.yml index 6074a441b90..2e17e75b0b7 100644 --- a/modules/nf-core/ribocode/metaplots/meta.yml +++ b/modules/nf-core/ribocode/metaplots/meta.yml @@ -27,10 +27,15 @@ input: description: Sorted BAM/CRAM/SAM file pattern: "*.{bam,cram,sam}" ontologies: [] - - annotation: - type: directory - description: Directory containing annotation files - pattern: "annotation" + - - meta2: + type: map + description: | + Groovy Map containing annotation information + e.g. `[ id:'genome' ]` + - annotation: + type: directory + description: Directory containing annotation files from ribocode/prepare + pattern: "annotation" output: config: diff --git a/modules/nf-core/ribocode/metaplots/tests/main.nf.test b/modules/nf-core/ribocode/metaplots/tests/main.nf.test index e3c831c63f5..fb77ed332da 100644 --- a/modules/nf-core/ribocode/metaplots/tests/main.nf.test +++ b/modules/nf-core/ribocode/metaplots/tests/main.nf.test @@ -9,15 +9,38 @@ nextflow_process { tag "ribocode" tag "ribocode/metaplots" tag "ribocode/prepare" + tag "ribocode/gtfupdate" + tag "gunzip" setup { + run("GUNZIP") { + script "../../../gunzip/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) + ] + """ + } + } + run("RIBOCODE_GTFUPDATE") { + script "../../gtfupdate/main.nf" + process { + """ + input[0] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + ] + """ + } + } run("RIBOCODE_PREPARE") { script "../../prepare/main.nf" process { - """ - input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) - input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + input[0] = GUNZIP.out.gunzip + input[1] = RIBOCODE_GTFUPDATE.out.gtf """ } } @@ -42,7 +65,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.config, + process.out.versions + ).match() }, + { assert process.out.pdf[0][1].toString().endsWith('.pdf') } ) } diff --git a/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap b/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap deleted file mode 100644 index d215ad75a64..00000000000 --- a/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap +++ /dev/null @@ -1,55 +0,0 @@ -{ - "test_ribocode_metaplots": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test_pre_config.txt:md5,6da5a4583c1f94ec908c9556bf7064be" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "testSRX11780887.Aligned.toTranscriptome.out.pdf:md5,464c91bb5532a571ed2c9c6ae6403a86" - ] - ], - "2": [ - "versions.yml:md5,7e9b4c67f04dd073e78f174e1e41720c" - ], - "config": [ - [ - { - "id": "test", - "single_end": false - }, - "test_pre_config.txt:md5,6da5a4583c1f94ec908c9556bf7064be" - ] - ], - "pdf": [ - [ - { - "id": "test", - "single_end": false - }, - "testSRX11780887.Aligned.toTranscriptome.out.pdf:md5,464c91bb5532a571ed2c9c6ae6403a86" - ] - ], - "versions": [ - "versions.yml:md5,7e9b4c67f04dd073e78f174e1e41720c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-12-01T15:29:32.897378" - } -} \ No newline at end of file diff --git a/modules/nf-core/ribocode/prepare/main.nf b/modules/nf-core/ribocode/prepare/main.nf index 6f1962dcbec..f38042d5a1c 100644 --- a/modules/nf-core/ribocode/prepare/main.nf +++ b/modules/nf-core/ribocode/prepare/main.nf @@ -1,5 +1,5 @@ process RIBOCODE_PREPARE { - tag "$fasta" + tag "$meta.id" label 'process_single' conda "${moduleDir}/environment.yml" @@ -8,12 +8,12 @@ process RIBOCODE_PREPARE { 'biocontainers/ribocode:1.2.15--pyhfa5458b_0' }" input: - path fasta - path gtf + tuple val(meta), path(fasta) + tuple val(meta2), path(gtf) output: - path "annotation" , emit: annotation - path "versions.yml" , emit: versions + tuple val(meta), path("annotation"), emit: annotation + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -22,23 +22,11 @@ process RIBOCODE_PREPARE { def args = task.ext.args ?: '' """ - # nf-core: ensure FASTA is uncompressed - GENOME="$fasta" - if [[ "\$GENOME" == *.gz ]]; then - gunzip -c "\$GENOME" > genome.fa - GENOME="genome.fa" - fi - - # Update the GTF - GTFupdate \\ - $gtf \\ - > updated.gtf - - # Run prepare_transcripts with uncompressed FASTA prepare_transcripts \\ - -g updated.gtf \\ - -f "\$GENOME" \\ - -o annotation + -g ${gtf} \\ + -f ${fasta} \\ + -o annotation \\ + $args cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/ribocode/prepare/meta.yml b/modules/nf-core/ribocode/prepare/meta.yml index 782b94e3f35..1d2ad107f89 100644 --- a/modules/nf-core/ribocode/prepare/meta.yml +++ b/modules/nf-core/ribocode/prepare/meta.yml @@ -17,25 +17,38 @@ tools: identifier: "" input: - - fasta: - type: file - description: Reference genome FASTA file - pattern: "*.{fasta,fa,fna}" - ontologies: [] - - gtf: - type: file - description: Reference genome GTF annotation file - pattern: "*.{gtf}" - - ontologies: [] + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - fasta: + type: file + description: Reference genome FASTA file (uncompressed) + pattern: "*.{fasta,fa,fna}" + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. `[ id:'genome' ]` + - gtf: + type: file + description: Reference genome GTF annotation file (uncompressed, updated with ribocode/gtfupdate) + pattern: "*.{gtf}" + ontologies: [] output: annotation: - - annotation: - type: directory - description: Directory containing RiboCode annotation files - (transcripts_cds.txt, transcripts_sequence.fa, transcripts.pickle) - pattern: "annotation/" - + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - annotation: + type: directory + description: Directory containing RiboCode annotation files + (transcripts_cds.txt, transcripts_sequence.fa, transcripts.pickle) + pattern: "annotation/" versions: - versions.yml: type: file diff --git a/modules/nf-core/ribocode/prepare/tests/main.nf.test b/modules/nf-core/ribocode/prepare/tests/main.nf.test index 81d06823d63..3844b33ed5c 100644 --- a/modules/nf-core/ribocode/prepare/tests/main.nf.test +++ b/modules/nf-core/ribocode/prepare/tests/main.nf.test @@ -8,14 +8,41 @@ nextflow_process { tag "modules_nfcore" tag "ribocode" tag "ribocode/prepare" + tag "ribocode/gtfupdate" + tag "gunzip" + + setup { + run("GUNZIP") { + script "../../../gunzip/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) + ] + """ + } + } + run("RIBOCODE_GTFUPDATE") { + script "../../gtfupdate/main.nf" + process { + """ + input[0] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + ] + """ + } + } + } test("test_ribocode_prepare") { when { process { """ - input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) - input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + input[0] = GUNZIP.out.gunzip + input[1] = RIBOCODE_GTFUPDATE.out.gtf """ } } diff --git a/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap b/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap deleted file mode 100644 index 84091112c8e..00000000000 --- a/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap +++ /dev/null @@ -1,33 +0,0 @@ -{ - "test_ribocode_prepare": { - "content": [ - { - "0": [ - [ - "transcripts.pickle:md5,b83be7910166b56d09c4879d38223883", - "transcripts_cds.txt:md5,6fae20439cbe378eb4db60a8bdf6a6af", - "transcripts_sequence.fa:md5,b0401ee625d655ea116528507b038c33" - ] - ], - "1": [ - "versions.yml:md5,1e4f61620a60ab2fcc8c650519e5a034" - ], - "annotation": [ - [ - "transcripts.pickle:md5,b83be7910166b56d09c4879d38223883", - "transcripts_cds.txt:md5,6fae20439cbe378eb4db60a8bdf6a6af", - "transcripts_sequence.fa:md5,b0401ee625d655ea116528507b038c33" - ] - ], - "versions": [ - "versions.yml:md5,1e4f61620a60ab2fcc8c650519e5a034" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-12-01T13:44:59.168396" - } -} \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/environment.yml b/modules/nf-core/ribocode/ribocode/environment.yml index 248e76fd71f..592fa3c1993 100644 --- a/modules/nf-core/ribocode/ribocode/environment.yml +++ b/modules/nf-core/ribocode/ribocode/environment.yml @@ -3,4 +3,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::ribocode=1.2.15 \ No newline at end of file + - bioconda::ribocode=1.2.15 + \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/main.nf b/modules/nf-core/ribocode/ribocode/main.nf index e6bdf5a6bdd..3b68efc343d 100644 --- a/modules/nf-core/ribocode/ribocode/main.nf +++ b/modules/nf-core/ribocode/ribocode/main.nf @@ -9,7 +9,7 @@ process RIBOCODE_RIBOCODE { input: tuple val(meta), path(bam) - path annotation + tuple val(meta2), path(annotation) tuple val(meta3), path(config) output: diff --git a/modules/nf-core/ribocode/ribocode/meta.yml b/modules/nf-core/ribocode/ribocode/meta.yml index 27ecf8d33ee..118787a1360 100644 --- a/modules/nf-core/ribocode/ribocode/meta.yml +++ b/modules/nf-core/ribocode/ribocode/meta.yml @@ -27,12 +27,16 @@ input: pattern: "*.{bam,cram,sam}" ontologies: [] - - annotation: - type: directory - description: Directory containing RiboCode annotation files from - ribocode/prepare - pattern: "annotation" - + - - meta2: + type: map + description: | + Groovy Map containing annotation information + e.g. [ id:'genome' ] + - annotation: + type: directory + description: Directory containing RiboCode annotation files from + ribocode/prepare + pattern: "annotation" - - meta3: type: map description: | diff --git a/modules/nf-core/ribocode/ribocode/tests/main.nf.test b/modules/nf-core/ribocode/ribocode/tests/main.nf.test index 30a236ddf9f..f7239b074bb 100644 --- a/modules/nf-core/ribocode/ribocode/tests/main.nf.test +++ b/modules/nf-core/ribocode/ribocode/tests/main.nf.test @@ -10,15 +10,38 @@ nextflow_process { tag "ribocode/ribocode" tag "ribocode/prepare" tag "ribocode/metaplots" + tag "ribocode/gtfupdate" + tag "gunzip" setup { + run("GUNZIP") { + script "../../../gunzip/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) + ] + """ + } + } + run("RIBOCODE_GTFUPDATE") { + script "../../gtfupdate/main.nf" + process { + """ + input[0] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + ] + """ + } + } run("RIBOCODE_PREPARE") { script "../../prepare/main.nf" process { - """ - input[0] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.dna.chromosome.20.fa.gz", checkIfExists: true) - input[1] = file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true) + input[0] = GUNZIP.out.gunzip + input[1] = RIBOCODE_GTFUPDATE.out.gtf """ } } @@ -56,7 +79,13 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.orf_txt, + process.out.orf_txt_collapsed, + process.out.versions + ).match() }, + { assert process.out.orf_pdf[0][1].toString().endsWith('.pdf') }, + { assert process.out.psites_hd5[0][1].toString().endsWith('.hd5') } ) } diff --git a/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap b/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap deleted file mode 100644 index 6b196702704..00000000000 --- a/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap +++ /dev/null @@ -1,97 +0,0 @@ -{ - "test_ribocode_ribocode": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test.txt:md5,89e5dc3e39fb52e98e921a379ee68b69", - "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" - ] - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "test_ORFs_category.pdf:md5,a56356649534ea846fe7aa3aac6684ff" - ] - ], - "3": [ - [ - { - "id": "test", - "single_end": false - }, - "SRX11780887.Aligned.toTranscriptome.out_psites.hd5:md5,802ec4fe5545dec4fe8affd79716faeb" - ] - ], - "4": [ - "versions.yml:md5,2524b02cc4775015c09703548ce5cf66" - ], - "orf_pdf": [ - [ - { - "id": "test", - "single_end": false - }, - "test_ORFs_category.pdf:md5,a56356649534ea846fe7aa3aac6684ff" - ] - ], - "orf_txt": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test.txt:md5,89e5dc3e39fb52e98e921a379ee68b69", - "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" - ] - ] - ], - "orf_txt_collapsed": [ - [ - { - "id": "test", - "single_end": false - }, - "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" - ] - ], - "psites_hd5": [ - [ - { - "id": "test", - "single_end": false - }, - "SRX11780887.Aligned.toTranscriptome.out_psites.hd5:md5,802ec4fe5545dec4fe8affd79716faeb" - ] - ], - "versions": [ - "versions.yml:md5,2524b02cc4775015c09703548ce5cf66" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-12-01T15:30:33.774086" - } -} \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/tests/nextflow.config b/modules/nf-core/ribocode/ribocode/tests/nextflow.config index 58b655a69ae..3ccf4a70c6c 100644 --- a/modules/nf-core/ribocode/ribocode/tests/nextflow.config +++ b/modules/nf-core/ribocode/ribocode/tests/nextflow.config @@ -2,7 +2,4 @@ process { withName: RIBOCODE_METAPLOTS { ext.args = '-f0_percent 0.1 -pv1 1 -pv2 1' } - withName: RIBOCODE_RIBOCODE { - ext.args = '' - } } From bf21e3b83b30598c25f67f998d5e524a6f43519e Mon Sep 17 00:00:00 2001 From: Jack Tierney Date: Tue, 2 Dec 2025 21:02:22 +0000 Subject: [PATCH 3/4] return snaps --- .../gtfupdate/tests/main.nf.test.snap | 35 +++++++++++++++ .../metaplots/tests/main.nf.test.snap | 23 ++++++++++ .../ribocode/prepare/tests/main.nf.test.snap | 43 +++++++++++++++++++ .../ribocode/ribocode/tests/main.nf.test.snap | 35 +++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap create mode 100644 modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap create mode 100644 modules/nf-core/ribocode/prepare/tests/main.nf.test.snap create mode 100644 modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap diff --git a/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap b/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap new file mode 100644 index 00000000000..489f0c08b53 --- /dev/null +++ b/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "test_ribocode_gtfupdate": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_updated.gtf:md5,4aee3722f1d061395e2fdce7277708b3" + ] + ], + "1": [ + "versions.yml:md5,93ce7cda2c54dfc37a859ecdcbc8fe89" + ], + "gtf": [ + [ + { + "id": "test" + }, + "test_updated.gtf:md5,4aee3722f1d061395e2fdce7277708b3" + ] + ], + "versions": [ + "versions.yml:md5,93ce7cda2c54dfc37a859ecdcbc8fe89" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-02T20:59:23.131711" + } +} \ No newline at end of file diff --git a/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap b/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap new file mode 100644 index 00000000000..1b6960bc7c8 --- /dev/null +++ b/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap @@ -0,0 +1,23 @@ +{ + "test_ribocode_metaplots": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_pre_config.txt:md5,6da5a4583c1f94ec908c9556bf7064be" + ] + ], + [ + "versions.yml:md5,7e9b4c67f04dd073e78f174e1e41720c" + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-02T20:39:14.398955" + } +} \ No newline at end of file diff --git a/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap b/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap new file mode 100644 index 00000000000..7638295e395 --- /dev/null +++ b/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap @@ -0,0 +1,43 @@ +{ + "test_ribocode_prepare": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "transcripts.pickle:md5,b83be7910166b56d09c4879d38223883", + "transcripts_cds.txt:md5,6fae20439cbe378eb4db60a8bdf6a6af", + "transcripts_sequence.fa:md5,b0401ee625d655ea116528507b038c33" + ] + ] + ], + "1": [ + "versions.yml:md5,1e4f61620a60ab2fcc8c650519e5a034" + ], + "annotation": [ + [ + { + "id": "test" + }, + [ + "transcripts.pickle:md5,b83be7910166b56d09c4879d38223883", + "transcripts_cds.txt:md5,6fae20439cbe378eb4db60a8bdf6a6af", + "transcripts_sequence.fa:md5,b0401ee625d655ea116528507b038c33" + ] + ] + ], + "versions": [ + "versions.yml:md5,1e4f61620a60ab2fcc8c650519e5a034" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-02T20:39:52.117966" + } +} \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap b/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap new file mode 100644 index 00000000000..7de922b06dd --- /dev/null +++ b/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "test_ribocode_ribocode": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.txt:md5,89e5dc3e39fb52e98e921a379ee68b69", + "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_collapsed.txt:md5,dbd709d42f94c6148bdbc0849dd028fb" + ] + ], + [ + "versions.yml:md5,2524b02cc4775015c09703548ce5cf66" + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-02T20:40:57.09874" + } +} \ No newline at end of file From 2d29a9e985c61846595181debc2e94e37dde3a17 Mon Sep 17 00:00:00 2001 From: Jack Tierney Date: Mon, 8 Dec 2025 12:56:32 +0000 Subject: [PATCH 4/4] nf-test passing --- modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap | 2 +- modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap | 2 +- modules/nf-core/ribocode/prepare/tests/main.nf.test.snap | 2 +- modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap b/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap index 489f0c08b53..b83abe16015 100644 --- a/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap +++ b/modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap @@ -30,6 +30,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-12-02T20:59:23.131711" + "timestamp": "2025-12-08T12:55:37.985303" } } \ No newline at end of file diff --git a/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap b/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap index 1b6960bc7c8..eed5b4a4a29 100644 --- a/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap +++ b/modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap @@ -18,6 +18,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-12-02T20:39:14.398955" + "timestamp": "2025-12-03T11:50:10.058623" } } \ No newline at end of file diff --git a/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap b/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap index 7638295e395..0990949d00b 100644 --- a/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap +++ b/modules/nf-core/ribocode/prepare/tests/main.nf.test.snap @@ -38,6 +38,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-12-02T20:39:52.117966" + "timestamp": "2025-12-03T11:49:24.930644" } } \ No newline at end of file diff --git a/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap b/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap index 7de922b06dd..606e763d012 100644 --- a/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap +++ b/modules/nf-core/ribocode/ribocode/tests/main.nf.test.snap @@ -30,6 +30,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-12-02T20:40:57.09874" + "timestamp": "2025-12-03T11:51:14.213609" } } \ No newline at end of file