Snakemaker: Seamlessly transforming ad-hoc analyses into sustainable Snakemake workflows with generative AI
Marco Masera, Alessandro Leone, Johannes Köster, Ivan Molineris
TL;DR
Biology software pipelines suffer from reproducibility and sustainability issues due to evolving tools and ad-hoc scripts. Snakemaker introduces a generative AI-powered workflow transformer that non-invasively converts shell history and IPython notebooks into Snakemake workflows, while tracking environments and documenting changes. It provides two working modes (Shell and Notebook) and an integrated chat assistant, all implemented as a VSCode extension with GitHub Copilot integration. The approach includes a structured pipeline for shell tracking (context integration, rule drafting, config extraction, post-processing, validation) and a DAG-based notebook decomposition that resolves a global notebook state into file-based dependencies. The results show reliable workflow extraction, adherence to best practices, and a practical path toward reproducible, maintainable bioinformatics analyses.
Abstract
Reproducibility and sustainability present significant challenges in bioinformatics software development, where rapidly evolving tools and complex workflows often result in short-lived or difficult-to-adapt pipelines. This paper introduces Snakemaker, a tool that leverages generative AI to facilitate researchers build sustainable data analysis pipelines by converting unstructured code into well-defined Snakemake workflows. Snakemaker non-invasively tracks the work performed in the terminal by the researcher, analyzes execution patterns, and generates Snakemake workflows that can be integrated into existing pipelines. Snakemaker also supports the transformation of monolithic Ipython Notebooks into modular Snakemake pipelines, resolving the global state of the notebook into discrete, file-based interactions between rules. An integrated chat assistant provides users with fine-grained control through natural language instructions. Snakemaker generates high-quality Snakemake workflows by adhering to the best practices, including Conda environment tracking, generic rule generation and loop unrolling. By lowering the barrier between prototype and production-quality code, Snakemaker addresses a critical gap in computational reproducibility for bioinformatics research.
