Boltz & Protenix
This guide walks through the molcube.boltz_protenix.BoltzProtenixProject workflow
for running Boltz-2 or Protenix structure-prediction jobs. The workflow has three
stages: initialize the project, add chains and constraints, and inspect and download
the results.
Setup
Import the client and authenticate before calling any project methods. Then import
ModelType from the enum module — it is not re-exported from the top-level
molcube namespace:
import molcube as mc
from molcube.boltz_protenix.enum import ModelType
molcube = mc.API("api.molcube.com", 443)
molcube.authenticate(api_token="<your-api-token>")
Create one project helper instance and reuse it throughout the workflow:
project = molcube.create_boltz_protenix_project()
Step 1. Create a Project
Check available Protenix versions
When using the Protenix model, call
available_protenix_version()
before calling setup_project() to see which versions are selectable:
>>> project.available_protenix_version()
['protenix_base_default_v1.0.0', 'protenix_base_20250630_v1.0.0', ...]
The first entry in the list is the default.
Initialize the project
Call setup_project()
to configure project metadata. Use the model argument to choose between Boltz and
Protenix. Provide title, model, and workspace for every project; add
protenix_version only when the model is protenix:
# Boltz (default)
project.setup_project(
title="boltz_api_demo",
model=ModelType.BOLTZ,
)
# Protenix
# project.setup_project(
# title="protenix_api_demo",
# model=ModelType.PROTENIX,
# protenix_version="protenix_base_default_v1.0.0",
# )
Key arguments:
title(str): Project title. Required; 1–100 characters.model(str):ModelType.BOLTZorModelType.PROTENIX. Defaults toModelType.BOLTZ.workspace(str):'personal'or'team'. Defaults to'personal'.protenix_version(str | None): Valid only whenmodelisModelType.PROTENIX.
Step 2. Add Chains
Chains can only be added after setup_project() has been called. Each chain is
assigned an alphabetical label (A, B, C, …) in the order it is added. Protein, DNA, and
RNA chains each accept a sequence, optional cyclization, modifications, and copies;
ligand chains support SMILES, CCD, and file input.
Protein chain
Use add_protein_chain()
to add an amino-acid sequence:
project.add_protein_chain(
"MKTAYIAKQRQISFVKSHFSRQ",
modifications=[{"position": 5, "ccd": "SEP"}],
)
sequence: Amino-acid sequence (required).copies: Number of identical copies to add. Defaults to1.cyclic: Cyclic peptide flag. Boltz only. Defaults toFalse.modifications: Residue-modification list. Each entry must be{"position": int, "ccd": str}.
DNA chain
Use add_dna_chain()
to add a DNA sequence:
project.add_dna_chain(
"ATCGATCG",
copies=1,
cyclic=False,
modifications=[{"position": 2, "ccd": "5CM"}],
)
RNA chain
Use add_rna_chain()
to add an RNA sequence:
project.add_rna_chain(
"AUCGAUCG",
copies=1,
cyclic=False,
modifications=[{"position": 3, "ccd": "PSU"}],
)
Note
cyclic is available for the Boltz model only; setting it to True while
model=ModelType.PROTENIX raises a ValueError. This applies to protein, DNA,
and RNA chains alike.
Ligand chain
Add a ligand using one of three input methods. Use only one method per chain.
add_ligand_from_smiles() is the default path and the most common choice:
project.add_ligand_from_smiles("CCO")
Use add_ligand_from_ccd()
when the CCD code is known:
# project.add_ligand_from_ccd("ATP")
Use add_ligand_from_file()
when a local structure file is available. Protenix requires .sdf:
# project.add_ligand_from_file("/absolute/path/to/ligand.sdf")
Step 3. Add Constraints
Add constraints only after at least one chain has been stored in the project. Pocket constraints target one binder chain and one or more contacts; contact constraints define a distance bound between two residues or atoms; bond constraints are used when atom-level input is needed.
Bond constraint
Use add_bond_constraint()
to enforce a covalent bond between two atoms:
project.add_bond_constraint(
atom1_chain="A",
atom1_resid=15,
atom1_name="CA",
atom2_chain="A",
atom2_resid=1,
atom2_name="C1",
)
Pocket constraint
Use add_pocket_constraint()
to specify a binder chain and a list of contact residues:
project.add_pocket_constraint(
binder_chain="A",
contacts=[("A", "12-15"), ("A", 21)],
max_distance=6.0,
force=False,
)
contacts: List of(chain_id, resid_or_range)tuples or dicts. Ranges such as"12-15"are accepted.max_distance: Maximum contact distance in Å (4.0–20.0). Defaults to6.0.force: Whether to enforce the constraint. Defaults toFalse.
Contact constraint
Use add_contact_constraint()
to set a distance upper bound between two residues or atoms:
project.add_contact_constraint(
token1_chain="A",
token1_resid=15,
token2_chain="A",
token2_resid=1,
max_distance=6.0,
force=False,
)
Note
min_distance is not supported by the current backend and must remain None.
Also, force is only honored for the Boltz model; it is always sent as False
when model=ModelType.PROTENIX.
Step 4. Configure Boltz Options (Boltz only)
This section applies to the Boltz model only. Skip it when using Protenix.
Sampling options
Adjust inference parameters with
set_advanced_options().
Only non-None values are applied; unspecified options keep their current value:
project.set_advanced_options(
number_recycles=6,
sampling_steps=200,
diffusion_samples=5,
step_scale=1.638,
)
number_recycles: Number of recycles (1–20).sampling_steps: Number of sampling steps (10–300).diffusion_samples: Number of diffusion samples (1–5).step_scale: Diffusion step scale (1.5–2.5).
Affinity calculation
Enable binding-affinity prediction with
set_calculate_affinity().
At least one protein chain and one ligand chain must be present:
project.set_calculate_affinity(
calculate_affinity=True,
binder="A",
correct_molecular_weight=False,
sampling_steps_affinity=200,
diffusion_samples_affinity=5,
)
binder: Ligand chain ID. Set automatically when only one ligand chain is present.correct_molecular_weight: Apply molecular-weight correction.
Step 5. Submit
Once configuration is complete, submit the project with
submit_project(). Use
assert so the notebook stops immediately if submission fails:
assert project.submit_project()
A multipart request is used automatically when a file-based ligand is present.
Returns True on success.
Cancel a running job with
stop_project():
project.stop_project()
Step 6. Inspect Results
Run the following after submit_project() using the same project object:
project.get_project_step()
result = project.show_result_summary()
cif = project.get_cif()
get_project_step(): Fetches and caches the current processing stage from the backend.show_result_summary(): Alias forget_result()— returns the raw prediction result dict exactly as the backend sends it, with no summarization. Key fields:model:'boltz'or'protenix'.cif: The predicted structure, as a full CIF-format string.confidence: Dict of confidence metrics. Field names differ by model (e.g. Boltz includesconfidenceScore/chainsPtm; Protenix includeschainPlddt/chainPairIptm).pae: Predicted Aligned Error matrix (list of lists, residue x residue). Boltz only;Nonefor Protenix.pde: Predicted Distance Error matrix (list of lists). Boltz only;Nonefor Protenix.plddt: Per-residue confidence scores (flat list of numbers). Boltz only;Nonefor Protenix.affinity: Binding-affinity prediction dict, present only whencalculate_affinitywas enabled (Boltz only);Noneotherwise.
get_cif(): Returns the predicted structure as a CIF string.
Step 7. Download Outputs
Download the full project archive and the CIF file:
project.download_project()
project.download_cif()
When output_path is omitted, files are saved to the current directory as
<projectId>.tar.gz and <projectId>.cif, respectively.