用智能代理+静态分析,把老旧生物信息代码转成现代Rust语言。
Static analysis-guided agentic AI translation enables Rust as a full stack bioinformatics language
- 用AI代理结合静态分析自动翻译旧代码到Rust。
- Bascet工具大小缩小80倍,编译快10倍,关键步骤提速3倍以上。
- 让单细胞分析工具首次原生支持Windows,无需容器运行。
生物信息学领域长期受制于遗留代码——这些代码虽广泛使用,但缺乏维护者或采用过时语言(如Perl、Fortran),导致维护成本高,且动态类型语言难以利用现代硬件。遗留代码还可能有安全或可靠性问题,不适于临床环境。本文展示,结合静态分析的智能代理AI可有效将此类代码迁移至现代语言Rust。我们提供提示词和配套软件,实现系统化翻译,并在NGS与影像处理常用工具上进行评估。以我们的工具Bascet为例:代码规模减少约80倍,构建时间缩短约10倍,核心步骤性能提升超3倍;同时移除了所有Unix依赖,使Bascet成为首个可在原生Windows上运行的单细胞分析流程,无需容器。大规模重构生物信息软件现可在有限预算下实现,推动更复杂工具的发展。
原文摘要 · Abstract (English)
The field of bioinformatics struggles with legacy code - old code that is commonly used but may no longer have a maintainer, or may be written in an now-unfamiliar language (e.g. Perl, Fortran). This incurs maintenance cost (technical debt), but dynamically typed languages also negatively impacts the environment and fail to make use of modern hardware. Legacy code may also have security or safety problems that make it unsuited for use in clinical settings. Here we show that agentic AI, combined with static analysis, can be used to translate legacy code to the modern language Rust. We provide prompts and supporting software to aid systematic translation, and evaluate it on common software for NGS and imaging. We showcase the result on our software Bascet: Size was reduced by ~80x, build time decreased by ~10x, and performance of key steps improved >3x. Unix dependencies were also removed, making Bascet the only single-cell pipeline able to run on native Windows, without a container. Large-scale refactoring of bioinformatics software is thus now possible at a limited budget, enabling more complex tools to be developed.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。