How bihealth/digestiflow-demux works
Main Components
• CLI Interface & Configuration: Represent the program’s entry point (via __main__.py) which reads user-specified command-line arguments and configuration files (e.g., ~/.digestiflowrc.toml).
• Configuration Loader: A component responsible for processing the TOML configuration file. This is essential since settings like API URL, token, demultiplexing options, and cluster execution parameters are defined here.
• Wrapper Components: Illustrate separate components for each of the wrapped tools:
○ bcl2fastq (and its alternative variant)
○ FastQC
○ MultiQC
○ Picard (with its variants for basecalls_to_fastq and extract_barcodes)
• Logging & Exception Handling: Include a dedicated error-handling component (exceptions.py) and logging subsystem that captures and records each step’s outcome.
• Testing and Versioning Components: Though secondary for the execution flow, note the presence of a tests directory and versioning tools (versioneer.py, _version.py) which support maintenance and quality assurance.
Relationships and Interactions
• A feedback loop from the logging/exception systems to the main execution flow to denote error reporting and status management.
Architectural Patterns and Design Principles
• Modular Design: Highlight that each component (API client, workflow engine, wrappers) is clearly separated by directories and Python modules.
• Pipeline Orchestration: Emphasize the role of Snakemake in controlling the flow of tasks, which maps to a typical workflow management pattern.
• Extensibility: Note that the wrappers for each tool (found in the "wrappers" directory) demonstrate a plug-in-like system; these could be expanded or modified independently.
• Configuration-Driven Behavior: Point out that the heavy reliance on a common configuration file (with REST API and demux parameters) ensures that changes in external settings do not require code changes.
Relevant Technologies, Frameworks, and Libraries
• Python as the primary programming language.
• Snakemake for pipeline management.
• External bioinformatics tools (bcl2fastq, FastQC, MultiQC, Picard) that are wrapped for execution.
• REST API interactions to interface with Digestiflow’s Web UI.
• Cluster execution support via DRMAA and jobscript parameters for HPC environments.