Refua

Refua is the open-source toolkit behind AgentCures. It combines structure prediction, affinity scoring, generative design, and ADMET utilities in one Python-first package.

10 Packages
1 pip install
100% In-Memory
MIT Licensed

Why Open Science Matters

Drug discovery is hard enough without closed tooling. Open code lets teams verify results, reuse methods, and build faster from shared work. Open science improves speed and trust when researchers can inspect and reproduce the full workflow.

Refua was built to make practical ML tools available to more labs, not only well-funded groups. We want the same core capabilities to be available to biotechs, academics, and independent researchers.

The Refua Vision

  • Make modern discovery tooling easier to access
  • Enable reproducible research through open, versioned code
  • Lower setup friction from idea to lead candidate
  • Keep structure and design tools in one workflow

What is Refua?

Refua is a drug discovery toolkit that combines structure prediction, affinity modeling, and generative design in one package. It brings together the Boltz inference stack for protein–ligand complex folding with the BoltzGen design pipeline for de novo molecular generation, plus small-molecule analytics, ADMET profiling, and interactive 3D visualization, giving you everything you need from target definition to candidate generation.

Platform Capabilities

🐍

Fluent Python API

Build specs, run predictions, and post-process results with a readable, composable API. There is no need to stitch together CLI calls, YAML, or intermediate files.

⚡

Persistent Model Sessions

Keep a predictor instance alive and run many inferences in a loop without paying initialization and checkpoint-loading cost each time. This matters for high-throughput virtual screens.

💾

All-In-Memory Workflows

Prepare inputs, run inference, and perform analysis entirely in memory without writing temporary files to disk. Ideal for notebook-driven research and cloud pipelines.

🔬

End-to-End Coverage

From structure prediction to binding affinity to ADMET profiling and generative design, one unified package replaces a patchwork of disconnected tools.

📓

Jupyter-Native Visualization

Interactive 3D molecular viewers, 2D structure renderings, and color-coded ADMET dashboards display inline in any Jupyter notebook, powered by the Refua Notebook extension.

🔧

Modern Dependency Stack

Support for up-to-date PyTorch, CUDA, and scientific Python libraries. A single pip install refua gets you started; optional extras add GPU acceleration.

Core Components

Refua ships six tightly integrated modules. Each can be used standalone or composed into multi-step workflows.

🧬

Boltz-2: Structure Prediction

Boltz-2 predicts 3D structures for protein–ligand, protein–protein, and protein–nucleic-acid complexes from sequence alone. It supports small-molecule ligands, covalent modifications, and multi-chain assemblies.

The Refua wrapper provides a fluent builder pattern: define proteins by sequence, add ligands by SMILES, attach constraints, and call .fold() to obtain an all-atom 3D structure plus per-residue confidence scores, all without leaving Python.

🎨

BoltzGen: Generative Design

BoltzGen is the design counterpart to Boltz-2. Given a target and structural constraints, it can sample peptide binders, antibody CDR loops, and linker sequences for downstream evaluation.

Refua exposes BoltzGen through the same composable API. You can specify chain lengths, add cyclic-peptide constraints or template insertions, and generate sequences ready for downstream affinity scoring and ADMET profiling.

💊

SM: Small Molecule Analytics

The SM class wraps a SMILES string and computes a comprehensive panel of molecular descriptors, including molecular weight, LogP, topological polar surface area (TPSA), hydrogen-bond donors and acceptors, rotatable bond count, and Lipinski rule-of-five compliance backed by RDKit. Properties can be evaluated lazily on first access or eagerly with to_dict().

SM integrates with the ADMET module for full drug-likeness profiling and with SmilesView for instant 2D depictions inside notebooks.

🛡️

ADMET Profiling

ADMET (Absorption, Distribution, Metabolism, Excretion, and Toxicity) often determines whether a molecule can become a drug. Refua’s ADMETView widget takes a dictionary of predicted properties (LogP, Caco-2 permeability, hERG inhibition, AMES mutagenicity, bioavailability, plasma protein binding, and more) and renders a color-coded dashboard with optimal / warning / danger thresholds derived from medicinal-chemistry guidelines.

