How twlab/cig-pipelines works
Project type and purpose
• This is an open-source collection of genomics workflows, tools, and tasks written in Workflow Description Language (WDL).
• Its purpose is to bundle end-to-end genomics pipelines (under wdl/pipelines), reusable tasks (wdl/tasks), small combiners (wdl/tools), and shared data structures (wdl/structs), which users execute on a WDL engine (e.g., Cromwell, miniWDL) against local or cloud compute backends.
File structure
• Top-level directories:
• scripts: auxiliary shell or Python scripts (e.g., build_imports)
• wdl/pipelines: full-scale workflows wrapping many tasks
• wdl/tasks: low-level task wrappers around CLI tools and scripts
• wdl/tools: mid-level workflows combining a handful of tasks
• wdl/structs: type and runtime definitions shared by pipelines, tools, tasks
• Dockerfiles reside alongside certain WDLs to define containerized execution environments.
• JSON/YAML files next to each WDL show input schemas and expected outputs—helpful for understanding data flows.
Key insights from README
• Pipelines call tasks and tools in a layered fashion, using structs to enforce input/output contracts.
• Docker images are stored in a separate repo and referenced in each task/tool WDL.
• The execution engine (external) orchestrates tasks, schedules jobs on HPC or cloud, and collects results.
a. Main components
• WDL Execution Engine (e.g., Cromwell)
• Pipeline definitions (wdl/pipelines)
• Task modules (wdl/tasks)
• Tool workflows (wdl/tools)
• Struct/type definitions (wdl/structs)
• Docker/Container Registry (external)
• Compute Infrastructure (local HPC nodes or cloud batch/VMs)
• Artifact storage (e.g., S3 buckets, shared filesystem)
b. Relationships and interactions
– Pipelines reference tools and tasks by import statements
– Tools group multiple tasks into higher-level workflows
– Tasks declare Docker container URIs for execution
– The engine schedules each task on compute nodes, pulling containers from the registry
– Struct definitions resolve data types and enforce compatibility across imports
– Artifacts (inputs/outputs) are staged on the shared filesystem or object storage
c. Architectural patterns and design principles
– Layered modularity: pipelines → tools → tasks → containerized commands
– Separation of concerns: structs for types, tasks for single commands, tools for mini-workflows, pipelines for full workflows
– Declarative orchestration: WDL engine drives execution graph based on data dependencies
– Reusability: tasks and tools can be swapped or combined without rewriting pipelines
d. Key technologies and frameworks
– WDL specification and workflow imports mechanism
– Docker containers for reproducible environments
– JSON/YAML schemas for CI validation (inputs/outputs)
– External WDL runner (Cromwell, miniWDL, Toil-WDL)
– Execution backends (SLURM, Google Pipelines API, AWS Batch)
Essential details
• Layered structure: top-level pipelines calling into mid-level tools and low-level tasks.
• Container pull as part of task execution.
• Data flow clearly: inputs (FASTQ, BAM, references) → tasks → interim files → final outputs (VCF, reports).
• Special patterns (e.g., scatter/gather in WDL for parallelism).