conditionalTest
WDL Version
1.0
Conditional Statements WDL Workflow
Overview
A workflow that demonstrates the usage of conditional statements in WDL. The workflow processes sample information using structs and demonstrates different types of conditional operations including if statements in scatter blocks and mutually exclusive conditional blocks.
Workflow Components
Struct: SampleInfo
Defines the structure for sample information with the following fields:
name: Stringquality_score: Floattype: String
Workflow: conditional_example
The main workflow that demonstrates various conditional operations.
Inputs:
samples: Array[SampleInfo] containing structured sample dataquality_threshold: Float threshold for high-quality samples
Outputs:
final_summary: String containing the processing summaryqc_report: File containing detailed QC information for all samples
Conditional Operations Demonstrated:
- If statement within scatter (processing high-quality samples)
- Multiple mutually exclusive conditional blocks (WDL 1.0 style branching)
- Usage of select_all() with conditional outputs
- Usage of select_first() for mutually exclusive task outputs
Tasks:
process_high_quality: Processes samples that meet quality thresholdrun_qc_report: Generates QC report for all samplessummarize: Creates summary based on number of processed samples
Usage
# Execute with cromwell
java -jar cromwell.jar run conditionalTest.wdl -i inputs.json
# Execute with miniwdl
miniwdl run conditionalTest.wdl -i inputs.json
Purpose
This workflow serves as a test case for:
- Conditional execution in WDL 1.0
- If statements within scatter blocks
- Mutually exclusive conditional blocks
- Handling optional outputs with select_all()
- Accessing struct members
- Basic sample data processing
- Docker container usage
Version
WDL 1.0
Notes
- Demonstrates proper conditional statement usage in WDL 1.0
- Shows how to handle mutually exclusive execution paths
- Illustrates conditional logic within scatter blocks
- Shows proper struct member access
- Tests input parsing for struct types
Table of Contents
Page
Type
Description