diff --git a/subworkflows/nf-core/homer/groseq/main.nf b/subworkflows/nf-core/homer/groseq/main.nf new file mode 100644 index 00000000..b83c7e21 --- /dev/null +++ b/subworkflows/nf-core/homer/groseq/main.nf @@ -0,0 +1,50 @@ +/* + * Identify transcripts with homer + */ + +include { HOMER_MAKETAGDIRECTORY } from '../../../../modules/homer/maketagdirectory/main' +include { HOMER_MAKEUCSCFILE } from '../../../../modules/homer/makeucscfile/main' +include { HOMER_FINDPEAKS } from '../../../../modules/homer/findpeaks/main' +include { HOMER_POS2BED } from '../../../../modules/homer/pos2bed/main' + +workflow HOMER_GROSEQ { + take: + bam // channel: [ val(meta), [ reads ] ] + fasta // file: /path/to/bwa/index/ + + main: + + ch_versions = Channel.empty() + + /* + * Create a Tag Directory From The GRO-Seq experiment + */ + HOMER_MAKETAGDIRECTORY ( bam, fasta ) + ch_versions = ch_versions.mix(HOMER_MAKETAGDIRECTORY.out.versions.first()) + + /* + * Creating UCSC Visualization Files + */ + HOMER_MAKEUCSCFILE ( HOMER_MAKETAGDIRECTORY.out.tagdir ) + ch_versions = ch_versions.mix(HOMER_MAKEUCSCFILE.out.versions.first()) + + /* + * Find transcripts directly from GRO-Seq + */ + HOMER_FINDPEAKS ( HOMER_MAKETAGDIRECTORY.out.tagdir ) + ch_versions = ch_versions.mix(HOMER_FINDPEAKS.out.versions.first()) + + /* + * Convert peak file to bed file + */ + HOMER_POS2BED ( HOMER_FINDPEAKS.out.txt ) + ch_versions = ch_versions.mix(HOMER_POS2BED.out.versions.first()) + + emit: + tagdir = HOMER_MAKETAGDIRECTORY.out.tagdir // channel: [ val(meta), [ tagdir ] ] + bed_graph = HOMER_MAKEUCSCFILE.out.bedGraph // channel: [ val(meta), [ tag_dir/*ucsc.bedGraph.gz ] ] + peaks = HOMER_FINDPEAKS.out.txt // channel: [ val(meta), [ *peaks.txt ] ] + bed = HOMER_POS2BED.out.bed // channel: [ val(meta), [ *peaks.txt ] ] + + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/homer/groseq/meta.yml b/subworkflows/nf-core/homer/groseq/meta.yml new file mode 100644 index 00000000..4bd36a88 --- /dev/null +++ b/subworkflows/nf-core/homer/groseq/meta.yml @@ -0,0 +1,48 @@ +name: homer_groseq +description: Perform variant calling on a set of normal samples using mutect2 panel of normals mode. Group them into a genomicsdbworkspace using genomicsdbimport, then use this to create a panel of normals using createsomaticpanelofnormals. +keywords: + - homer + - groseq + - nascent +modules: + - homer/maketagdirectory + - homer/makeucscfile + - homer/findpeaks + - homer/pos2bed +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - input: + type: list + description: list of BAM files, also able to take SAM and BED as input + pattern: "[ *.{bam/sam/bed} ]" + - fasta: + type: file + description: The reference fasta file + pattern: "*.fasta" +output: + - tagdir: + type: directory + description: The "Tag Directory" + pattern: "*_tagdir" + - bedGraph: + type: file + description: The UCSC bed graph + pattern: "*.bedGraph.gz" + - peaks: + type: file + description: The found peaks + pattern: "*.peaks.txt" + - bed: + type: file + description: A BED file of the found peaks + pattern: "*.bed" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@Emiller88" diff --git a/tests/subworkflows/nf-core/homer/groseq/main.nf b/tests/subworkflows/nf-core/homer/groseq/main.nf new file mode 100644 index 00000000..72b95e87 --- /dev/null +++ b/tests/subworkflows/nf-core/homer/groseq/main.nf @@ -0,0 +1,24 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HOMER_GROSEQ as HOMER_GROSEQ_BAM + HOMER_GROSEQ as HOMER_GROSEQ_BED } from '../../../../../subworkflows/nf-core/homer/groseq/main' + +workflow test_homer_groseq_bam { + def input = [] + input = [[ id: 'test' ], + [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true)]] + def fasta = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + HOMER_GROSEQ_BAM ( input, fasta ) +} + +workflow test_homer_groseq_bed { + def input = [] + input = [[ id: 'test' ], + [ file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)]] + def fasta = [ file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + + HOMER_GROSEQ_BED ( input, fasta ) +} diff --git a/tests/subworkflows/nf-core/homer/groseq/nextflow.config b/tests/subworkflows/nf-core/homer/groseq/nextflow.config new file mode 100644 index 00000000..09a44497 --- /dev/null +++ b/tests/subworkflows/nf-core/homer/groseq/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: '.*:HOMER_GROSEQ_BED:HOMER_MAKETAGDIRECTORY' { + ext.args = "-checkGC -format bed" + } + +} diff --git a/tests/subworkflows/nf-core/homer/groseq/test.yml b/tests/subworkflows/nf-core/homer/groseq/test.yml new file mode 100644 index 00000000..1eaeb3f5 --- /dev/null +++ b/tests/subworkflows/nf-core/homer/groseq/test.yml @@ -0,0 +1,27 @@ +- name: subworkflow homer_groseq bam + command: nextflow run ./tests/subworkflows/nf-core/homer/groseq/ -entry test_homer_groseq_bam -c tests/config/nextflow.config -c tests/subworkflows/nf-core/homer/groseq/nextflow.config + tags: + - homer + files: + - path: output/homer/test.bed + md5sum: 8d40034dfe22c5cf973071aa1e8d3617 + - path: output/homer/test.bedGraph.gz + md5sum: de2b2f8ab90a909b8bfbe755bdaba407 + - path: output/homer/test.peaks.txt + md5sum: 8d40034dfe22c5cf973071aa1e8d3617 + - path: output/homer/versions.yml + md5sum: c85dee03f1afabe406a87743a4c5506d + +- name: subworkflow homer_groseq bed + command: nextflow run ./tests/subworkflows/nf-core/homer/groseq/ -entry test_homer_groseq_bed -c tests/config/nextflow.config -c tests/subworkflows/nf-core/homer/groseq/nextflow.config + tags: + - homer + files: + - path: output/homer/test.bed + md5sum: 25e8b64946012d1c4567a04062e90fae + - path: output/homer/test.bedGraph.gz + md5sum: 2d2d1c2d3242ff74c7a922695accb9d2 + - path: output/homer/test.peaks.txt + md5sum: 25e8b64946012d1c4567a04062e90fae + - path: output/homer/versions.yml + md5sum: c9b5f1248d28c216b000cba8da738455