dda-rs
Rust interface for the run_DDA_AsciiEdf binary (Cosmopolitan Libc APE format).
Overview
This crate provides a clean, type-safe Rust interface to execute the DDA (Delay Differential Analysis) binary and parse its output. It handles all the complexities of:
- Cross-platform APE binary execution (Windows/macOS/Linux)
- Command-line argument construction
- Output file parsing and matrix transformation
- Error handling and logging
Features
- Type-safe API: Strongly-typed request and response structures
- Cross-platform: Handles APE binary execution on Unix (sh wrapper) and Windows (direct exe)
- Async execution: Built on Tokio for non-blocking DDA analysis
- Automatic parsing: Processes raw DDA output into usable matrices
- Error handling: Comprehensive error types with descriptive messages
Usage
use ;
async
Architecture
Components
types.rs: Request/response structures and parameter typesrunner.rs: DDA binary execution logicparser.rs: Output file parsing and matrix transformationerror.rs: Error types and result aliases
Binary Execution
The crate automatically handles the APE (Actually Portable Executable) format:
- Unix (macOS/Linux): Runs through
shwrapper to handle polyglot format - Windows: Executes
.exedirectly
Output Processing
The parser implements the same transformation as dda-py:
- Skip first 2 columns
- Take every 4th column from the remaining data
- Transpose to get [channels/scales × timepoints] format
License
MIT