
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
bio-forge-wasm
Advanced tools
WebAssembly bindings for BioForge, a pure Rust library for the automated repair, preparation, and topology construction of biological macromolecules.
BioForge is a pure-Rust toolkit for automated preparation of biological macromolecules. It reads experimental structures (PDB/mmCIF), reconciles them with high-quality residue templates, repairs missing atoms, assigns hydrogens and termini, builds topologies, and optionally solvates the system with water and ions—all without leaving the Rust type system.
Atom, Residue, Chain, and Structure types backed by nalgebra make geometric operations trivial.ops::Error so workflows compose cleanly.Load → Clean → Repair → Hydrogenate → Solvate → Topology → Write
io::read_pdb_structure or io::read_mmcif_structure parses coordinates with IoContext alias resolution.ops::clean_structure removes waters, ions, hetero residues, or arbitrary residue names via CleanConfig.ops::repair_structure realigns residues to templates and rebuilds missing heavy atoms (OXT on C-termini, OP3 on 5'-phosphorylated nucleic acids).ops::add_hydrogens infers protonation states (configurable pH, histidine strategy, and salt bridge detection) and reconstructs hydrogens from template anchors.ops::solvate_structure creates a periodic box, packs water on a configurable lattice, and swaps molecules for ions to satisfy a target charge.ops::TopologyBuilder emits bond connectivity with peptide-link detection, nucleic backbone connectivity, and disulfide heuristics.io::write_pdb_structure / io::write_mmcif_structure serialize the processed structure; write_*_topology helpers emit CONECT or struct_conn records.Install the latest BioForge CLI binary from the releases page or via cargo:
cargo install bio-forge
Once the bioforge binary is installed, you can repair a structure in a single step:
bioforge repair -i input.pdb -o repaired.pdb
Explore the complete preparation pipeline in the user manual and browse the examples directory for runnable walkthroughs.
BioForge is also available as a library crate. Add it to your Cargo.toml dependencies:
[dependencies]
bio-forge = "0.4.1"
use std::{fs::File, io::{BufReader, BufWriter}};
use bio_forge::{
io::{
read_pdb_structure,
write_pdb_structure,
write_pdb_topology,
IoContext,
},
ops::{
add_hydrogens, clean_structure, repair_structure, solvate_structure,
CleanConfig, HydroConfig, SolvateConfig, TopologyBuilder,
},
};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let ctx = IoContext::new_default();
let input = BufReader::new(File::open("input.pdb")?);
let mut structure = read_pdb_structure(input, &ctx)?;
clean_structure(&mut structure, &CleanConfig::water_only())?;
repair_structure(&mut structure)?;
add_hydrogens(&mut structure, &HydroConfig::default())?;
solvate_structure(&mut structure, &SolvateConfig::default())?;
let topology = TopologyBuilder::new().build(structure.clone())?;
write_pdb_structure(BufWriter::new(File::create("prepared.pdb")?), &structure)?;
write_pdb_topology(BufWriter::new(File::create("prepared-topology.pdb")?), &topology)?;
Ok(())
}
Prefer mmCIF? Swap in
read_mmcif_structure/write_mmcif_structure. Need to process ligands? Parse them viaio::read_mol2_templateand feed the resultingTemplateintoTopologyBuilder::add_hetero_template.
Install via npm:
npm install bio-forge-wasm
Prepare a structure with the following code:
import { Structure } from "bio-forge-wasm";
const pdb = await fetch("https://files.rcsb.org/view/1UBQ.pdb").then((r) =>
r.text()
);
const structure = Structure.fromPdb(pdb);
structure.clean({ removeWater: true });
structure.repair();
structure.addHydrogens({ hisStrategy: "network" });
const topology = structure.toTopology();
console.log(`Bonds: ${topology.bondCount}`);
| Resource | Description |
|---|---|
| CLI Manual | Command-line usage and options |
| JS/TS API | WebAssembly bindings reference |
| Rust API | Library documentation |
| Architecture | Internal design and algorithms |
| Examples | Runnable walkthroughs |
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
WebAssembly bindings for BioForge, a pure Rust library for the automated repair, preparation, and topology construction of biological macromolecules.
We found that bio-forge-wasm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.