Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5ccd85b
Initial commit that passes pre-commit hooks, trying minimal parameter…
akaviaLab Jan 18, 2026
4f2ad83
Initial version of rmats prep task correctly using args
akaviaLab Feb 3, 2026
b1ca50f
fixed some minor problems
akaviaLab Feb 3, 2026
413229d
updated meta.yml for rmats prep task
akaviaLab Feb 11, 2026
7e11e0a
Added read outcome file to output
akaviaLab Feb 11, 2026
c85ce8e
Added test config with args, and removed some TODOs
akaviaLab Feb 22, 2026
dd0443f
Trying to use topics
akaviaLab Feb 23, 2026
7957efd
fix version section of meta.yml
mashehu Feb 25, 2026
eb7662b
fix patterns
mashehu Feb 25, 2026
5150e5f
meta.yml that works with topics
akaviaLab Feb 25, 2026
c985940
Deleted unnecessary file
akaviaLab Feb 25, 2026
a772926
rmats prep test works as exepcted for rnasplice files
akaviaLab Mar 8, 2026
028d1c6
Added tests for all parameters of rmats
akaviaLab Mar 8, 2026
86c8a8c
Remoevd TODO lines from main.nf
akaviaLab Mar 8, 2026
5b92e0a
Changes as part of the review
akaviaLab Mar 18, 2026
4c4cfdc
Merge branch 'master' into rmats
SPPearce Mar 20, 2026
6bf74a8
Apply suggestions from code review
akaviaLab Mar 31, 2026
7e0ba25
Merge branch 'master' into rmats
SPPearce Apr 8, 2026
feab635
Meta2 is present in meta.yml
akaviaLab Apr 8, 2026
b2125d3
Tests should work now
akaviaLab Apr 12, 2026
aac887c
Merge branch 'master' into rmats
akaviaLab Apr 12, 2026
f4499da
Applied suggestions from code review
akaviaLab Apr 18, 2026
3313092
Merge branch 'master' into rmats
akaviaLab Apr 18, 2026
e43f365
Renamed output read_outcomes in tests
akaviaLab Apr 18, 2026
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
7 changes: 7 additions & 0 deletions modules/nf-core/rmats/prep/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::rmats=4.3.0"
52 changes: 52 additions & 0 deletions modules/nf-core/rmats/prep/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
process RMATS_PREP {
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/rmats:4.3.0--py311hf2f0b74_5'
: 'biocontainers/rmats:4.3.0--py311hf2f0b74_5'}"

input:
tuple val(meta), path(genome_bam)
tuple val(meta2), path(reference_gtf)
val read_length

