Skip to content

Commit 3b13c6d

Browse files
JackCurraghpinin4fjordsclaude
authored
RiboCode - prepare_transcripts, metaplots, ribocode (#9485)
* add 3 required ribocode modules * GTFUpdate; meta in inputs; No Gzip; * return snaps * nf-test passing * Update RiboCode versions to use topics * Update RiboCode versions to use topics -New lines at EOF * Update RiboCode versions to use topics - Prettier * RiboCode update snapshots * Update RiboCode snapshots to container versions * Bump to latest ribocode build with pyfasta and ribocode fixes * Improve RiboCode module tests and fix review issues - Remove defaults channel from environment.yml files - Fix keywords to lowercase in meta.yml files - Add stub tests to all modules - Update version snapshots from 1.2.14 to 1.2.15 - Remove duplicate snapshot entries - Optimize test setup using pre-made test data: - metaplots/ribocode: use UNTAR for annotation instead of full setup chain - prepare: use pre-made updated GTF instead of running gtfupdate Temporarily points to test-datasets branch pending merge of: nf-core/test-datasets#1820 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update RiboCode snapshot to GHA runner architecture Update md5 hashes to match linux/amd64 output from CI runners. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add schema reference to ribocode/ribocode meta.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Revert nf-test.config to standard test-datasets paths test-datasets PR #1820 has been merged, reverting to nf-core/test-datasets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Jonathan Manning <jonathan.manning@seqera.io> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1b32b48 commit 3b13c6d

22 files changed

Lines changed: 1081 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
channels:
2+
- conda-forge
3+
- bioconda
4+
dependencies:
5+
- bioconda::ribocode=1.2.15
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
process RIBOCODE_GTFUPDATE {
2+
tag "$meta.id"
3+
label 'process_single'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/fe/fe815db0864b45b91afc7bc84c55cb60acb0035e7248dda7f480a55c4cb105d7/data':
8+
'community.wave.seqera.io/library/ribocode:1.2.15--5530b252f5433a62' }"
9+
10+
input:
11+
tuple val(meta), path(gtf)
12+
13+
output:
14+
tuple val(meta), path("*.gtf") , emit: gtf
15+
tuple val("${task.process}"), val('ribocode'), eval('RiboCode --version 2>&1') , emit: versions_ribocode, topic: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def args = task.ext.args ?: ''
22+
def prefix = task.ext.prefix ?: "${meta.id}"
23+
24+
"""
25+
GTFupdate \\
26+
${gtf} \\
27+
$args \\
28+
> ${prefix}_updated.gtf
29+
"""
30+
31+
stub:
32+
def args = task.ext.args ?: ''
33+
def prefix = task.ext.prefix ?: "${meta.id}"
34+
35+
"""
36+
touch ${prefix}_updated.gtf
37+
"""
38+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
2+
name: "ribocode_gtfupdate"
3+
description: Update GTF annotation file for RiboCode compatibility
4+
keywords:
5+
- ribo-seq
6+
- ribosome profiling
7+
- gtf
8+
- annotation
9+
tools:
10+
- "ribocode":
11+
description: "A package for detecting the actively translated ORFs using ribosome-profiling
12+
data"
13+
homepage: "https://github.com/xryanglab/RiboCode"
14+
documentation: "https://github.com/xryanglab/RiboCode"
15+
tool_dev_url: "https://github.com/xryanglab/RiboCode"
16+
doi: "10.1093/nar/gky179"
17+
licence: ["MIT"]
18+
identifier: ""
19+
20+
input:
21+
- - meta:
22+
type: map
23+
description: |
24+
Groovy Map containing sample information
25+
e.g. `[ id:'test', single_end:false ]`
26+
- gtf:
27+
type: file
28+
description: GTF annotation file to update (uncompressed)
29+
pattern: "*.{gtf}"
30+
ontologies: []
31+
output:
32+
gtf:
33+
- - meta:
34+
type: map
35+
description: |
36+
Groovy Map containing sample information
37+
e.g. `[ id:'test', single_end:false ]`
38+
- "*.gtf":
39+
type: file
40+
description: Updated GTF annotation file
41+
pattern: "*_updated.gtf"
42+
versions_ribocode:
43+
- - ${task.process}:
44+
type: string
45+
description: Name of the process
46+
- ribocode:
47+
type: string
48+
description: Name of the tool
49+
- RiboCode --version 2>&1:
50+
type: eval
51+
description: The expression to obtain the version of the tool
52+
53+
topics:
54+
versions:
55+
- - ${task.process}:
56+
type: string
57+
description: Name of the process
58+
- ribocode:
59+
type: string
60+
description: Name of the tool
61+
- RiboCode --version 2>&1:
62+
type: eval
63+
description: The expression to obtain the version of the tool
64+
65+
authors:
66+
- "@JackCurragh"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
nextflow_process {
2+
3+
name "Test Process RIBOCODE_GTFUPDATE"
4+
script "../main.nf"
5+
process "RIBOCODE_GTFUPDATE"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "ribocode"
10+
tag "ribocode/gtfupdate"
11+
12+
test("test_ribocode_gtfupdate") {
13+
14+
when {
15+
process {
16+
"""
17+
input[0] = [
18+
[ id:'test' ],
19+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true)
20+
]
21+
"""
22+
}
23+
}
24+
25+
then {
26+
assertAll(
27+
{ assert process.success },
28+
{ assert snapshot(process.out).match("process_outputs") },
29+
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match("versions") }
30+
)
31+
}
32+
}
33+
34+
test("test_ribocode_gtfupdate - stub") {
35+
36+
options "-stub"
37+
38+
when {
39+
process {
40+
"""
41+
input[0] = [
42+
[ id:'test' ],
43+
file(params.modules_testdata_base_path + "genomics/homo_sapiens/riboseq_expression/Homo_sapiens.GRCh38.111_chr20.gtf", checkIfExists: true)
44+
]
45+
"""
46+
}
47+
}
48+
49+
then {
50+
assertAll(
51+
{ assert process.success },
52+
{ assert process.out.gtf[0][1].toString().endsWith('.gtf') }
53+
)
54+
}
55+
}
56+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"versions": {
3+
"content": [
4+
{
5+
"versions_ribocode": [
6+
[
7+
"RIBOCODE_GTFUPDATE",
8+
"ribocode",
9+
"1.2.15"
10+
]
11+
]
12+
}
13+
],
14+
"meta": {
15+
"nf-test": "0.9.3",
16+
"nextflow": "25.10.2"
17+
},
18+
"timestamp": "2025-12-15T13:58:20.352527"
19+
},
20+
"process_outputs": {
21+
"content": [
22+
{
23+
"0": [
24+
[
25+
{
26+
"id": "test"
27+
},
28+
"test_updated.gtf:md5,4aee3722f1d061395e2fdce7277708b3"
29+
]
30+
],
31+
"1": [
32+
[
33+
"RIBOCODE_GTFUPDATE",
34+
"ribocode",
35+
"1.2.15"
36+
]
37+
],
38+
"gtf": [
39+
[
40+
{
41+
"id": "test"
42+
},
43+
"test_updated.gtf:md5,4aee3722f1d061395e2fdce7277708b3"
44+
]
45+
],
46+
"versions_ribocode": [
47+
[
48+
"RIBOCODE_GTFUPDATE",
49+
"ribocode",
50+
"1.2.15"
51+
]
52+
]
53+
}
54+
],
55+
"meta": {
56+
"nf-test": "0.9.3",
57+
"nextflow": "25.10.2"
58+
},
59+
"timestamp": "2025-12-15T13:58:20.062134"
60+
}
61+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
channels:
2+
- conda-forge
3+
- bioconda
4+
dependencies:
5+
- bioconda::ribocode=1.2.15
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
process RIBOCODE_METAPLOTS {
2+
tag "$meta.id"
3+
label 'process_single'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/fe/fe815db0864b45b91afc7bc84c55cb60acb0035e7248dda7f480a55c4cb105d7/data':
8+
'community.wave.seqera.io/library/ribocode:1.2.15--5530b252f5433a62' }"
9+
10+
input:
11+
tuple val(meta), path(bam)
12+
tuple val(meta2), path(annotation)
13+
14+
output:
15+
tuple val(meta), path("*config.txt") , emit: config
16+
tuple val(meta), path("*.pdf") , emit: pdf
17+
tuple val("${task.process}"), val('ribocode'), eval('RiboCode --version 2>&1') , emit: versions_ribocode, topic: versions
18+
19+
when:
20+
task.ext.when == null || task.ext.when
21+
22+
script:
23+
def args = task.ext.args ?: ''
24+
def prefix = task.ext.prefix ?: "${meta.id}"
25+
"""
26+
metaplots \\
27+
-a $annotation \\
28+
-r $bam \\
29+
-o ${prefix} \\
30+
$args
31+
"""
32+
33+
stub:
34+
def args = task.ext.args ?: ''
35+
def prefix = task.ext.prefix ?: "${meta.id}"
36+
"""
37+
touch ${prefix}_config.txt
38+
touch ${prefix}_report.pdf
39+
"""
40+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
2+
name: "ribocode_metaplots"
3+
description: Set up RiboCode ORF calling with metaplots
4+
keywords:
5+
- ribo-seq
6+
- ribosome profiling
7+
- orf calling
8+
tools:
9+
- "ribocode":
10+
description: "A package for detecting the actively translated ORFs using ribosome-profiling
11+
data"
12+
homepage: "https://github.com/xryanglab/RiboCode"
13+
documentation: "https://github.com/xryanglab/RiboCode"
14+
tool_dev_url: "https://github.com/xryanglab/RiboCode"
15+
doi: "10.1093/nar/gky179"
16+
licence: ["MIT"]
17+
identifier: ""
18+
19+
input:
20+
- - meta:
21+
type: map
22+
description: |
23+
Groovy Map containing sample information
24+
e.g. `[ id:'test', single_end:false ]`
25+
- bam:
26+
type: file
27+
description: Sorted BAM/CRAM/SAM file
28+
pattern: "*.{bam,cram,sam}"
29+
ontologies: []
30+
- - meta2:
31+
type: map
32+
description: |
33+
Groovy Map containing annotation information
34+
e.g. `[ id:'genome' ]`
35+
- annotation:
36+
type: directory
37+
description: Directory containing annotation files from ribocode/prepare
38+
pattern: "annotation"
39+
40+
output:
41+
config:
42+
- - meta:
43+
type: map
44+
description: |
45+
Groovy Map containing sample information
46+
e.g. `[ id:'test', single_end:false ]`
47+
- "*config.txt":
48+
type: file
49+
description: RiboCode configuration file containing P-site offsets
50+
pattern: "*_config.txt"
51+
ontologies: []
52+
pdf:
53+
- - meta:
54+
type: map
55+
description: |
56+
Groovy Map containing sample information
57+
e.g. `[ id:'test', single_end:false ]`
58+
- "*.pdf":
59+
type: file
60+
description: PDF file containing P-site metaplots for quality control
61+
pattern: "*_report.pdf"
62+
ontologies: []
63+
versions_ribocode:
64+
- - ${task.process}:
65+
type: string
66+
description: Name of the process
67+
- ribocode:
68+
type: string
69+
description: Name of the tool
70+
- RiboCode --version 2>&1:
71+
type: eval
72+
description: The expression to obtain the version of the tool
73+
74+
topics:
75+
versions:
76+
- - ${task.process}:
77+
type: string
78+
description: Name of the process
79+
- ribocode:
80+
type: string
81+
description: Name of the tool
82+
- RiboCode --version 2>&1:
83+
type: eval
84+
description: The expression to obtain the version of the tool
85+
86+
authors:
87+
- "@JackCurragh"

0 commit comments

Comments
 (0)