From f61ad7506ad7b3c84daefc052077e1bf5aeac194 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Wed, 5 Aug 2020 17:16:56 +0100 Subject: [PATCH] Add homer --- software/homer/annotatepeaks/functions.nf | 1 + software/homer/annotatepeaks/main.nf | 43 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 120000 software/homer/annotatepeaks/functions.nf create mode 100644 software/homer/annotatepeaks/main.nf diff --git a/software/homer/annotatepeaks/functions.nf b/software/homer/annotatepeaks/functions.nf new file mode 120000 index 00000000..5e1a8e03 --- /dev/null +++ b/software/homer/annotatepeaks/functions.nf @@ -0,0 +1 @@ +../../lib/functions.nf \ No newline at end of file diff --git a/software/homer/annotatepeaks/main.nf b/software/homer/annotatepeaks/main.nf new file mode 100644 index 00000000..496f5cc4 --- /dev/null +++ b/software/homer/annotatepeaks/main.nf @@ -0,0 +1,43 @@ +// Import generic module functions +include { initOptions; saveFiles; getSoftwareName } from './functions' + +def VERSION = '4.11' + +process HOMER_ANNOTATEPEAKS { + tag "$meta.id" + label 'process_medium' + publishDir "${params.outdir}", + mode: params.publish_dir_mode, + saveAs: { filename -> saveFiles(filename:filename, options:options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) } + + container "quay.io/biocontainers/homer:4.11--pl526h9a982cc_2" + //container "https://depot.galaxyproject.org/singularity/homer:4.11--pl526h9a982cc_2" + + conda (params.conda ? "bioconda::homer=4.11" : null) + + input: + tuple val(meta), path(peak) + path fasta + path gtf + val options + + output: + tuple val(meta), path("*annotatePeaks.txt"), emit: txt + path "*.version.txt", emit: version + + script: + def software = getSoftwareName(task.process) + def ioptions = initOptions(options) + def prefix = ioptions.suffix ? "${meta.id}${ioptions.suffix}" : "${meta.id}" + """ + annotatePeaks.pl \\ + $peak \\ + $fasta \\ + $ioptions.args \\ + -gtf $gtf \\ + -cpu $task.cpus \\ + > ${prefix}.annotatePeaks.txt + + echo $VERSION > ${software}.version.txt + """ +}