Bio-Forge: A High-Performance Rust Engine for DNA, RNA, and Protein System Operation/Repair banner

Bio-Forge: A High-Performance Rust Engine for DNA, RNA, and Protein System Operation/Repair

6 devlogs
61h 11m 45s

A high-performance, pure-Rust toolkit for standardizing and preparing DNA, RNA, and protein biomolecular systems. It repairs missing atoms, assigns protonation states, adds solvation layers, and unifies topologies to generate simulation-ready stru…

A high-performance, pure-Rust toolkit for standardizing and preparing DNA, RNA, and protein biomolecular systems. It repairs missing atoms, assigns protonation states, adds solvation layers, and unifies topologies to generate simulation-ready structures. The toolkit can process entire viral capsids at millisecond scale, and is available as a Web application, CLI, and reusable library, with built-in parallelization and spatial indexing for maximum performance and scalability.

(Viruses of millions atoms => takes only 1s)

Demo Repository

Loading README...

Tony Kan

v0.4.1 - Correct N-Terminal Proline Hydrogen Geometry

Summary:

Fixed a bug where N-terminal Proline residues were incorrectly assigned three hydrogens (H1, H2, H3) with a standard primary amine sp³ geometry. Proline has a secondary amine due to its pyrrolidine ring, so its N-terminus should only receive two hydrogens (H2, H3) when protonated, and one (H2) when deprotonated. The geometry calculation has been updated to correctly place these hydrogens based on the angle bisector of the CA-N-CD bonds, respecting the ring structure.

Changes:

  • Updated construct_n_term_hydrogens in ops/hydro.rs:

    • Added a specific branch for StandardResidue::PRO.
    • For N-terminal Proline, the code now calculates the direction for H2 and H3 using the bisector and perpendicular vectors of the N-CA and N-CD bonds.
    • H1 is never added to Proline.
    • H3 is only added if the terminus is protonated (pH < 8.0).
  • Added Validation Tests:

    • Introduced n_terminal_pro_residue helper for generating test cases.
    • Added tests to verify correct protonation states for N-term PRO with and without specified pH (pro_n_terminal_defaults_to_protonated_without_ph, pro_n_terminal_remains_protonated_below_pka, pro_n_terminal_deprotonates_above_pka).
    • Added geometric validation tests (pro_n_terminal_h_has_tetrahedral_bond_lengths, pro_n_terminal_h_has_tetrahedral_bond_angles) to ensure the newly placed hydrogens satisfy the expected 1.01 Å bond length and ~109.5° tetrahedral angles relative to the CA and CD atoms.
Attachment
0
Tony Kan

Shipped this project!

Hours: 18.77
Cookies: 🍪 556
Multiplier: 29.64 cookies/hr

Can process a viral capsid with 8 million atoms in one second (~800ms)!

v0.4.0

🚀 Features

🩹 Fixes

Full Changelog: https://github.com/TKanX/bio-forge/compare/v0.3.1...v0.4.0

Tony Kan

Implement Context-Aware Histidine Protonation and Refine pH Handling

Summary:

Significantly enhances the hydrogenation pipeline (ops::hydro) by introducing context-aware histidine protonation logic. It now detects potential salt bridges between histidine residues and nearby carboxylate groups (ASP⁻, GLU⁻, C-terminal COO⁻), automatically converting them to the doubly protonated HIP state when geometrically favorable. Additionally, the pH handling logic has been refined to allow users to opt-out of automatic protonation state changes by omitting the --ph flag, preserving original residue names while still adding hydrogens.

Changes:

PR: https://github.com/TKanX/bio-forge/pull/38

Attachment
Attachment
Attachment
Attachment
Attachment
Attachment
Attachment
0
Tony Kan

SEE PR #36: https://github.com/TKanX/bio-forge/pull/36

Summary:

Addresses geometric artifacts observed in reconstructed terminal atoms (N-terminal hydrogens, C-terminal OXT, and nucleic acid termini). The previous implementation of calculate_transform was too simplistic for single/double atom alignments and relied on global SVD coupling which could distort local geometry. Additionally, terminal atom construction has been rewritten to use robust local coordinate frames based on standard bond lengths and angles, rather than rough vector approximations.

Attachment
Attachment
Attachment
0
Tony Kan

Shipped this project!

Hours: 31.76
Cookies: 🍪 624
Multiplier: 19.66 cookies/hr

v0.3.0

🚀 Features

Full Changelog: https://github.com/TKanX/bio-forge/compare/v0.2.2...v0.3.0

Tony Kan

v0.3.0

🚀 Features

Full Changelog: https://github.com/TKanX/bio-forge/compare/v0.2.2...v0.3.0

Attachment
0
Tony Kan

DIFF(+15,607): https://github.com/TKanX/bio-forge/pull/26/changes

Summary:

Introduces the official BioForge Web Application, a high-performance, browser-based interface for molecular structure preparation. Built with Next.js 15, React 19, and Tailwind CSS, this application leverages the bio-forge-wasm crate to perform all heavy computations client-side, ensuring data privacy and zero-latency feedback. It features a fully integrated 3D viewer (Mol*), a reactive pipeline configuration system, and a robust state management architecture utilizing Zustand.

Changes:

  • WASM Integration & Core Logic:

    • Implemented a singleton WASM loader in core/wasm to ensure the heavy binary is initialized only once.
    • Developed a PipelineExecutor (core/pipeline) that orchestrates the execution of Clean, Repair, Hydro, Solvate, and Topology operations directly in the browser thread.
    • Created a robust file parser (core/file) capable of handling PDB, mmCIF, and MOL2 templates, converting them into managed FileEntry objects with live WASM structure references.
  • User Interface & Experience:

    • Design System: Created a comprehensive set of UI primitives (Buttons, Inputs, Sliders, Cards, Badges) styled with Tailwind CSS and oklch color spaces for a modern, accessible dark mode aesthetic.
    • Pipeline Panel: Built interactive configuration forms for every operation (e.g., pH sliders for hydrogenation, ion selection for solvation).
    • 3D Visualization: Integrated Mol (molstar)* for high-performance 3D rendering of structures. The viewer supports instant updates between processing steps without reloading the page.
    • Interactive File List: Implemented file cards with expandable details, real-time status indicators, and batch processing actions.
Attachment
Attachment
0
Tony Kan

Full Changelog: https://github.com/TKanX/bio-forge/commits/v0.2.2

Attachment
0