Skip to content
Merged
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
7 changes: 7 additions & 0 deletions modules/nf-core/rseqc/splitbam/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::rseqc=5.0.4"
42 changes: 42 additions & 0 deletions modules/nf-core/rseqc/splitbam/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
process RSEQC_SPLITBAM {
tag "$meta.id"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/rseqc:5.0.4--pyhdfd78af_1' :
'biocontainers/rseqc:5.0.4--pyhdfd78af_1' }"

input:
tuple val(meta) , path(bam), path(bai)
tuple val(meta2), path(bed)

output:
tuple val(meta), path("*.in.bam") , emit: in_bam
tuple val(meta), path("*.ex.bam") , emit: ex_bam
tuple val(meta), path("*.junk.bam"), emit: junk_bam
tuple val("${task.process}"), val('rseqc'), eval('split_bam.py --version | sed "s/split_bam.py //"'), emit: versions_rseqc, topic: versions


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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
split_bam.py \\
-i $bam \\
-r $bed \\
-o $prefix \\
$args
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.in.bam
touch ${prefix}.ex.bam
touch ${prefix}.junk.bam
"""
}
111 changes: 111 additions & 0 deletions modules/nf-core/rseqc/splitbam/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: rseqc_splitbam
description: Split BAM file based on gene list in BED format
keywords:
- bam
- split
- rnaseq
- quality control
tools:
- "rseqc":
description: |
RSeQC package provides a number of useful modules that can comprehensively evaluate
high throughput sequence data especially RNA-seq data.
homepage: "http://rseqc.sourceforge.net/"
documentation: "http://rseqc.sourceforge.net/"
tool_dev_url: "https://github.com/MonashBioinformaticsPlatform/RSeQC"
doi: "10.1093/bioinformatics/bts356"
licence: ["GPL-3.0-or-later"]
identifier: biotools:rseqc

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- bam:
type: file
description: Sorted BAM file
pattern: "*.{bam}"
ontologies:
- edam: "http://edamontology.org/format_2572" # BAM
- bai:
type: file
description: BAM index file
pattern: "*.{bai}"
ontologies:
- edam: "http://edamontology.org/format_3327" # BAI
- - meta2:
type: map
description: |
Groovy Map containing reference information
e.g. `[ id:'reference' ]`
- bed:
type: file
description: Gene list in BED format to split the BAM by
pattern: "*.{bed}"
ontologies:
- edam: "http://edamontology.org/format_3003" # BED

output:
in_bam:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.in.bam":
type: file
description: BAM file containing reads that mapped to the gene list
pattern: "*.in.bam"
ontologies:
- edam: "http://edamontology.org/format_2572" # BAM
ex_bam:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.ex.bam":
type: file
description: BAM file containing reads that did not map to the gene list
pattern: "*.ex.bam"
ontologies:
- edam: "http://edamontology.org/format_2572" # BAM
junk_bam:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.junk.bam":
type: file
description: BAM file containing QC failed or unmapped reads
pattern: "*.junk.bam"
ontologies:
- edam: "http://edamontology.org/format_2572" # BAM
versions_rseqc:
- - ${task.process}:
type: string
description: The process the versions were collected from
- rseqc:
type: string
description: The tool name
- split_bam.py --version | sed "s/split_bam.py //":
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The process the versions were collected from
- rseqc:
type: string
description: The tool name
- split_bam.py --version | sed "s/split_bam.py //":
type: eval
description: The expression to obtain the version of the tool
authors:
- "@rhassaine"
maintainers:
- "@rhassaine"
72 changes: 72 additions & 0 deletions modules/nf-core/rseqc/splitbam/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "rseqc"
tag "rseqc/splitbam"

test("sarscov2 - [[meta] - bam - bai] - [[meta2] - bed]") {

when {
process {
"""
input[0] = Channel.of([
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true)
])
input[1] = Channel.of([
[ id:'test_bed' ], // meta2 map
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed12", checkIfExists: true)
])
"""
}
}

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

}

test("sarscov2 - [[meta] - bam - bai] - [[meta2] - bed] - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam", checkIfExists: true),
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true)
])
input[1] = Channel.of([
[ id:'test_bed' ], // meta2 map
file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed12", checkIfExists: true)
])
"""
}
}

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

}

}
148 changes: 148 additions & 0 deletions modules/nf-core/rseqc/splitbam/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"sarscov2 - [[meta] - bam - bai] - [[meta2] - bed] - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.in.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test.ex.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test"
},
"test.junk.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
[
"RSEQC_SPLITBAM",
"rseqc",
"5.0.4"
]
],
"ex_bam": [
[
{
"id": "test"
},
"test.ex.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"in_bam": [
[
{
"id": "test"
},
"test.in.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"junk_bam": [
[
{
"id": "test"
},
"test.junk.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_rseqc": [
[
"RSEQC_SPLITBAM",
"rseqc",
"5.0.4"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.10.2"
},
"timestamp": "2025-12-10T08:52:06.92323219"
},
"sarscov2 - [[meta] - bam - bai] - [[meta2] - bed]": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.in.bam:md5,1b683a36569410a655b2c2cd5312a9de"
]
],
"1": [
[
{
"id": "test"
},
"test.ex.bam:md5,de1a667ed02b677907c441792a9fd651"
]
],
"2": [
[
{
"id": "test"
},
"test.junk.bam:md5,db5d68a1eef108c6bef2090beb0941bd"
]
],
"3": [
[
"RSEQC_SPLITBAM",
"rseqc",
"5.0.4"
]
],
"ex_bam": [
[
{
"id": "test"
},
"test.ex.bam:md5,de1a667ed02b677907c441792a9fd651"
]
],
"in_bam": [
[
{
"id": "test"
},
"test.in.bam:md5,1b683a36569410a655b2c2cd5312a9de"
]
],
"junk_bam": [
[
{
"id": "test"
},
"test.junk.bam:md5,db5d68a1eef108c6bef2090beb0941bd"
]
],
"versions_rseqc": [
[
"RSEQC_SPLITBAM",
"rseqc",
"5.0.4"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.10.2"
},
"timestamp": "2025-12-10T08:52:00.227785889"
}
}
Loading