diff --git a/modules.json b/modules.json index 879d22a8..9cff4eec 100644 --- a/modules.json +++ b/modules.json @@ -16,6 +16,21 @@ "git_sha": "e10b76ca0c66213581bec2833e30d31f239dec0b", "installed_by": ["modules"] }, + "opt/flip": { + "branch": "master", + "git_sha": "66d5baa4e9b6ac3ab95e84f88709b8e3ebf4b62b", + "installed_by": ["modules"] + }, + "opt/stat": { + "branch": "master", + "git_sha": "66d5baa4e9b6ac3ab95e84f88709b8e3ebf4b62b", + "installed_by": ["modules"] + }, + "opt/track": { + "branch": "master", + "git_sha": "66d5baa4e9b6ac3ab95e84f88709b8e3ebf4b62b", + "installed_by": ["modules"] + }, "untar": { "branch": "master", "git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46", diff --git a/modules/nf-core/opt/flip/main.nf b/modules/nf-core/opt/flip/main.nf new file mode 100644 index 00000000..fa98c4f0 --- /dev/null +++ b/modules/nf-core/opt/flip/main.nf @@ -0,0 +1,55 @@ +process OPT_FLIP { + tag "$meta.id" + label 'process_high' + + container "khersameesh24/opt:v0.0.1" + + input: + tuple val(meta), path(probes_fasta) + tuple val(meta2), path(ref_annot_gff), path(ref_annot_fa) + + output: + tuple val(meta), path("${meta.id}/fwd_oriented.fa"), emit: fwd_oriented_fa + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "OPT_FLIP module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + opt \\ + -o ${prefix} \\ + -p ${task.cpus} \\ + flip \\ + -q ${probes_fasta} \\ + -a ${ref_annot_gff} \\ + -t ${ref_annot_fa} \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + opt: \$(opt --version) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix} + touch "${prefix}/fwd_oriented.fa" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + opt: \$(opt --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/opt/flip/meta.yml b/modules/nf-core/opt/flip/meta.yml new file mode 100644 index 00000000..f0e4c57c --- /dev/null +++ b/modules/nf-core/opt/flip/meta.yml @@ -0,0 +1,68 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "opt_flip" +description: "flip corrects probes that are aligning to the opposite strand of their intended target genes by reverse complementing them" +keywords: + - opt + - opt flip + - transcripts + - off-target probes + - align probes +tools: + - "opt": + description: "opt is a simple program that aligns probe sequences to transcript sequences to detect potential off-target probe activity" + homepage: "https://github.com/JEFworks-Lab/off-target-probe-tracker" + documentation: "https://github.com/JEFworks-Lab/off-target-probe-tracker/blob/main/README.md" + tool_dev_url: "https://github.com/JEFworks-Lab/off-target-probe-tracker" + licence: [GPL-3.0 license] + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information of the probe panel sequences used for the xenium experiment + e.g. `[ id:'breast_cancer_probe_panel_sequences' ]` + - probes_fasta: + type: file + description: Fasta file for the probe sequences used in the xenium experiment + pattern: "*.fasta" + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing the information of the genomic features and fasta files used as references + e.g. `[ id:'gencode_references' ]` + - ref_annot_gff: + type: file + description: Reference annotations in gff format + pattern: "*.gff" + ontologies: [] + - ref_annot_fa: + type: file + description: Reference annotations in fasta format + pattern: "*.fa" + ontologies: [] + +output: + fwd_oriented_fa: + - - meta: + type: map + description: | + Groovy Map containing information of the forward oriented fasta generated with the probes panel sequences 'opt flip' + e.g. `[ id:'breast_cancer_probe_panel_sequences' ]` + - "${meta.id}/fwd_oriented.fa": + type: file + description: The forward oriented fasta file + pattern: "*.fa" + ontologies: [] + versions: + - "versions.yml": + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_3750" # YAML + +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/modules/nf-core/opt/flip/tests/main.nf.test b/modules/nf-core/opt/flip/tests/main.nf.test new file mode 100644 index 00000000..77fd9ef4 --- /dev/null +++ b/modules/nf-core/opt/flip/tests/main.nf.test @@ -0,0 +1,61 @@ +nextflow_process { + + name "Test Process OPT_FLIP" + script "../main.nf" + process "OPT_FLIP" + + tag "modules" + tag "modules_nfcore" + tag "opt" + tag "opt/flip" + + test("testrun panel probe sequences") { + + when { + process { + """ + input[0] = [ + [ id:'test_run' ], + file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/panel_probe_sequences.fasta', checkIfExists: true) + ] + input[1] = [ + [ id:'test_run' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("testrun panel probe sequences -stub") { + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test_run' ], + file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/panel_probe_sequences.fasta', checkIfExists: true) + ] + input[1] = [ + [ id:'test_run' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/opt/flip/tests/main.nf.test.snap b/modules/nf-core/opt/flip/tests/main.nf.test.snap new file mode 100644 index 00000000..4bc5b35e --- /dev/null +++ b/modules/nf-core/opt/flip/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "testrun panel probe sequences -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "fwd_oriented.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,57dbc672cf0bf40854c18d241f2d7d2e" + ], + "fwd_oriented_fa": [ + [ + { + "id": "test_run" + }, + "fwd_oriented.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,57dbc672cf0bf40854c18d241f2d7d2e" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-09-14T12:43:08.105988801" + }, + "testrun panel probe sequences": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "fwd_oriented.fa:md5,535289c04851ad94e091ec7c14ff6bcd" + ] + ], + "1": [ + "versions.yml:md5,57dbc672cf0bf40854c18d241f2d7d2e" + ], + "fwd_oriented_fa": [ + [ + { + "id": "test_run" + }, + "fwd_oriented.fa:md5,535289c04851ad94e091ec7c14ff6bcd" + ] + ], + "versions": [ + "versions.yml:md5,57dbc672cf0bf40854c18d241f2d7d2e" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-09-14T12:47:41.966183182" + } +} \ No newline at end of file diff --git a/modules/nf-core/opt/stat/main.nf b/modules/nf-core/opt/stat/main.nf new file mode 100644 index 00000000..b4e2875e --- /dev/null +++ b/modules/nf-core/opt/stat/main.nf @@ -0,0 +1,56 @@ +process OPT_STAT { + tag "$meta.id" + label 'process_high' + + container "khersameesh24/opt:v0.0.1" + + input: + tuple val(meta), path(probe_targets) + tuple val(meta2), path(fwd_oriented_probes) + path(gene_synonyms) + + output: + tuple val(meta), path("${meta.id}/collapsed_summary.tsv"), emit: summary + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "OPT_STAT module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def synonyms = gene_synonyms ? "-s ${gene_synonyms}": "" + + """ + opt \\ + -o ${prefix} \\ + stat \\ + -i ${probe_targets} \\ + -q ${fwd_oriented_probes} \\ + ${synonyms} \\ + ${args} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + opt: \$(opt --version) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix} + touch "${prefix}/collapsed_summary.tsv" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + opt: \$(opt --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/opt/stat/meta.yml b/modules/nf-core/opt/stat/meta.yml new file mode 100644 index 00000000..ae2d712b --- /dev/null +++ b/modules/nf-core/opt/stat/meta.yml @@ -0,0 +1,72 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "opt_stat" +description: "stat summarizes opt binding predictions" +keywords: + - opt + - opt stat + - transcripts + - binding predictions + - off-target probes + - align probes + - summary stats +tools: + - "opt": + description: "opt is a simple program that aligns probe sequences to transcript + sequences to detect potential off-target probe activity" + homepage: "https://github.com/JEFworks-Lab/off-target-probe-tracker" + documentation: "https://github.com/JEFworks-Lab/off-target-probe-tracker/blob/main/README.md" + tool_dev_url: "https://github.com/JEFworks-Lab/off-target-probe-tracker" + licence: [GPL-3.0 license] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing information of the probe targets generated from the panel sequences with `opt track` + e.g. `[ id:'breast_cancer_probe_panel_sequences' ]` + - probe_targets: + type: file + description: Generated probe targets + pattern: "*.tsv" + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing information of the forward oriented fasta generated with the probes panel sequences 'opt flip' + e.g. `[ id:'breast_cancer_probe_panel_sequences' ]` + - fwd_oriented_probes: + type: file + description: The forward oriented fasta file + pattern: "*.fa" + ontologies: [] + - gene_synonyms: + type: file + description: Gene synonyms that may have been counted as off-targets but + simply differ in name (optional input) + pattern: "*.csv" + ontologies: [] +output: + summary: + - - meta: + type: map + description: | + Groovy Map containing summary of the forward oriented probes generated with the panel sequences 'opt flip and track' + e.g. `[ id:'breast_cancer_probe_panel_sequences' ]` + - "${meta.id}/collapsed_summary.tsv": + type: file + description: tsv file containing the summary stats + pattern: "*.tsv" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_3750" # YAML + +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/modules/nf-core/opt/stat/tests/main.nf.test b/modules/nf-core/opt/stat/tests/main.nf.test new file mode 100644 index 00000000..5204a81f --- /dev/null +++ b/modules/nf-core/opt/stat/tests/main.nf.test @@ -0,0 +1,63 @@ +nextflow_process { + + name "Test Process OPT_STAT" + script "../main.nf" + process "OPT_STAT" + + tag "modules" + tag "modules_nfcore" + tag "opt" + tag "opt/stat" + + test("testrun panel probe sequences") { + + when { + process { + """ + input[0] = [ + [ id:'test_run' ], + file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/probe2targets.tsv', checkIfExists: true) + ] + input[1] = [ + [ id:'test_run' ], + file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/fwd_oriented.fa', checkIfExists: true) + ] + input[2] = [] + // input[2] = [file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/gene_synonyms.csv', checkIfExists: true)] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("testrun panel probe sequences -stub") { + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test_run' ], + file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/probe2targets.tsv', checkIfExists: true) + ] + input[1] = [ + [ id:'test_run' ], + file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/fwd_oriented.fa', checkIfExists: true) + ] + input[2] = [] + // input[2] = [file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/gene_synonyms.csv', checkIfExists: true)] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/opt/stat/tests/main.nf.test.snap b/modules/nf-core/opt/stat/tests/main.nf.test.snap new file mode 100644 index 00000000..b14671fe --- /dev/null +++ b/modules/nf-core/opt/stat/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "testrun panel probe sequences -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "collapsed_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,a23b08ea3b2da18863a5611dd0adbaa1" + ], + "summary": [ + [ + { + "id": "test_run" + }, + "collapsed_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,a23b08ea3b2da18863a5611dd0adbaa1" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-09-14T12:23:32.959930982" + }, + "testrun panel probe sequences": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "collapsed_summary.tsv:md5,b2884d9c8c89124d3cbbbc1223d81c99" + ] + ], + "1": [ + "versions.yml:md5,a23b08ea3b2da18863a5611dd0adbaa1" + ], + "summary": [ + [ + { + "id": "test_run" + }, + "collapsed_summary.tsv:md5,b2884d9c8c89124d3cbbbc1223d81c99" + ] + ], + "versions": [ + "versions.yml:md5,a23b08ea3b2da18863a5611dd0adbaa1" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-09-14T12:58:57.17786325" + } +} \ No newline at end of file diff --git a/modules/nf-core/opt/track/main.nf b/modules/nf-core/opt/track/main.nf new file mode 100644 index 00000000..fc99a3e5 --- /dev/null +++ b/modules/nf-core/opt/track/main.nf @@ -0,0 +1,56 @@ +process OPT_TRACK { + tag "$meta.id" + label 'process_high' + + container "khersameesh24/opt:v0.0.1" + + input: + tuple val(meta), path(fwd_oriented_fa) + tuple val(meta2), path(ref_annot_gff), path(ref_annot_fa) + + output: + tuple val(meta), path("${meta.id}/probe2targets.tsv"), emit: probes2target + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "OPT_TRACK module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + opt \\ + -o ${prefix} \\ + -p ${task.cpus} \\ + track \\ + -q ${fwd_oriented_fa} \\ + -a ${ref_annot_gff} \\ + -t ${ref_annot_fa} \\ + ${args} + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + opt: \$(opt --version) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix} + touch "${prefix}/probe2targets.tsv" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + opt: \$(opt --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/opt/track/meta.yml b/modules/nf-core/opt/track/meta.yml new file mode 100644 index 00000000..6024d773 --- /dev/null +++ b/modules/nf-core/opt/track/meta.yml @@ -0,0 +1,69 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "opt_track" +description: "track aligns query probe sequences to any target transcriptome" +keywords: + - opt + - opt track + - transcripts + - off-target probes + - align probes + - traget transcriptome +tools: + - "opt": + description: "opt is a simple program that aligns probe sequences to transcript sequences to detect potential off-target probe activity" + homepage: "https://github.com/JEFworks-Lab/off-target-probe-tracker" + documentation: "https://github.com/JEFworks-Lab/off-target-probe-tracker/blob/main/README.md" + tool_dev_url: "https://github.com/JEFworks-Lab/off-target-probe-tracker" + licence: [GPL-3.0 license] + +input: + - - meta: + type: map + description: | + Groovy Map containing information of the forward oriented fasta generated with the probes panel sequences generated with `opt flip` + e.g. `[ id:'breast_cancer_probe_panel_sequences' ]` + - fwd_oriented_fa: + type: file + description: Forward oriented fasta file generated by the opt flip command + pattern: "*.fa" + ontologies: [] + - - meta2: + type: map + description: | + Groovy Map containing the information of the genomic features and fasta files used as references + e.g. `[ id:'gencode_references' ]` + - ref_annot_gff: + type: file + description: Reference annotation in gff format + pattern: "*.gff" + ontologies: [] + - ref_annot_fa: + type: file + description: Reference annotation in fasta format + pattern: "*.fa" + ontologies: [] + +output: + probes2target: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "${meta.id}/probe2targets.tsv": + type: file + description: TSV file containing the gene and transcript information to which each probe aligns + pattern: "*.tsv" + ontologies: [] + versions: + - "versions.yml": + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: "http://edamontology.org/format_3750" # YAML + +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/modules/nf-core/opt/track/tests/main.nf.test b/modules/nf-core/opt/track/tests/main.nf.test new file mode 100644 index 00000000..4fbf9a19 --- /dev/null +++ b/modules/nf-core/opt/track/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process OPT_TRACK" + script "../main.nf" + process "OPT_TRACK" + + tag "modules" + tag "modules_nfcore" + tag "opt" + tag "opt/track" + + test("testrun panel probe sequences") { + + when { + process { + """ + input[0] = [ + [ id:'test_run' ], file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/fwd_oriented.fa', checkIfExists: true) + ] + input[1] = [ + [ id:'test_run' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("testrun panel probe sequences -stub") { + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test_run' ], file('https://raw.githubusercontent.com/khersameesh24/test-datasets/opt/testdata/fwd_oriented.fa', checkIfExists: true) + ] + + input[1] = [ + [ id:'test_run' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gtf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/opt/track/tests/main.nf.test.snap b/modules/nf-core/opt/track/tests/main.nf.test.snap new file mode 100644 index 00000000..3dda7a91 --- /dev/null +++ b/modules/nf-core/opt/track/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "testrun panel probe sequences -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "probe2targets.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,daf660f286a817fa0eed7703a5f65706" + ], + "probes2target": [ + [ + { + "id": "test_run" + }, + "probe2targets.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,daf660f286a817fa0eed7703a5f65706" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-09-14T12:20:29.220245783" + }, + "testrun panel probe sequences": { + "content": [ + { + "0": [ + [ + { + "id": "test_run" + }, + "probe2targets.tsv:md5,e15465df3845d7a6acf64dd3be04391b" + ] + ], + "1": [ + "versions.yml:md5,daf660f286a817fa0eed7703a5f65706" + ], + "probes2target": [ + [ + { + "id": "test_run" + }, + "probe2targets.tsv:md5,e15465df3845d7a6acf64dd3be04391b" + ] + ], + "versions": [ + "versions.yml:md5,daf660f286a817fa0eed7703a5f65706" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-09-14T12:20:19.999359259" + } +} \ No newline at end of file diff --git a/subworkflows/local/opt_flip_track_stat/main.nf b/subworkflows/local/opt_flip_track_stat/main.nf new file mode 100644 index 00000000..66272ef9 --- /dev/null +++ b/subworkflows/local/opt_flip_track_stat/main.nf @@ -0,0 +1,38 @@ +include { OPT_FLIP } from '../../../modules/nf-core/opt/flip/main' +include { OPT_TRACK } from '../../../modules/nf-core/opt/track/main' +include { OPT_STAT } from '../../../modules/nf-core/opt/stat/main' + + +workflow OPT_FLIP_TRACK_STAT { + + take: + + ch_probe_fasta // channel: [ val(meta), [ "panel_probes_sequences.fasta" ] ] + ch_references // channel: [ val(meta), ["reference_annotations.gff"], ["reference_annotations.fa"] ] + ch_gene_synonyms // channel: [ "path-to-gene-synonyms" ] + + main: + + ch_versions = Channel.empty() + ch_summary = Channel.empty() + + // correct probes that are aligning to opposite strand with `flip` + OPT_FLIP ( ch_probe_fasta, ch_references ) + ch_versions = ch_versions.mix( OPT_FLIP.out.versions ) + + // align query probe sequences to target transcriptome + OPT_TRACK ( OPT_FLIP.out.fwd_oriented_fa, ch_references ) + ch_versions = ch_versions.mix( OPT_TRACK.out.versions ) + + // summarizes opt binding predictions + OPT_STAT ( OPT_TRACK.out.probes2target, OPT_FLIP.out.fwd_oriented_fa, ch_gene_synonyms ) + ch_versions = ch_versions.mix( OPT_STAT.out.versions ) + + ch_summary = OPT_STAT.out.summary + + emit: + + summary = ch_summary // channel: [ val(meta), ["collapsed_summary.tsv", "other-summary-files"]] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/local/opt_flip_track_stat/meta.yml b/subworkflows/local/opt_flip_track_stat/meta.yml new file mode 100644 index 00000000..07ccc8b7 --- /dev/null +++ b/subworkflows/local/opt_flip_track_stat/meta.yml @@ -0,0 +1,51 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "opt_flip_track_stat" +description: opt is a simple program that aligns probe sequences to transcript sequences + to detect potential off-target probe activity +keywords: + - opt + - flip + - track + - stat + - off-target probes +components: + - opt/flip + - opt/track + - opt/stat +input: + - ch_probe_fasta: + type: file + description: | + Input channel containing the sample info. and associated probe panel sequences fasta file + Structure: [ val(meta), path("porbe_panel_seqeunces.fasta") ] + pattern: "*.fasta" + - ch_references: + type: file + description: | + Input channel containing the sample info. and the references to be used + Structure: [ val(meta), path("reference_annotations.gff"), path("reference_annotations.fa") ] + pattern: "*.{fa,gff}" + - ch_gene_synonyms: + type: file + description: | + Input channel containing the Gene synonyms that may have been counted as off-targets but + simply differ in name (optional input) + Structure: [ val(meta), path("gene_synonyms.csv") ] + pattern: "*.csv" +output: + - summary: + type: file + description: | + Groovy Map containing summary of the forward oriented probes generated with the panel sequences opt flip and track + Structure: [ val(meta), path("collapsed_summary.tsv") ] + pattern: "*.tsv" + - versions: + type: file + description: | + File containing software versions + Structure: [ path(versions.yml) ] + pattern: "versions.yml" +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24"