diff --git a/software/bedtools/intersect/main.nf b/software/bedtools/intersect/main.nf index 70bc6e86..a636c6ea 100644 --- a/software/bedtools/intersect/main.nf +++ b/software/bedtools/intersect/main.nf @@ -20,12 +20,18 @@ process INTERSECT_BED { path (input_file_2) val (intersectbed_args) - output: - stdout() + //output: + //path "${input_file_1.baseName}_i_${input_file_2.baseName}.bed", emit: intersect + //path "*.version.txt", emit: version script: + def params_string = intersectbed_args.collect { + /-$it.key $it.value/ + } join " " + """ - bedtools intersect -a ${input_file_1} -b ${input_file_2} ${intersectbed_args} + bedtools intersect -a ${input_file_1} -b ${input_file_2} ${params_string} > ${input_file_1.baseName}_i_${input_file_2.baseName}.bed + bedtools --version | sed -n "s/.*\\(v.*\$\\)/\\1/p" > bedtools.version.txt """ } diff --git a/software/bedtools/intersect/test/main.nf b/software/bedtools/intersect/test/main.nf index cb8e7c3d..b38f4c68 100644 --- a/software/bedtools/intersect/test/main.nf +++ b/software/bedtools/intersect/test/main.nf @@ -1,7 +1,6 @@ #!/usr/bin/env nextflow nextflow.preview.dsl = 2 - params.out_dir = "test_output" params.fastqc_args = '' params.publish_dir_mode = "copy" @@ -14,7 +13,12 @@ include INTERSECT_BED from '../main.nf' params(params) ch_input_1 = Channel.fromPath('./input_data/A.bed') ch_input_2 = Channel.fromPath('./input_data/B.bed') +def additional_params_map = [:] + +additional_params_map = [ s: "", + f: 0.9 ] + // Run the workflow workflow { - INTERSECT_BED(ch_input_1, ch_input_2, params.intersect_args) + INTERSECT_BED(ch_input_1, ch_input_2, additional_params_map) }