Skip to content
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
6 changes: 6 additions & 0 deletions modules/nf-core/ribocode/gtfupdate/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::ribocode=1.2.15
48 changes: 48 additions & 0 deletions modules/nf-core/ribocode/gtfupdate/main.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}
48 changes: 48 additions & 0 deletions modules/nf-core/ribocode/gtfupdate/meta.yml
Original file line number Diff line number Diff line change
@@ -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"
34 changes: 34 additions & 0 deletions modules/nf-core/ribocode/gtfupdate/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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() }
)
}

}

}
35 changes: 35 additions & 0 deletions modules/nf-core/ribocode/gtfupdate/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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-08T12:55:37.985303"
}
}
6 changes: 6 additions & 0 deletions modules/nf-core/ribocode/metaplots/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::ribocode=1.2.15
50 changes: 50 additions & 0 deletions modules/nf-core/ribocode/metaplots/main.nf
Original file line number Diff line number Diff line change
@@ -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)
tuple val(meta2), 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
"""
}
69 changes: 69 additions & 0 deletions modules/nf-core/ribocode/metaplots/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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: []
- - 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:
- - 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"
78 changes: 78 additions & 0 deletions modules/nf-core/ribocode/metaplots/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
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"
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] = GUNZIP.out.gunzip
input[1] = RIBOCODE_GTFUPDATE.out.gtf
"""
}
}
}

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.config,
process.out.versions
).match() },
{ assert process.out.pdf[0][1].toString().endsWith('.pdf') }
)
}

}

}
Loading
Loading