diff --git a/modules/nf-core/portcullis/full/main.nf b/modules/nf-core/portcullis/full/main.nf index 22628713920b..96a05b306c47 100644 --- a/modules/nf-core/portcullis/full/main.nf +++ b/modules/nf-core/portcullis/full/main.nf @@ -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 @@ -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}": @@ -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}": diff --git a/modules/nf-core/portcullis/full/meta.yml b/modules/nf-core/portcullis/full/meta.yml index d67743c81744..c6a5f87cb958 100644 --- a/modules/nf-core/portcullis/full/meta.yml +++ b/modules/nf-core/portcullis/full/meta.yml @@ -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" @@ -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 @@ -106,3 +155,4 @@ authors: - "@jblancoheredia" maintainer: - "@jblancoheredia" + - "@anoronh4" diff --git a/modules/nf-core/portcullis/full/tests/main.nf.test b/modules/nf-core/portcullis/full/tests/main.nf.test index fe7e9ff06dc1..e98d3dc99cb5 100644 --- a/modules/nf-core/portcullis/full/tests/main.nf.test +++ b/modules/nf-core/portcullis/full/tests/main.nf.test @@ -10,6 +10,7 @@ nextflow_process { tag "portcullis/full" test("portcullis_full_paired_end") { + config "./nextflow.config" when { process { @@ -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() } @@ -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() } diff --git a/modules/nf-core/portcullis/full/tests/main.nf.test.snap b/modules/nf-core/portcullis/full/tests/main.nf.test.snap index 995bed3e85f8..8ee19487bf26 100644 --- a/modules/nf-core/portcullis/full/tests/main.nf.test.snap +++ b/modules/nf-core/portcullis/full/tests/main.nf.test.snap @@ -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" ] ], [ @@ -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" ] ], [ @@ -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": [ @@ -45,7 +55,7 @@ "id": "test", "single_end": false }, - "test.portcullis.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.pass.junctions.bed:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], [ @@ -54,8 +64,14 @@ "id": "test", "single_end": false }, - "test.portcullis.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.pass.junctions.tab:md5,d41d8cd98f00b204e9800998ecf8427e" ] + ], + [ + + ], + [ + ], [ "versions.yml:md5,b297b098450e5baaea436e822fe25b0e" @@ -63,8 +79,8 @@ ], "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" } -} +} \ No newline at end of file diff --git a/modules/nf-core/portcullis/full/tests/nextflow.config b/modules/nf-core/portcullis/full/tests/nextflow.config new file mode 100644 index 000000000000..671cdd5bcd4b --- /dev/null +++ b/modules/nf-core/portcullis/full/tests/nextflow.config @@ -0,0 +1,11 @@ +process { + withName: PORTCULLIS_FULL { + ext.args = { + [ + "--intron_gff", + "--exon_gff", + "--separate" + ].join(" ").trim() + } + } +}