@@ -107,110 +107,6 @@ class BactopiaExtension extends PluginExtensionPoint {
107107 }
108108
109109
110- //
111- // Groovy Map of the help message
112- //
113- @Function
114- public String paramsHelp () {
115- def Map params = session. params
116- def String help = " "
117- def HelpMessageCreator helpCreator = new HelpMessageCreator (config, session, params[" help_all" ])
118- help + = helpCreator. getBeforeText(session, (String ) params[" workflow" ][" name" ], (String ) params[" workflow" ][" description" ])
119- if (params[" help_all" ]) {
120- log. debug(" Printing out the full help message" )
121- help + = helpCreator. getFullMessage()
122- } else if (params[" help" ]) {
123- log. debug(" Printing out the short help message" )
124- def paramValue = null
125- help + = helpCreator. getShortMessage(paramValue instanceof String ? paramValue : " " )
126- }
127- help + = helpCreator. getAfterText()
128- return help
129- }
130-
131- //
132- // Groovy Map summarising parameters/workflow options used by the pipeline
133- //
134- @Function
135- public Map paramsSummaryMap (
136- Map options = null ,
137- WorkflowMetadata workflow
138- ) {
139- def SummaryCreator creator = new SummaryCreator (config)
140- return creator. getSummaryMap(
141- options,
142- workflow,
143- session. baseDir. toString(),
144- session. params
145- )
146- }
147-
148- /*
149- * Beautify parameters for summary and return as string
150- */
151- @Function
152- public String paramsSummaryLog (
153- Map options = null ,
154- WorkflowMetadata workflow
155- ) {
156- def Map params = session. params
157- def String schemaFilename = options?. containsKey(' parameters_schema' ) ? options. parameters_schema as String : config. parametersSchema
158-
159- def colors = getLogColors(config. monochromeLogs)
160- String output = ' '
161- output + = getLogo(workflow, config. monochromeLogs, params. workflow. name, params. workflow. description)
162-
163- def Map paramsMap = paramsSummaryMap(workflow, parameters_schema : schemaFilename)
164- paramsMap. each { key , value ->
165- paramsMap[key] = flattenNestedParamsMap(value as Map )
166- }
167- def maxChars = getLongestKeyLength(paramsMap)
168- for (group in paramsMap. keySet()) {
169- def Map group_params = paramsMap. get(group) as Map // This gets the parameters of that particular group
170- if (group_params) {
171- output + = " $colors . bold $group $colors . reset \n "
172- for (String param in group_params. keySet()) {
173- output + = " " + colors. blue + param. padRight(maxChars) + " : " + colors. green + group_params. get(param) + colors. reset + ' \n '
174- }
175- output + = ' \n '
176- }
177- }
178- output + = " !! Only displaying parameters that differ from the defaults !!\n "
179- output + = dashedLine(config. monochromeLogs) + " \n "
180- return output
181- }
182-
183- /*
184- * Beautify parameters for summary and return as string
185- */
186- @Function
187- public String workflowSummary () {
188- def Map params = session. params
189- def WorkflowMetadata metadata = session. getWorkflowMetadata()
190- return getWorkflowSummary(
191- metadata,
192- params,
193- session. config. manifest. version,
194- config. monochromeLogs,
195- )
196- }
197-
198- private Map flattenNestedParamsMap (Map paramsMap ) {
199- def Map returnMap = [:]
200- paramsMap. each { param , value ->
201- def String key = param as String
202- if (value instanceof Map ) {
203- def Map flatMap = flattenNestedParamsMap(value as Map )
204- flatMap. each { flatParam , flatValue ->
205- returnMap. put(key + " ." + flatParam, flatValue)
206- }
207- } else {
208- returnMap. put(key, value)
209- }
210- }
211- return returnMap
212- }
213-
214110 /*
215111 * Function to loop over all parameters defined in schema and check
216112 * whether the given parameters adhere to the specifications
0 commit comments