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
34 changes: 19 additions & 15 deletions modules/nf-core/stringtie/merge/main.nf
Comment thread
Odulhin marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
process STRINGTIE_MERGE {
tag "${meta.id}"
label 'process_medium'

// Note: 2.7X indices incompatible with AWS iGenomes.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/stringtie:2.2.1--hecb563c_2' :
'biocontainers/stringtie:2.2.1--hecb563c_2' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/stringtie:2.2.1--hecb563c_2'
: 'biocontainers/stringtie:2.2.1--hecb563c_2'}"

input:
path stringtie_gtf
path annotation_gtf
tuple val(meta), path(gtf)
tuple val(meta2), path(annotation_gtf)

output:
path "stringtie.merged.gtf", emit: gtf
tuple val(meta), path("${prefix}.gtf"), emit: merged_gtf
tuple val("${task.process}"), val('stringtie'), eval('stringtie --version'), emit: versions_stringtie, topic: versions

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

script:
def args = task.ext.args ?: ''
def reference = annotation_gtf ? "-G $annotation_gtf" : ""
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def reference = annotation_gtf ? "-G ${annotation_gtf}" : ""
"""
stringtie \\
--merge $stringtie_gtf \\
$reference \\
-o stringtie.merged.gtf \\
$args

--merge \\
${gtf} \\
${reference} \\
-o ${prefix}.gtf \\
-p ${task.cpus} \\
${args}
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch stringtie.merged.gtf

touch ${prefix}.gtf
"""
}
56 changes: 38 additions & 18 deletions modules/nf-core/stringtie/merge/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,32 @@ tools:
- "MIT"
identifier: biotools:stringtie
input:
- stringtie_gtf:
type: file
description: |
Stringtie transcript gtf output(s).
pattern: "*.gtf"
ontologies: []
- annotation_gtf:
type: file
description: |
Annotation gtf file (optional).
pattern: "*.gtf"
ontologies: []
output:
gtf:
- stringtie.merged.gtf:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- gtf:
type: file
description: Merged gtf file
pattern: "stringtie.merged.gtf"
ontologies: []
description: |
Stringtie transcript gtf output(s) to be merged together.
pattern: "*.{gtf|gff}"
ontologies:
- edam: "http://edamontology.org/format_2306"
- edam: "http://edamontology.org/format_1975"
- - meta2:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- annotation_gtf:
type: file
description: |
Reference annotation gtf file (optional).
pattern: "*.{gtf}"
ontologies:
- edam: "http://edamontology.org/format_2306"
output:
versions_stringtie:
- - ${task.process}:
type: string
Expand All @@ -43,6 +50,19 @@ output:
- stringtie --version:
type: eval
description: The expression to obtain the version of the tool
merged_gtf:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- ${prefix}.gtf:
type: file
description: A unified non-redundant set of isoforms from the provided
gtf files.
pattern: "${prefix}.{gtf}"
ontologies:
- edam: "http://edamontology.org/format_2306"
topics:
versions:
- - ${task.process}:
Expand Down
18 changes: 10 additions & 8 deletions modules/nf-core/stringtie/merge/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ nextflow_process {
when {
process {
"""
input[0] = STRINGTIE_STRINGTIE.out.transcript_gtf.map { it -> it[1] }
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
input[0] = STRINGTIE_STRINGTIE.out.transcript_gtf
input[1] = [[id:'ref', strandedness:'forward'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gtf).match("fs_gtf") },
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match("fs_versions") }
{ assert snapshot(
sanitizeOutput(process.out)
).match() }
Comment thread
Odulhin marked this conversation as resolved.
)
}
}
Expand All @@ -49,17 +50,18 @@ nextflow_process {
when {
process {
"""
input[0] = STRINGTIE_STRINGTIE.out.transcript_gtf.map { it -> it[1] }
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)
input[0] = STRINGTIE_STRINGTIE.out.transcript_gtf
input[1] = [[id:'ref', strandedness:'reverse'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) ]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gtf).match("rs_gtf") },
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match("rs_versions") }
{ assert snapshot(
sanitizeOutput(process.out)
).match() }
)
}
}
Expand Down
50 changes: 22 additions & 28 deletions modules/nf-core/stringtie/merge/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"rs_versions": {
"homo_sapiens - forward strandedness": {
"content": [
{
"merged_gtf": [
[
{
"id": "test",
"strandedness": "reverse"
},
"test.gtf:md5,40780dc05eff7cf2c77705f857768441"
]
],
"versions_stringtie": [
[
"STRINGTIE_MERGE",
Expand All @@ -11,39 +20,24 @@
]
}
],
"timestamp": "2026-04-01T10:23:50.809860959",
"timestamp": "2026-04-08T13:02:20.089324763",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
}
},
"rs_gtf": {
"content": [
[
"stringtie.merged.gtf:md5,6da479298d73d5b3216d4e1576a2bdf4"
]
],
"timestamp": "2023-11-23T14:14:39.691894799",
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
}
},
"fs_gtf": {
"content": [
[
"stringtie.merged.gtf:md5,6da479298d73d5b3216d4e1576a2bdf4"
]
],
"timestamp": "2024-02-07T16:43:48.130184",
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
}
},
"fs_versions": {
"homo_sapiens - reverse strandedness": {
"content": [
{
"merged_gtf": [
[
{
"id": "test",
"strandedness": "reverse"
},
"test.gtf:md5,40780dc05eff7cf2c77705f857768441"
]
],
"versions_stringtie": [
[
"STRINGTIE_MERGE",
Expand All @@ -53,7 +47,7 @@
]
}
],
"timestamp": "2026-04-01T10:22:57.308138643",
"timestamp": "2026-04-08T13:02:52.305961798",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
Expand Down
17 changes: 6 additions & 11 deletions subworkflows/nf-core/bam_stringtie_merge/main.nf
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
include { STRINGTIE_STRINGTIE } from '../../../modules/nf-core/stringtie/stringtie/main'
include { STRINGTIE_MERGE } from '../../../modules/nf-core/stringtie/merge/main'
include { STRINGTIE_MERGE } from '../../../modules/nf-core/stringtie/merge/main'


workflow BAM_STRINGTIE_MERGE {

take:
bam_sorted // channel: [ meta, bam ]
ch_chrgtf // channel: [ meta, gtf ]
ch_chrgtf // channel: [ meta, gtf ]

main:
ch_versions = channel.empty()
ch_stringtie_gtfs = channel.empty()

STRINGTIE_STRINGTIE(
bam_sorted,
ch_chrgtf.map { _meta, gtf -> [ gtf ] }
ch_chrgtf.map { _meta, gtf -> [gtf] },
)

STRINGTIE_STRINGTIE.out.transcript_gtf
.map { _meta, gtf -> [ gtf ] }
.set { stringtie_gtfs }
STRINGTIE_STRINGTIE.out.transcript_gtf.set { stringtie_gtfs }

STRINGTIE_MERGE(
stringtie_gtfs,
ch_chrgtf.map { _meta, gtf -> [ gtf ] }
ch_chrgtf
)
ch_stringtie_gtfs = STRINGTIE_MERGE.out.gtf
ch_stringtie_gtfs = STRINGTIE_MERGE.out.merged_gtf

emit:
stringtie_gtf = ch_stringtie_gtfs // channel: [ meta, gtf ]
versions = ch_versions // channel: [ path(versions.yml) ]
}
4 changes: 3 additions & 1 deletion subworkflows/nf-core/bam_stringtie_merge/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ nextflow_workflow {
then {
assertAll(
{ assert workflow.success },
{ assert snapshot(workflow.out).match() },
{ assert snapshot(
sanitizeOutput(workflow.out)
).match() },
)
}
}
Expand Down
19 changes: 8 additions & 11 deletions subworkflows/nf-core/bam_stringtie_merge/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
"Should run stringtie subworkflow": {
"content": [
{
"0": [
"stringtie.merged.gtf:md5,6da479298d73d5b3216d4e1576a2bdf4"
],
"1": [

],
"stringtie_gtf": [
"stringtie.merged.gtf:md5,6da479298d73d5b3216d4e1576a2bdf4"
],
"versions": [

[
{
"id": "test",
"strandedness": "reverse"
},
"test.gtf:md5,40780dc05eff7cf2c77705f857768441"
]
]
}
],
"timestamp": "2026-04-01T10:24:43.783356616",
"timestamp": "2026-04-08T13:03:23.975567558",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.10.4"
Expand Down
Loading