output:
tuple val(meta), path("*.rmats"), emit: rmats
tuple val(meta), path("*read_outcomes_by_bam.txt"), emit: read_outcomes
tuple val("${task.process}"), val('rmats'), eval('rmats.py --version | sed -e "s/v//g"'), emit: versions_rmats, topic: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
Comment thread
akaviaLab marked this conversation as resolved.
"""
echo ${genome_bam} > ${prefix}.prep.b1.txt

rmats.py \\
--task prep \\
${args} \\
--nthread ${task.cpus} \\
--b1 ${prefix}.prep.b1.txt \\
--gtf ${reference_gtf} \\
--readLength ${read_length} \\
--tmp ${prefix}_rmats_tmp \\
--od ${prefix}_rmats_prep

cp ${prefix}_rmats_tmp/*.txt ${prefix}_read_outcomes_by_bam.txt
cp ${prefix}_rmats_tmp/*.rmats ${prefix}.rmats
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo ${args}

touch ${prefix}.rmats
touch ${prefix}_read_outcomes_by_bam.txt
"""
}
92 changes: 92 additions & 0 deletions modules/nf-core/rmats/prep/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: "rmats_prep"
description: MATS is a computational tool to detect differential alternative
splicing events from RNA-Seq data.
keywords:
- splicing
- RNA-Seq
- alternative splicing
- exon
- intron
- rMATS
tools:
- "rmats":
description: "MATS is a computational tool to detect differential alternative
splicing events from RNA-Seq data."
homepage: "https://github.com/Xinglab/rmats-turbo"
documentation: "https://github.com/Xinglab/rmats-turbo/blob/v4.3.0/README.md"
doi: "10.1038/s41596-023-00944-2"
licence:
- "FreeBSD for non-commercial use, see LICENSE file"
identifier: biotools:rmats
input:
- - meta:
type: map
description: Groovy Map containing sample information. e.g. `[
id:'sample1', single_end:false, strandness:'auto']`
- genome_bam:
type: file
description: BAM file aligned to the genome
pattern: "*.{bam}"
ontologies:
- edam: http://edamontology.org/format_2572
- - meta2:
type: map
description: Groovy Map containing genome information
- reference_gtf:
type: file
description: Annotation GTF file
pattern: "*.{gtf}"
ontologies:
- edam: http://edamontology.org/format_2306
- read_length:
type: integer
description: Read length in bases
output:
rmats:
- - meta:
type: map
description: Groovy Map containing sample information. e.g. `[
id:'sample1'single_end:false, strandness:'auto']`
- "*.rmats":
type: file
description: rmats junction count information, after processing the BAM
file
pattern: "*.rmats"
ontologies: []
read_outcomes:
- - meta:
type: map
description: Groovy Map containing sample information. e.g. `[
id:'sample1'single_end:false, strandness:'auto']`
- "*read_outcomes_by_bam.txt":
type: file
description: text file detailing number of reads used and not used for
various reasons (clipped, not paired, wrong length, etc.)
pattern: "*read_outcomes_by_bam.txt"
ontologies:
- edam: http://edamontology.org/format_2330
versions_rmats:
- - ${task.process}:
type: string
description: The process the versions were collected from
- rmats:
type: string
description: The tool name
- rmats.py --version | sed -e "s/v//g":
type: eval
description: The command used to generate the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The process the versions were collected from
- rmats:
type: string
description: The tool name
- rmats.py --version | sed -e "s/v//g":
type: eval
description: The command used to generate the version of the tool
authors:
- "@akaviaLab"
maintainers:
- "@akaviaLab"
237 changes: 237 additions & 0 deletions modules/nf-core/rmats/prep/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
nextflow_process {

name "Test Process RMATS_PREP"
script "../main.nf"
process "RMATS_PREP"

tag "modules"
tag "modules_nfcore"
tag "rmats"
tag "rmats/prep"

test("homo_sapiens - paired unstranded rmats prep") {

config "./nextflow.config"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false, strandness:"unstranded" ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true),
]
input[1] = [
[id: 'hg38'], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
input[2] = 150
"""
}
}

then {
def lines = path(process.out.read_outcomes[0][1]).readLines()
def reads_used = lines[1] =~ /USED: (\d+)/
def reads_clipped = lines[9] =~ /CLIPPED: (\d+)/
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() },
{ assert reads_used[0][1] as Integer > 0 },
{ assert reads_clipped[0][1] as Integer == 0 }
)
}

}

test("homo_sapiens - single-end unstranded rmats prep") {

config "./nextflow.config"
when {
process {
"""
input[0] = [
[ id:'test', single_end:true, strandness:"unstranded" ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true),
]
input[1] = [
[id: 'hg38'], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
input[2] = 150
"""
}
}

then {
def lines = path(process.out.read_outcomes[0][1]).readLines()
def reads_used = lines[1] =~ /USED: (\d+)/
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() },
{ assert reads_used[0][1] as Integer > 0 }
)
}

}

test("homo_sapiens - paired forward rmats prep") {

config "./nextflow.config"
when {
process {
"""
input[0] = [
[ id:'test', single_end:false, strandness:"forward" ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true),
]
input[1] = [
[id: 'hg38'], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
input[2] = 150
"""
}
}

then {
def lines = path(process.out.read_outcomes[0][1]).readLines()
def reads_used = lines[1] =~ /USED: (\d+)/
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() },
{ assert reads_used[0][1] as Integer > 0 }
)
}

}

test("homo_sapiens - paired reverse rmats prep") {

config "./nextflow.config"
when {
process {
"""
input[0] = [
[ id:'test', single_end:false, strandness:"reverse" ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true),
]
input[1] = [
[id: 'hg38'], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
input[2] = 150
"""
}
}

then {
def lines = path(process.out.read_outcomes[0][1]).readLines()
def reads_used = lines[1] =~ /USED: (\d+)/
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() },
{ assert reads_used[0][1] as Integer > 0 }
)
}

}

test("homo_sapiens - paired unstranded novel splice rmats prep") {

config "./nextflow.config"
when {
process {
"""
input[0] = [
[ id:'test', single_end:false, strandness:"unstranded" ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true),
]
input[1] = [
[id: 'hg38'], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
input[2] = 150
"""
}
params {
novel_splice_site = true
minimum_intron_length = 48
max_exon_length = 488
}
}

then {
def lines = path(process.out.read_outcomes[0][1]).readLines()
def reads_used = lines[1] =~ /USED: (\d+)/
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() },
{ assert reads_used[0][1] as Integer > 0 }
)
}

}

test("homo_sapiens - paired unstranded no clipping rmats prep") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false, strandness:"unstranded" ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true),
]
input[1] = [
[id: 'hg38'], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
input[2] = 150
"""
}
}

then {
def lines = path(process.out.read_outcomes[0][1]).readLines()
def reads_used = lines[1] =~ /USED: (\d+)/
def reads_clipped = lines[9] =~ /CLIPPED: (\d+)/
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() },
{ assert reads_used[0][1] as Integer > 0 },
{ assert reads_clipped[0][1] as Integer > 0},
{ assert reads_clipped[0][1] as Integer > reads_used[0][1] as Integer }
)
}

}

test("homo_sapiens - prep - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false, strandness:"unstranded" ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.rna.paired_end.bam', checkIfExists: true),
]
input[1] = [
[id: 'hg38'], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
]
input[2] = 150
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

}
Loading
Loading