Refua

Refua is the open-source toolkit behind AgentCures. It brings structure prediction, affinity scoring, molecular design, and ADMET tools into one Python package.

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

Why Open Science Matters

Drug discovery is hard enough without closed tooling. With open code, researchers can inspect methods, check results, and reuse each other's work.

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
  • Spend less time setting up discovery tools
  • 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, alongside small-molecule analysis, ADMET profiling, and interactive 3D views.

Platform Capabilities

🐍

Fluent Python API

Define inputs, run predictions, and analyze results through a Python API. Combine these steps without switching between command-line tools or intermediate files.

⚡

Persistent Model Sessions

Load a model once and reuse it for many predictions. Large screens avoid the time spent reloading model weights for each run.

💾

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.

🔬

Connected Discovery Tools

Use structure prediction, affinity scoring, ADMET profiling, and molecular design together in one package.

📓

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)

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.

Researchers at pharmaceutical companies, biotech startups, and academic labs can inspect and use the same tools. 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

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.