diff --git a/src/nf_modules/macs2/peak_calling.nf b/src/nf_modules/macs2/peak_calling.nf index 1bd6a95c16a04cc189cf3a75eaaebb580b384ba3..12398f2e92e48f8df7936efe62d4778c8112cdfd 100644 --- a/src/nf_modules/macs2/peak_calling.nf +++ b/src/nf_modules/macs2/peak_calling.nf @@ -2,6 +2,7 @@ params.genome_size = "hs" params.control_tag = "control" log.info "bam files : ${params.bam}" log.info "genome size : ${params.genome_size}" +log.info "control tag : ${params.control_tag}" Channel .fromPath( params.bam ) @@ -22,7 +23,11 @@ process peak_calling { input: set file_id, file(file_ip) from bam_files_ip - set file_id_control, file(file_control) from bam_files_control.collect() + set file_id_control, file(file_control) from bam_files_control + .ifEmpty { + error "Cannot find any bam files matching: ${params.control_tag}" + } + .collect() output: file "*" into peak_output diff --git a/src/nf_modules/macs2/tests.sh b/src/nf_modules/macs2/tests.sh index 1491b074e47f980e559008f394d1f44b5c92945b..fc73ce29a9e9aed5ee83ba0e171e49059185bc5c 100755 --- a/src/nf_modules/macs2/tests.sh +++ b/src/nf_modules/macs2/tests.sh @@ -6,3 +6,13 @@ cp data/tiny_dataset/map/tiny_v2.bam data/tiny_dataset/map/tiny_v2_control.bam --bam "data/tiny_dataset/map/tiny_v2*.bam" \ --genome_size 129984 \ --control_tag "control" + +if [ -x "$(command -v singularity)" ]; then + ./nextflow src/nf_modules/macs2/peak_calling.nf \ + -c src/nf_modules/macs2/peak_calling.config \ + -profile singularity \ + -resume \ + --bam "data/tiny_dataset/map/tiny_v2*.bam" \ + --genome_size 129984 \ + --control_tag "control" +fi