Skip to content

## Add pipeio

Add pipeio.matlab module for MATLAB rule wiring

Pipeio needs a pipeio.matlab module that provides a generalized matlab2shell() utility for wiring MATLAB functions into Snakemake shell: directives.

Context

pixecog's tests/snakemake-matlab/matlab_utils.py has a proof-of-concept that works but is hardcoded. The pattern is valuable: compose a MATLAB -batch command string that Snakemake can call.

Requirements

  1. pipeio.matlab.matlab2shell() — generalized version:
  2. MATLAB binary path from runtime.matlab_bin config key (like runtime.projio_python and runtime.datalad_bin)
  3. Configurable startup script path (default: code/startup.m)
  4. Configurable path reset behavior
  5. No hardcoded paths

  6. runtime.matlab_bin config key — add to projio's runtime config schema alongside projio_python and datalad_bin

  7. Documentation — add a section to pipeio pipeline-docs or create a skill showing the MATLAB rule wiring pattern (Snakefile shell: directive using matlab2shell())

  8. Reference Snakefile pattern:

    rule sleepstates:
        shell:
            matlab2shell("functionBrainStateClass_pipeline(pwd,'{wildcards.rec}',{params.nchannel},{params.fs},'{output.mat}','{output.png}')") + " >> {log} 2>&1"
    

Reference

  • Source: pixecog/tests/snakemake-matlab/matlab_utils.py
  • Snakefile: pixecog/tests/snakemake-matlab/Snakefile
  • issue-arash-20260407-162859-574826.md — Directly related: adding runtime.matlab_bin config key alongside projio_python and datalad_bin touches the same runtime env configuration schema being discussed there