Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/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)
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
"""
}
64 changes: 64 additions & 0 deletions modules/nf-core/ribocode/metaplots/meta.yml
Original file line number Diff line number Diff line change
@@ -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"
51 changes: 51 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,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() }
)
}

}

}
55 changes: 55 additions & 0 deletions modules/nf-core/ribocode/metaplots/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/ribocode/metaplots/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: RIBOCODE_METAPLOTS {
ext.args = '-f0_percent 0.1 -pv1 1 -pv2 1'
}
}
6 changes: 6 additions & 0 deletions modules/nf-core/ribocode/prepare/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
64 changes: 64 additions & 0 deletions modules/nf-core/ribocode/prepare/main.nf
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use the prefix convention to pick output paths


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See topics point

"${task.process}":
RiboCode: \$(echo "1.2.15")
END_VERSIONS
"""
}
45 changes: 45 additions & 0 deletions modules/nf-core/ribocode/prepare/meta.yml
Original file line number Diff line number Diff line change
@@ -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"
32 changes: 32 additions & 0 deletions modules/nf-core/ribocode/prepare/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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() }
)
}

}

}
Loading
Loading