comparison 0.2.0/workflows/conf/process/cronology_db.process.config @ 11:a5f31c44f8c9

planemo upload
author kkonganti
date Mon, 15 Jul 2024 16:11:44 -0400
parents
children
comparison
equal deleted inserted replaced
10:ddf7a172bf30 11:a5f31c44f8c9
1 process {
2 if (params.dpubmlstpy_run) {
3 withName: 'DOWNLOAD_PUBMLST_SCHEME' {
4 ext.args = addParamsToSummary(
5 loadThisFunction("${params.toolshelp}${params.fs}dpubmlstpy.nf").dpubmlstpyHelp(params).helpparams
6 )
7 }
8 }
9
10 if (params.checkm2predict_run) {
11 withName: 'CHECKM2_PREDICT' {
12 ext.args = addParamsToSummary(
13 loadThisFunction("${params.toolshelp}${params.fs}checkm2predict.nf").checkm2predictHelp(params).helpparams
14 )
15 }
16 }
17
18 if (params.guncrun_run) {
19 withName: 'GUNC_RUN' {
20 ext.args = addParamsToSummary(
21 loadThisFunction("${params.toolshelp}${params.fs}guncrun.nf").guncrunHelp(params).helpparams
22 )
23 }
24 }
25
26 if (params.mlst_run) {
27 withName: 'MLST' {
28 ext.args = addParamsToSummary(
29 loadThisFunction("${params.toolshelp}${params.fs}mlst.nf").mlstHelp(params).helpparams
30 )
31 }
32 }
33
34 if (params.mashsketch_run) {
35 withName: 'MASH_SKETCH' {
36 ext.args = addParamsToSummary(
37 loadThisFunction("${params.toolshelp}${params.fs}mashsketch.nf").mashsketchHelp(params).helpparams
38 )
39 }
40 }
41 }
42
43 // Method to instantiate a new function parser
44 // Need to refactor using ScriptParser... another day
45 def loadThisFunction (func_file) {
46 GroovyShell grvy_sh = new GroovyShell()
47 def func = grvy_sh.parse(new File ( func_file ) )
48 return func
49 }
50
51 // Method to add relevant final parameters to summary log
52 def addParamsToSummary(Map params_to_add = [:]) {
53
54 if (!params_to_add.isEmpty()) {
55 def not_null_params_to_add = params_to_add.findAll {
56 it.value.clivalue != null &&
57 it.value.clivalue != '[:]' &&
58 it.value.clivalue != ''
59 }
60
61 params.logtheseparams += not_null_params_to_add.keySet().toList()
62
63 return not_null_params_to_add.collect {
64 "${it.value.cliflag} ${it.value.clivalue.toString().replaceAll(/(?:^\s+|\s+$)/, '')}"
65 }.join(' ').trim()
66 }
67 return 1
68 }