diff --git a/modules/homer/pos2bed/main.nf b/modules/homer/pos2bed/main.nf new file mode 100644 index 00000000..b85a30b5 --- /dev/null +++ b/modules/homer/pos2bed/main.nf @@ -0,0 +1,33 @@ +def VERSION = '4.11' // Version information not provided by tool on CLI + +process HOMER_POS2BED { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::homer=4.11" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/homer:4.11--pl526hc9558a2_3' : + 'quay.io/biocontainers/homer:4.11--pl526hc9558a2_3' }" + + input: + tuple val(meta), path(peaks) + + output: + tuple val(meta), path("*.bed"), emit: bed + 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}" + """ + pos2bed.pl $peaks > ${prefix}.bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + homer: $VERSION + END_VERSIONS + """ +} diff --git a/modules/homer/pos2bed/meta.yml b/modules/homer/pos2bed/meta.yml new file mode 100644 index 00000000..fb75bb1f --- /dev/null +++ b/modules/homer/pos2bed/meta.yml @@ -0,0 +1,42 @@ +name: "homer_pos2bed" +description: Coverting from HOMER peak to BED file formats +keywords: + - peaks +tools: + - "homer": + description: | + HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. + homepage: "http://homer.ucsd.edu/homer/index.html" + documentation: "http://homer.ucsd.edu/homer/" + tool_dev_url: "http://homer.ucsd.edu/homer/ngs/miscellaneous.html" + doi: 10.1016/j.molcel.2010.05.004. + licence: ["GPL-3.0-or-later"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tagDir: + type: directory + description: "The 'Tag Directory'" + pattern: "tagDir" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: BED file + pattern: "*.bed" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@Emiller88" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a211acbc..17a122b7 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -887,6 +887,12 @@ homer/makeucscfile: - modules/homer/makeucscfile/** - tests/modules/homer/makeucscfile/** +homer/pos2bed: + - modules/homer/pos2bed/** + - modules/homer/maketagdirectory/** + - modules/homer/findpeaks/** + - tests/modules/homer/pos2bed/** + hpsuissero: - modules/hpsuissero/** - tests/modules/hpsuissero/** diff --git a/tests/modules/homer/pos2bed/main.nf b/tests/modules/homer/pos2bed/main.nf new file mode 100644 index 00000000..bcfdc0bc --- /dev/null +++ b/tests/modules/homer/pos2bed/main.nf @@ -0,0 +1,19 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { HOMER_MAKETAGDIRECTORY } from '../../../../modules/homer/maketagdirectory/main.nf' +include { HOMER_FINDPEAKS } from '../../../../modules/homer/findpeaks/main.nf' +include { HOMER_POS2BED } from '../../../../modules/homer/pos2bed/main.nf' + +workflow test_homer_pos2bed { + input = [[id:'test'], + [file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test2_bed'], checkIfExists: true)]] + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + HOMER_MAKETAGDIRECTORY (input, fasta) + HOMER_FINDPEAKS ( HOMER_MAKETAGDIRECTORY.out.tagdir ) + + HOMER_POS2BED ( HOMER_FINDPEAKS.out.txt ) +} diff --git a/tests/modules/homer/pos2bed/nextflow.config b/tests/modules/homer/pos2bed/nextflow.config new file mode 100644 index 00000000..a4c88475 --- /dev/null +++ b/tests/modules/homer/pos2bed/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: HOMER_MAKETAGDIRECTORY { + ext.args = '-format bed' + } + +} diff --git a/tests/modules/homer/pos2bed/test.yml b/tests/modules/homer/pos2bed/test.yml new file mode 100644 index 00000000..525d61c8 --- /dev/null +++ b/tests/modules/homer/pos2bed/test.yml @@ -0,0 +1,10 @@ +- name: "homer pos2bed" + command: nextflow run ./tests/modules/homer/pos2bed -entry test_homer_pos2bed -c ./tests/config/nextflow.config -c ./tests/modules/homer/pos2bed/nextflow.config + tags: + - "homer" + - "homer/pos2bed" + files: + - path: "output/homer/test.bed" + md5sum: 0b9ebd8f06b9c820a551fbdb2d7635ee + - path: output/homer/versions.yml + md5sum: 1485f4b2d76484e8fe3310e2505de2fd