mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
Very preliminary implementation of passing optional params to bedtools/intersect modules
This commit is contained in:
parent
759dd85c92
commit
d30089f12d
2 changed files with 15 additions and 5 deletions
|
@ -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
|
||||
"""
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue