diff --git a/src/nf_modules/macs2/main.nf b/src/nf_modules/macs2/main.nf new file mode 100644 index 0000000000000000000000000000000000000000..9748cdc643b31e8207e579ff8e84353b3724aaba --- /dev/null +++ b/src/nf_modules/macs2/main.nf @@ -0,0 +1,35 @@ +version = "2.1.2" +container_url = "lbmc/macs2:${version}" + +process peak_calling { + container = "${container_url}" + label "big_mem_multi_cpus" + tag "${file_id}" + publishDir "results/peak_calling/${file_id}", mode: 'copy' + + input: + tuple val(file_id), path(bam_ip), path(bam_control) + + output: + path "*", emit: peak + path "*_report.txt", emit: report + + script: +/* remove --nomodel option for real dataset */ +""" +macs2 callpeak \ + --treatment ${file_ip} \ + --call-summits "True"\ + --control ${file_control} \ + --keep-dup "auto" \ + --name ${file_id} \ + --gsize ${params.genome_size} 2> \ + ${file_ip}_macs2_report.txt + +if grep -q "ERROR" ${file_ip}_macs2_report.txt; then + echo "MACS2 error" + exit 1 +fi +""" +} +