Skip to content

portcullis/full: accommodate more outputs #8166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 1, 2025
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
30 changes: 22 additions & 8 deletions modules/nf-core/portcullis/full/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ process PORTCULLIS_FULL {
tuple val(meta3), path(fasta)

output:
tuple val(meta), path("*.log"), emit: log
tuple val(meta), path("*.bed"), emit: bed
tuple val(meta), path("*.tab"), emit: tab
path "versions.yml" , emit: versions
tuple val(meta), path("*.pass.junctions.bed"), emit: pass_junctions_bed
tuple val(meta), path("*.pass.junctions.tab"), emit: pass_junctions_tab
tuple val(meta), path("*.portcullis.log") , emit: log
tuple val(meta), path("*.intron.gff3") , emit: intron_gff , optional: true
tuple val(meta), path("*.exon.gff3") , emit: exon_gff , optional: true
tuple val(meta), path("*.bam") , emit: spliced_bam, optional: true
tuple val(meta), path("*.bai") , emit: spliced_bai, optional: true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -34,8 +38,18 @@ process PORTCULLIS_FULL {
$fasta \\
$bam > ${prefix}.portcullis.log

cp ${prefix}/3-filt/*.bed .
cp ${prefix}/3-filt/*.tab .
cp ${prefix}/3-filt/*.pass.junctions.bed .
cp ${prefix}/3-filt/*.pass.junctions.tab .
if [ -f ${prefix}/3-filt/*.pass.junctions.intron.gff3 ] ; then
cp ${prefix}/3-filt/*.pass.junctions.intron.gff3 .
fi
if [ -f ${prefix}/3-filt/*.pass.junctions.exon.gff3 ] ; then
cp ${prefix}/3-filt/*.pass.junctions.exon.gff3 .
fi
if [ -f ${prefix}/2-junc/*.spliced.bam ] ; then
cp ${prefix}/2-junc/*.spliced.bam.bai .
cp ${prefix}/2-junc/*.spliced.bam .
fi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -48,8 +62,8 @@ process PORTCULLIS_FULL {
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.portcullis.log
touch ${prefix}.portcullis.bed
touch ${prefix}.portcullis.tab
touch ${prefix}.pass.junctions.bed
touch ${prefix}.pass.junctions.tab

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
82 changes: 66 additions & 16 deletions modules/nf-core/portcullis/full/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ tools:
- "portcullis":
description: "Portcullis is a tool that filters out invalid splice junctions from
RNA-seq alignment data. It accepts BAM files from various RNA-seq mappers, analyzes
splice junctions and removes likely false positives, outputting filtered
results in multiple formats for downstream analysis."
splice junctions and removes likely false positives, outputting filtered results
in multiple formats for downstream analysis."
homepage: "https://portcullis.readthedocs.io/en/latest/index.html"
documentation: "https://portcullis.readthedocs.io/en/latest/using.html"
doi: "10.1101/217620"
Expand Down Expand Up @@ -58,43 +58,92 @@ output:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
pattern: "*.log"
- "*.log":
e.g. [ id:'sample1', single_end:false ]
- "*.portcullis.log":
type: file
description: Log file containing Portcullis execution details, processing steps,
and filtering statistics
pattern: "*.log"
ontologies:
- edam: "http://edamontology.org/format_2330"
- bed:
- pass_junctions_bed:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
pattern: "*.bed"
- "*.bed":
e.g. [ id:'sample1', single_end:false ]
- "*.pass.junctions.bed":
type: file
description: |
Filtered splice junction coordinates in BED format, containing genomic coordinates of valid splice junctions after filtering out false positives
pattern: "*.bed"
pattern: "*.pass.junctions.bed"
ontologies:
- edam: "http://edamontology.org/format_3003"
- tab:
- pass_junctions_tab:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
pattern: "*.tab"
- "*.tab":
type: map
e.g. [ id:'sample1', single_end:false ]
- "*.pass.junctions.tab":
type: file
description: |
Tabular representation of filtered splice junctions with additional metrics including junction scores, read support, and filtering decision data
pattern: "*.tab"
pattern: "*.pass.junctions.tab"
ontologies:
- eadam: "http://edamontology.org/format_3475"
- intron_gff:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'sample1', single_end:false ]
- "*.intron.gff3":
type: file
description: |
Output intron-based junctions in GFF format.
pattern: "*.intron.gff3"
ontologies:
- edam: "http://edamontology.org/format_1975"
- exon_gff:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'sample1', single_end:false ]
- "*.exon.gff3":
type: file
description: |
Output exon-based junctions in GFF format.
pattern: "*.exon.gff3"
ontologies:
- edam: "http://edamontology.org/format_1975"
- spliced_bam:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'sample1', single_end:false ]
- "*.bam":
type: file
description: |
BAM file after filtering original BAM file by removing alignments associated with bad junctions
pattern: "*.bam"
ontologies:
- edam: "http://edamontology.org/format_2572"
- spliced_bai:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'sample1', single_end:false ]
- "*.bai":
type: file
description: |
Index of the output BAM file
pattern: "*.bai"
ontologies:
- edam: "http://edamontology.org/format_3327"
- versions:
- versions.yml:
type: file
Expand All @@ -106,3 +155,4 @@ authors:
- "@jblancoheredia"
maintainer:
- "@jblancoheredia"
- "@anoronh4"
15 changes: 11 additions & 4 deletions modules/nf-core/portcullis/full/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ nextflow_process {
tag "portcullis/full"

test("portcullis_full_paired_end") {
config "./nextflow.config"

when {
process {
Expand All @@ -33,9 +34,13 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert file(process.out.spliced_bam.get(0).get(1)).name == "portcullis_all.spliced.bam" },
{ assert file(process.out.spliced_bai.get(0).get(1)).name == "portcullis_all.spliced.bam.bai" },
{ assert snapshot(
process.out.bed,
process.out.tab,
process.out.pass_junctions_bed,
process.out.pass_junctions_tab,
process.out.intron_gff,
process.out.exon_gff,
process.out.versions
).match()
}
Expand Down Expand Up @@ -70,8 +75,10 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.bed,
process.out.tab,
process.out.pass_junctions_bed,
process.out.pass_junctions_tab,
process.out.intron_gff,
process.out.exon_gff,
process.out.versions
).match()
}
Expand Down
50 changes: 33 additions & 17 deletions modules/nf-core/portcullis/full/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"id": "test",
"single_end": false
},
[
"portcullis_filtered.pass.junctions.bed:md5,613288f6b446359fd0153a7e628e1489",
"portcullis_filtered.rules_in.junctions.bed:md5,572427ab6ea0832a1810ed1e706d3920"
]
"portcullis_filtered.pass.junctions.bed:md5,613288f6b446359fd0153a7e628e1489"
]
],
[
Expand All @@ -19,12 +16,25 @@
"id": "test",
"single_end": false
},
[
"portcullis_filtered.pass.junctions.tab:md5,6e2dd7e93f6b7a23d90d3c3c11e99085",
"portcullis_filtered.rules_in.junctions.tab:md5,6e1aaeb5f73b94142cfa9794d7470a6c",
"portcullis_filtered.rules_out.failed.junctions.tab:md5,be919d60ca646342f6edc2f530174353",
"portcullis_filtered.rules_out.passed.junctions.tab:md5,725bc8ad2a2e8e8456123e25cbb5541b"
]
"portcullis_filtered.pass.junctions.tab:md5,6e2dd7e93f6b7a23d90d3c3c11e99085"
]
],
[
[
{
"id": "test",
"single_end": false
},
"portcullis_filtered.pass.junctions.intron.gff3:md5,3ee2c3526bfb54f81bfd55a3ab679570"
]
],
[
[
{
"id": "test",
"single_end": false
},
"portcullis_filtered.pass.junctions.exon.gff3:md5,7a3c56aca8dcd39ee2dec40589511a81"
]
],
[
Expand All @@ -33,9 +43,9 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
"nextflow": "24.10.3"
},
"timestamp": "2025-03-07T08:45:09.959686"
"timestamp": "2025-04-01T11:06:43.691683"
},
"portcullis_full_paired_end_stub": {
"content": [
Expand All @@ -45,7 +55,7 @@
"id": "test",
"single_end": false
},
"test.portcullis.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
"test.pass.junctions.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
Expand All @@ -54,17 +64,23 @@
"id": "test",
"single_end": false
},
"test.portcullis.tab:md5,d41d8cd98f00b204e9800998ecf8427e"
"test.pass.junctions.tab:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[

],
[

],
[
"versions.yml:md5,b297b098450e5baaea436e822fe25b0e"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
"nextflow": "24.10.3"
},
"timestamp": "2025-03-07T08:45:14.189846"
"timestamp": "2025-04-01T11:06:52.265624"
}
}
}
11 changes: 11 additions & 0 deletions modules/nf-core/portcullis/full/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
process {
withName: PORTCULLIS_FULL {
ext.args = {
[
"--intron_gff",
"--exon_gff",
"--separate"
].join(" ").trim()
}
}
}
Loading