Skip to content
Snippets Groups Projects
Unverified Commit 72ffaf95 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

macs2: add nf module file

parent 6213625d
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
withName: peak_calling {
container = "macs2:2.1.2"
cpus = 4
}
}
}
singularity {
singularity.enabled = true
process {
withName: peak_calling {
container = "file://bin/macs2:2.1.2.sif"
cpus = 4
}
}
}
psmn {
process{
withName: peak_calling {
beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
module = "macs2/2.1.2"
executor = "sge"
clusterOptions = "-m e -cwd -V"
cpus = 16
memory = "30GB"
time = "24h"
queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
penv = 'openmp16'
}
}
}
}
params.genome_size = "hs"
params.control_tag = "control"
log.info "bam files : ${params.bam}"
log.info "genome size : ${params.genome_size}"
Channel
.fromPath( params.bam )
.ifEmpty { error "Cannot find any bam files matching: ${params.bam}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { bam_files }
/* split bam Channel into control and ip if "control" keyword is detected*/
bam_files_control = Channel.create()
bam_files_ip = Channel.create()
bam_files.choice(
bam_files_control,
bam_files_ip ) { a -> a[0] =~ /.*${params.control_tag}.*/ ? 0 : 1 }
process peak_calling {
tag "${file_id}"
publishDir "results/peak_calling/${file_id}", mode: 'copy'
input:
set file_id, file(file_ip) from bam_files_ip
set file_id_control, file(file_control) from bam_files_control.collect()
output:
file "*" into peak_output
file "*_report.txt" into peak_calling_report
script:
/* remove --nomodel option for real dataset */
"""
macs2 callpeak \
--nomodel \
--treatment ${file_ip} \
--control ${file_control} \
--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
"""
}
cp data/tiny_dataset/map/tiny_v2.bam data/tiny_dataset/map/tiny_v2_control.bam
./nextflow src/nf_modules/macs2/peak_calling.nf \
-c src/nf_modules/macs2/peak_calling.config \
-profile docker \
-resume \
--bam "data/tiny_dataset/map/tiny_v2*.bam" \
--genome_size 129984 \
--control_tag "control"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment