Skip to content

Commit 1ba2220

Browse files
committed
more updates
1 parent bdc1cf2 commit 1ba2220

File tree

7 files changed

+434
-711
lines changed

7 files changed

+434
-711
lines changed

plugins/nf-bactopia/src/main/nextflow/bactopia/BactopiaExtension.groovy

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import nextflow.bactopia.nfschema.SummaryCreator
3636
import static nextflow.bactopia.inputs.BactopiaTools.collectInputs
3737
import static nextflow.bactopia.BactopiaTemplate.getLogColors
3838
import static nextflow.bactopia.BactopiaTemplate.getLogo
39+
import static nextflow.bactopia.BactopiaTemplate.getWorkflowSummary
3940
import static nextflow.bactopia.nfschema.Common.getLongestKeyLength
4041

4142
/**
@@ -129,6 +130,21 @@ class BactopiaExtension extends PluginExtensionPoint {
129130
return output
130131
}
131132

133+
/*
134+
* Beautify parameters for summary and return as string
135+
*/
136+
@Function
137+
public String workflowSummary() {
138+
def Map params = session.params
139+
def WorkflowMetadata metadata = session.getWorkflowMetadata()
140+
return getWorkflowSummary(
141+
metadata,
142+
params,
143+
session.config.manifest.version,
144+
config.monochromeLogs,
145+
)
146+
}
147+
132148
private Map flattenNestedParamsMap(Map paramsMap) {
133149
def Map returnMap = [:]
134150
paramsMap.each { param, value ->
@@ -151,13 +167,15 @@ class BactopiaExtension extends PluginExtensionPoint {
151167
*/
152168
@Function
153169
void validateParameters(
154-
Map options = null
170+
Map options = null,
171+
Boolean isBactopiaTool = false
155172
) {
156173
def BactopiaSchema validator = new BactopiaSchema(config)
157174
validator.validateParameters(
158175
options,
159176
session.params,
160-
session.baseDir.toString()
177+
session.baseDir.toString(),
178+
isBactopiaTool
161179
)
162180
}
163181
}

plugins/nf-bactopia/src/main/nextflow/bactopia/BactopiaObserver.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ package nextflow.bactopia
1818

1919
import groovy.transform.CompileStatic
2020
import groovy.util.logging.Slf4j
21+
import java.nio.file.Path
22+
import java.nio.file.Paths
2123
import nextflow.Session
2224
import nextflow.trace.TraceObserver
2325

2426
import nextflow.bactopia.BactopiaConfig
2527
import nextflow.bactopia.nfschema.HelpMessageCreator
28+
import static nextflow.bactopia.BactopiaMotD.getMotD
2629

2730
/**
2831
* Bactopia workflow observer
@@ -59,6 +62,9 @@ class BactopiaObserver implements TraceObserver {
5962

6063
@Override
6164
void onFlowComplete() {
62-
log.info "Pipeline complete! 👋"
65+
log.info getMotD(false)
6366
}
67+
68+
void onWorkflowPublish(String name, Object value) {}
69+
void onFilePublish(Path destination, Path source, Map annotations) {}
6470
}

0 commit comments

Comments
 (0)