From 52a2d5bf1bd59bb3c9bc516b3e9083fe4d416036 Mon Sep 17 00:00:00 2001 From: Karla Alejandra Ruiz Ceja Date: Sun, 30 Mar 2025 11:09:45 +0200 Subject: [PATCH 1/5] Added subread_featurecounts and htseq modules --- modules.json | 10 + modules/nf-core/htseq/count/environment.yml | 7 + modules/nf-core/htseq/count/main.nf | 49 +++ modules/nf-core/htseq/count/meta.yml | 59 ++++ .../nf-core/htseq/count/tests/main.nf.test | 72 ++++ .../htseq/count/tests/main.nf.test.snap | 72 ++++ .../subread/featurecounts/environment.yml | 7 + modules/nf-core/subread/featurecounts/main.nf | 60 ++++ .../nf-core/subread/featurecounts/meta.yml | 62 ++++ .../subread/featurecounts/tests/main.nf.test | 155 +++++++++ .../featurecounts/tests/main.nf.test.snap | 323 ++++++++++++++++++ .../featurecounts/tests/nextflow.config | 9 + nextflow_schema.json | 15 + workflows/lncpipe.nf | 25 +- 14 files changed, 924 insertions(+), 1 deletion(-) create mode 100644 modules/nf-core/htseq/count/environment.yml create mode 100644 modules/nf-core/htseq/count/main.nf create mode 100644 modules/nf-core/htseq/count/meta.yml create mode 100644 modules/nf-core/htseq/count/tests/main.nf.test create mode 100644 modules/nf-core/htseq/count/tests/main.nf.test.snap create mode 100644 modules/nf-core/subread/featurecounts/environment.yml create mode 100644 modules/nf-core/subread/featurecounts/main.nf create mode 100644 modules/nf-core/subread/featurecounts/meta.yml create mode 100644 modules/nf-core/subread/featurecounts/tests/main.nf.test create mode 100644 modules/nf-core/subread/featurecounts/tests/main.nf.test.snap create mode 100644 modules/nf-core/subread/featurecounts/tests/nextflow.config diff --git a/modules.json b/modules.json index 76d8028..06fe092 100644 --- a/modules.json +++ b/modules.json @@ -75,6 +75,11 @@ "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", "installed_by": ["modules"] }, + "htseq/count": { + "branch": "master", + "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", + "installed_by": ["modules"] + }, "kallisto/index": { "branch": "master", "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", @@ -154,6 +159,11 @@ "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", "installed_by": ["modules"] }, + "subread/featurecounts": { + "branch": "master", + "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", + "installed_by": ["modules"] + }, "trimgalore": { "branch": "master", "git_sha": "81880787133db07d9b4c1febd152c090eb8325dc", diff --git a/modules/nf-core/htseq/count/environment.yml b/modules/nf-core/htseq/count/environment.yml new file mode 100644 index 0000000..cfb7970 --- /dev/null +++ b/modules/nf-core/htseq/count/environment.yml @@ -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::htseq=2.0.3 diff --git a/modules/nf-core/htseq/count/main.nf b/modules/nf-core/htseq/count/main.nf new file mode 100644 index 0000000..ee2e2bb --- /dev/null +++ b/modules/nf-core/htseq/count/main.nf @@ -0,0 +1,49 @@ +process HTSEQ_COUNT { + 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/htseq:2.0.3--py310ha14a713_0': + 'biocontainers/htseq:2.0.3--py310ha14a713_0' }" + + input: + tuple val(meta), path(input), path(index) + tuple val(meta2), path(gtf) + + output: + tuple val(meta), path("*.txt"), emit: txt + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + htseq-count \\ + ${input} \\ + ${gtf} \\ + ${args} \\ + > ${prefix}.txt + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + htseq: \$(echo \$(htseq-count --version ) | sed 's/^.*htseq-count //; s/Using.*\$//' )) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + : \$(echo \$(htseq-count --version ) | sed 's/^.*htseq-count //; s/Using.*\$//' )) + END_VERSIONS + """ +} diff --git a/modules/nf-core/htseq/count/meta.yml b/modules/nf-core/htseq/count/meta.yml new file mode 100644 index 0000000..7e30fe0 --- /dev/null +++ b/modules/nf-core/htseq/count/meta.yml @@ -0,0 +1,59 @@ +name: "htseq_count" +description: count how many reads map to each feature +keywords: + - htseq + - count + - gtf + - annotation +tools: + - "htseq/count": + description: "HTSeq is a Python library to facilitate processing and analysis + of data from high-throughput sequencing (HTS) experiments." + homepage: "https://htseq.readthedocs.io/en/latest/" + documentation: "https://htseq.readthedocs.io/en/latest/index.html" + doi: "10.1093/bioinformatics/btu638" + licence: ["GPL v3"] + identifier: biotools:htseq +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - input: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - index: + type: file + description: Contains indexed bam file + pattern: "*.bai" + - - meta2: + type: map + description: | + .gtf file information + e.g. `[ id:'test' ]` + - gtf: + type: file + description: Contains the features in the GTF format + pattern: "*.gtf" +output: + - txt: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - "*.txt": + type: file + description: File containing feature counts output + pattern: ".txt" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@zehrahazalsezer" +maintainers: + - "@zehrahazalsezer" diff --git a/modules/nf-core/htseq/count/tests/main.nf.test b/modules/nf-core/htseq/count/tests/main.nf.test new file mode 100644 index 0000000..fd70f51 --- /dev/null +++ b/modules/nf-core/htseq/count/tests/main.nf.test @@ -0,0 +1,72 @@ +nextflow_process { + + name "Test Process HTSEQ_COUNT" + script "../main.nf" + process "HTSEQ_COUNT" + tag "modules" + tag "modules_nfcore" + tag "htseq" + tag "htseq/count" + + test("bam input") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + + ] + input[1] = [ + [ id:'test2'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert process.out.txt.get(0).get(1) ==~ ".*.txt" }, + { assert snapshot(process.out).match() } + ) + + } + + } + + test("cram input") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) + + ] + input[1] = [ + [ id:'test2'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert process.out.txt.get(0).get(1) ==~ ".*.txt" }, + { assert snapshot(process.out).match() } + ) + + } + + } + + +} diff --git a/modules/nf-core/htseq/count/tests/main.nf.test.snap b/modules/nf-core/htseq/count/tests/main.nf.test.snap new file mode 100644 index 0000000..e561310 --- /dev/null +++ b/modules/nf-core/htseq/count/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "bam input": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,5e37b2292f1d21945acb532afa5eb615" + ] + ], + "1": [ + "versions.yml:md5,4aad47e2b62180da87cd22e49b2cb1d6" + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,5e37b2292f1d21945acb532afa5eb615" + ] + ], + "versions": [ + "versions.yml:md5,4aad47e2b62180da87cd22e49b2cb1d6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T15:02:21.074352" + }, + "cram input": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,53f9b007bd72115e8b72a40f859bc896" + ] + ], + "1": [ + "versions.yml:md5,4aad47e2b62180da87cd22e49b2cb1d6" + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,53f9b007bd72115e8b72a40f859bc896" + ] + ], + "versions": [ + "versions.yml:md5,4aad47e2b62180da87cd22e49b2cb1d6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T15:02:30.977775" + } +} \ No newline at end of file diff --git a/modules/nf-core/subread/featurecounts/environment.yml b/modules/nf-core/subread/featurecounts/environment.yml new file mode 100644 index 0000000..1577525 --- /dev/null +++ b/modules/nf-core/subread/featurecounts/environment.yml @@ -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::subread=2.0.6 diff --git a/modules/nf-core/subread/featurecounts/main.nf b/modules/nf-core/subread/featurecounts/main.nf new file mode 100644 index 0000000..85cd18a --- /dev/null +++ b/modules/nf-core/subread/featurecounts/main.nf @@ -0,0 +1,60 @@ +process SUBREAD_FEATURECOUNTS { + 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/subread:2.0.6--he4a0461_2' + : 'biocontainers/subread:2.0.6--he4a0461_2'}" + + input: + tuple val(meta), path(bams), path(annotation) + + output: + tuple val(meta), path("*featureCounts.tsv"), emit: counts + tuple val(meta), path("*featureCounts.tsv.summary"), emit: summary + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def paired_end = meta.single_end ? '' : '-p' + + def strandedness = 0 + if (meta.strandedness == 'forward') { + strandedness = 1 + } + else if (meta.strandedness == 'reverse') { + strandedness = 2 + } + """ + featureCounts \\ + ${args} \\ + ${paired_end} \\ + -T ${task.cpus} \\ + -a ${annotation} \\ + -s ${strandedness} \\ + -o ${prefix}.featureCounts.tsv \\ + ${bams.join(' ')} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + subread: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.featureCounts.tsv + touch ${prefix}.featureCounts.tsv.summary + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + subread: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") + END_VERSIONS + """ +} diff --git a/modules/nf-core/subread/featurecounts/meta.yml b/modules/nf-core/subread/featurecounts/meta.yml new file mode 100644 index 0000000..83c322a --- /dev/null +++ b/modules/nf-core/subread/featurecounts/meta.yml @@ -0,0 +1,62 @@ +name: subread_featurecounts +description: Count reads that map to genomic features +keywords: + - counts + - fasta + - genome + - reference +tools: + - featurecounts: + description: featureCounts is a highly efficient general-purpose read summarization + program that counts mapped reads for genomic features such as genes, exons, + promoter, gene bodies, genomic bins and chromosomal locations. It can be used + to count both RNA-seq and genomic DNA-seq reads. + homepage: http://bioinf.wehi.edu.au/featureCounts/ + documentation: http://bioinf.wehi.edu.au/subread-package/SubreadUsersGuide.pdf + doi: "10.1093/bioinformatics/btt656" + licence: ["GPL v3"] + identifier: biotools:subread +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bams: + type: file + description: BAM files containing mapped reads + pattern: "*.bam" + - annotation: + type: file + description: Genomic features annotation in GTF or SAF + pattern: "*.{gtf,saf}" +output: + - counts: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*featureCounts.tsv": + type: file + description: Counts of reads mapping to features + pattern: "*featureCounts.tsv" + - summary: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*featureCounts.tsv.summary": + type: file + description: Summary log file + pattern: "*.featureCounts.tsv.summary" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@ntoda03" +maintainers: + - "@ntoda03" diff --git a/modules/nf-core/subread/featurecounts/tests/main.nf.test b/modules/nf-core/subread/featurecounts/tests/main.nf.test new file mode 100644 index 0000000..3b95da3 --- /dev/null +++ b/modules/nf-core/subread/featurecounts/tests/main.nf.test @@ -0,0 +1,155 @@ +nextflow_process { + + name "Test Process SUBREAD_FEATURECOUNTS" + script "../main.nf" + process "SUBREAD_FEATURECOUNTS" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "subread" + tag "subread/featurecounts" + + test("sarscov2 [bam] - forward") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'forward' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.counts).match("forward_counts") }, + { assert snapshot(process.out.summary).match("forward_summary") }, + { assert snapshot(process.out.versions).match("forward_versions") } + ) + } + } + + test("sarscov2 [bam] - forward - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'forward' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 [bam] - reverse") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'reverse' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.counts).match("reverse_counts") }, + { assert snapshot(process.out.summary).match("reverse_summary") }, + { assert snapshot(process.out.versions).match("reverse_versions") } + ) + } + } + + test("sarscov2 [bam] - reverse - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'reverse' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 [bam] - unstranded") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'unstranded' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.counts).match("unstranded_counts") }, + { assert snapshot(process.out.summary).match("unstranded_summary") }, + { assert snapshot(process.out.versions).match("unstranded_versions") } + ) + } + } + + test("sarscov2 [bam] - unstranded - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'unstranded' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap b/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap new file mode 100644 index 0000000..ff8b62a --- /dev/null +++ b/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap @@ -0,0 +1,323 @@ +{ + "forward_counts": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.tsv:md5,21ff44bfaa4a3d8e8b7e749078f7a201" + ] + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:28:20.989068" + }, + "unstranded_counts": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.tsv:md5,9474f78d2d1d43613cbc16c10ba15047" + ] + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:28:33.648742" + }, + "reverse_summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.tsv.summary:md5,7cfa30ad678b9bc1bc63afbb0281547b" + ] + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:28:27.457841" + }, + "sarscov2 [bam] - forward - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.tsv.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.tsv.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:29:21.075114" + }, + "sarscov2 [bam] - reverse - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.tsv.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.tsv.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:29:27.146094" + }, + "reverse_counts": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.tsv:md5,7df6092fdc65ce40b71c64e0c97f95c6" + ] + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:28:27.448485" + }, + "sarscov2 [bam] - unstranded - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.tsv.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.tsv.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:29:33.287109" + }, + "forward_summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.tsv.summary:md5,8f602ff9a8ef467af43294e80b367cdf" + ] + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:28:21.006184" + }, + "forward_versions": { + "content": [ + [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-18T10:19:48.001158764" + }, + "unstranded_summary": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.tsv.summary:md5,23164b79f9f23f11c82820db61a35560" + ] + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.1" + }, + "timestamp": "2024-12-01T11:28:33.657543" + }, + "reverse_versions": { + "content": [ + [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-18T10:20:24.551053149" + }, + "unstranded_versions": { + "content": [ + [ + "versions.yml:md5,956ebb9da6a1747fc47d393fb5931fc2" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-18T10:21:03.25895568" + } +} \ No newline at end of file diff --git a/modules/nf-core/subread/featurecounts/tests/nextflow.config b/modules/nf-core/subread/featurecounts/tests/nextflow.config new file mode 100644 index 0000000..d9fd4fd --- /dev/null +++ b/modules/nf-core/subread/featurecounts/tests/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: SUBREAD_FEATURECOUNTS { + ext.args = '-t CDS' + } + +} diff --git a/nextflow_schema.json b/nextflow_schema.json index e2c710d..99d4fc3 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -79,8 +79,23 @@ "fa_icon": "fas fa-ban", "hidden": true, "default": "s3://ngi-igenomes/igenomes/" + }, + "counting_options": { + "title": "Counting options", + "type": "object", + "description": "Options for read counting", + "default": "", + "properties": { + "counts": { + "type": "string", + "default": "featurecounts", + "description": "Counting method to use", + "enum": ["featurecounts", "htseq"], + "help_text": "Choose between 'featurecounts' (default) or 'htseq' for read counting." } } + } + } }, "institutional_config_options": { "title": "Institutional config options", diff --git a/workflows/lncpipe.nf b/workflows/lncpipe.nf index 8ed38a4..3d4af22 100644 --- a/workflows/lncpipe.nf +++ b/workflows/lncpipe.nf @@ -20,6 +20,8 @@ include { FASTQ_ALIGN_HISAT2 } from '../subworkflows/nf-core/ include { BAM_DEDUP_UMI as BAM_DEDUP_UMI_STAR } from '../subworkflows/nf-core/bam_dedup_umi' // I would like to not import these as 2 and just have 1 workflow able to work with both star and hisat2 data. include { BAM_DEDUP_UMI as BAM_DEDUP_UMI_HISAT2 } from '../subworkflows/nf-core/bam_dedup_umi' include { STRINGTIE_WORKFLOW } from '../subworkflows/local/stringtie' +include { SUBREAD_FEATURECOUNTS } from '../../modules/nf-core/subread/featurecounts/main' +include { HTSEQ_COUNT } from '../modules/nf-core/htseq/count/main' /* @@ -348,8 +350,29 @@ workflow LNCPIPE { // ) /* -* Step 11: Quantification step (Kallisto/Htseq) +* Step 11: Quantification step (Featurecounts/Htseq) */ + + if (params.counts == 'featurecounts') { + ch_feature_counts = ch_genome_bam.combine(ch_gtf) + + SUBREAD_FEATURECOUNTS( + ch_feature_counts + ) + ch_versions = ch_versions.mix(SUBREAD_FEATURECOUNTS.out.versions) + ch_counts = SUBREAD_FEATURECOUNTS.out.counts + } + + if (params.counts == 'htseq') { + ch_genome_bam_index = ch_genome_bam.combine(ch_genome_bam_index) + ch_htseq_counts = ch_genome_bam.combine(ch_genome_bam_index).combine(ch_gtf) + HTSEQ_COUNT( + ch_htseq_counts + ) + ch_versions = ch_versions.mix(HTSEQ_COUNT.out.versions) + ch_counts = HTSEQ_COUNT.out.txt + } + /* * Step 12: Generate count matrix for differential expression analysis */ From 69eee7862cdbc3fbcf2f7a6a1eaf5634b1dd2756 Mon Sep 17 00:00:00 2001 From: karlaarz Date: Wed, 2 Apr 2025 16:16:18 +0200 Subject: [PATCH 2/5] Modified some broken pipes --- nextflow_schema.json | 29 ++++++++++++++--------------- workflows/lncpipe.nf | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 99d4fc3..193b09e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -79,22 +79,21 @@ "fa_icon": "fas fa-ban", "hidden": true, "default": "s3://ngi-igenomes/igenomes/" - }, - "counting_options": { - "title": "Counting options", - "type": "object", - "description": "Options for read counting", - "default": "", - "properties": { - "counts": { - "type": "string", - "default": "featurecounts", - "description": "Counting method to use", - "enum": ["featurecounts", "htseq"], - "help_text": "Choose between 'featurecounts' (default) or 'htseq' for read counting." } - } - } + } + }, + "counting_options": { + "title": "Counting options", + "type": "object", + "description": "Options for read counting", + "properties": { + "counts": { + "type": "string", + "default": "featurecounts", + "description": "Counting method to use", + "enum": ["featurecounts", "htseq"], + "help_text": "Choose between 'featurecounts' (default) or 'htseq' for read counting." + } } }, "institutional_config_options": { diff --git a/workflows/lncpipe.nf b/workflows/lncpipe.nf index 3d4af22..2bd6498 100644 --- a/workflows/lncpipe.nf +++ b/workflows/lncpipe.nf @@ -20,7 +20,7 @@ include { FASTQ_ALIGN_HISAT2 } from '../subworkflows/nf-core/ include { BAM_DEDUP_UMI as BAM_DEDUP_UMI_STAR } from '../subworkflows/nf-core/bam_dedup_umi' // I would like to not import these as 2 and just have 1 workflow able to work with both star and hisat2 data. include { BAM_DEDUP_UMI as BAM_DEDUP_UMI_HISAT2 } from '../subworkflows/nf-core/bam_dedup_umi' include { STRINGTIE_WORKFLOW } from '../subworkflows/local/stringtie' -include { SUBREAD_FEATURECOUNTS } from '../../modules/nf-core/subread/featurecounts/main' +include { SUBREAD_FEATURECOUNTS } from '../modules/nf-core/subread/featurecounts/main' include { HTSEQ_COUNT } from '../modules/nf-core/htseq/count/main' From 65ede746cc6723a1509373d36f87f7727df0a06d Mon Sep 17 00:00:00 2001 From: karlaarz Date: Wed, 2 Apr 2025 16:42:59 +0200 Subject: [PATCH 3/5] Added counts params --- nextflow.config | 3 +++ nextflow_schema.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nextflow.config b/nextflow.config index d3da8b2..23637b5 100644 --- a/nextflow.config +++ b/nextflow.config @@ -78,6 +78,9 @@ params { umi_discard_read = null save_umi_intermeds = false + // Quantification options + counts = 'featurecounts' + // Linting skip_linting = false extra_fqlint_args = '--disable-validator P001' diff --git a/nextflow_schema.json b/nextflow_schema.json index 193b09e..40d4022 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -249,6 +249,9 @@ { "$ref": "#/$defs/reference_genome_options" }, + { + "$ref": "#/$defs/counting_options" + }, { "$ref": "#/$defs/institutional_config_options" }, From d71ebb4fe14eafcb7ce1fe1e24972b734b9a32d9 Mon Sep 17 00:00:00 2001 From: karlaarz Date: Wed, 2 Apr 2025 17:39:55 +0200 Subject: [PATCH 4/5] Fix indentation issues --- workflows/lncpipe.nf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/workflows/lncpipe.nf b/workflows/lncpipe.nf index 2bd6498..25c5634 100644 --- a/workflows/lncpipe.nf +++ b/workflows/lncpipe.nf @@ -21,7 +21,7 @@ include { BAM_DEDUP_UMI as BAM_DEDUP_UMI_STAR } from '../subworkflows/nf-core/ include { BAM_DEDUP_UMI as BAM_DEDUP_UMI_HISAT2 } from '../subworkflows/nf-core/bam_dedup_umi' include { STRINGTIE_WORKFLOW } from '../subworkflows/local/stringtie' include { SUBREAD_FEATURECOUNTS } from '../modules/nf-core/subread/featurecounts/main' -include { HTSEQ_COUNT } from '../modules/nf-core/htseq/count/main' +include { HTSEQ_COUNT } from '../modules/nf-core/htseq/count/main' /* @@ -353,9 +353,8 @@ workflow LNCPIPE { * Step 11: Quantification step (Featurecounts/Htseq) */ - if (params.counts == 'featurecounts') { - ch_feature_counts = ch_genome_bam.combine(ch_gtf) - + if (params.counts == 'featurecounts') { + ch_feature_counts = ch_genome_bam.combine(ch_gtf) SUBREAD_FEATURECOUNTS( ch_feature_counts ) From 64b0f99ca25fcec418a8a57dfcb75caf3fa4731b Mon Sep 17 00:00:00 2001 From: karlaarz Date: Wed, 2 Apr 2025 17:48:02 +0200 Subject: [PATCH 5/5] chore: format JSON file with Prettier --- nextflow_schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 40d4022..a729628 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -80,7 +80,7 @@ "hidden": true, "default": "s3://ngi-igenomes/igenomes/" } - } + } }, "counting_options": { "title": "Counting options",