Supported categories span absorption (LogP, Caco-2, solubility, HIA, PAMPA), distribution (PPBR, VDss, BBB penetration), metabolism (clearance, half-life), excretion (P-gp substrate), and toxicity (hERG, AMES, DILI, LD50, carcinogenicity).

🔭

Mol* 3D Viewer

MolstarView embeds the Mol* molecular visualization framework directly inside Jupyter notebooks. Load structures from Binary CIF (the compact format produced by Boltz-2), PDB files, or public RCSB URLs. The viewer renders publication-quality 3D representations with interactive rotation, zoom, ligand highlighting, and surface display with no external software required.

Combined with Boltz-2, researchers can fold a complex and visualize it in a single cell, enabling rapid hypothesis testing and visual inspection of predicted binding poses.

🔗

Complex: Protein-Ligand Assembly

The Complex class orchestrates multi-component assemblies. Combine proteins, small molecules, nucleic acids, and covalent modifications into a single specification, then fold the entire assembly with Boltz-2 and request binding-affinity predictions like IC50, Kd, and binding probability in one fluent call chain.

ComplexView renders the result as an interactive 3D scene annotated with affinity metrics, component labels, and confidence scores. It is useful for team presentations and notebook reports.

Get Started in Minutes

Installation

pip install refua

For NVIDIA GPU support:

pip install "refua[cuda]"

Unified API: Same Complex Flow for Ligands or Binders

from pathlib import Path

from refua import Binder, Complex, Protein, SM

target = Protein(
    "MSEQNNTEMTFQIQRIYTKDISFEAPNAPHVFQQLAGKYTPEEIRNVLSTLQKAD",
    ids="A",
)

# Protein + ligand -> Boltz2 structure + affinity
result = (
    Complex([target, SM("Cn1cnc2n(C)c(=O)n(C)c(=O)c12")], name="demo")
    .request_affinity()
    .fold()
)
Path("complex.bcif").write_bytes(result.to_bcif())
print(result.affinity.ic50, result.affinity.binding_probability)

# Protein + binder placeholder -> Boltz2 structure + BoltzGen design inputs
binder = Binder(length=12, ids="P")
result = Complex([target, binder], name="design").fold()
Path("design.bcif").write_bytes(result.to_bcif())
print("binder spec:", binder.sequence)

Rich Examples & Documentation

Refua ships with practical examples covering common drug discovery workflows.

Antibody Design Minimal BoltzGen antibody design spec
Protein-Ligand Affinity Boltz protein-ligand affinity predictions
KRAS G12D + MRTX-1133 Fold KRAS G12D with inhibitor and print affinity
Peptide Binder BoltzGen peptide binder with optional cyclic peptides
Pocket Constraints Boltz complex with pocket/contact constraints and MSA
Multi-Chain MSAs Cross-chain constraints and multi-chain MSAs
Template Insertions Template structure groups and design insertions
Multi-Pocket Complex Multi-ligand pocket constraints with contacts

Built for the Research Community

Refua is completely open source and welcomes contributions from researchers worldwide. By making these tools freely available, we aim to broaden access to modern drug discovery methods.

Whether you are at a major pharmaceutical company, a small biotech startup, or an academic lab with limited resources, Refua gives you the same powerful capabilities. Science should not be limited by budget.

Who Uses Refua?

  • Computational chemists running virtual screens
  • Structural biologists analyzing predicted complexes
  • ML researchers benchmarking new architectures
  • Biotech teams building automated discovery pipelines

The Refua Ecosystem

Refua is more than a single toolkit. It is a complete open-source ecosystem of interoperable packages covering every stage of the drug discovery lifecycle, from data curation to cloud deployment.

Build With Refua

Start with Refua, run the examples, and adapt the pieces you need for your own programs. Contributions and issue reports are welcome.