Skip to content

RBFE Graph

RBFE graph workflow - build perturbation graphs for relative binding free energy calculations.

RelativeBindingFreeEnergyGraphEdge dataclass

RelativeBindingFreeEnergyGraphEdge(
    ligand_a: str,
    ligand_b: str,
    core: list[tuple[int, int]] | None = None,
    score: float | None = None,
    ddg: float | None = None,
    ddg_err: float | None = None,
    complex_dg: float | None = None,
    complex_dg_err: float | None = None,
    solvent_dg: float | None = None,
    solvent_dg_err: float | None = None,
    vacuum_dg: float | None = None,
    vacuum_dg_err: float | None = None,
    failed: bool = False,
    complex_lambda_values: list[float] | None = None,
    complex_overlap_matrix: list[list[float]] | None = None,
)

An edge in an RBFE perturbation graph.

RelativeBindingFreeEnergyGraphResult dataclass

RelativeBindingFreeEnergyGraphResult(
    workflow_data: dict[str, Any],
    workflow_type: str,
    workflow_uuid: str,
    complete: bool = True,
)

Bases: WorkflowResult

Result from an RBFE graph construction workflow.

ligands property

ligands: dict[str, Molecule]

Ligand molecules keyed by identifier.

graph property

graph: RBFEGraph | None

The constructed RBFE graph, or None if not yet computed.

edges property

edges: list[RelativeBindingFreeEnergyGraphEdge]

Graph edges. Empty list if graph is not yet built.

submit_relative_binding_free_energy_graph_workflow

submit_relative_binding_free_energy_graph_workflow(
    ligands: dict[str, StructureInput],
    mode: Literal["greedy", "star_map"] = "greedy",
    hub_compound_id: str | None = None,
    greedy_scoring: Literal[
        "best", "jaccard", "dummy_atoms"
    ] = "best",
    greedy_k_min_cut: int = 3,
    refine_cutoff: float | None = None,
    seed_graph: RBFEGraph | None = None,
    generate_intermediate_ligands: bool = False,
    intermediate_max_dummy_atoms: int = 25,
    intermediate_min_dummy_atom_improvement: int = 5,
    name: str = "RBFE Graph",
    folder_uuid: str | None = None,
    folder: Folder | None = None,
    max_credits: int | None = None,
    webhook_url: str | None = None,
    is_draft: bool = False,
) -> Workflow

Submits an RBFE graph construction workflow to the API.

Builds a perturbation graph connecting ligands for relative binding free energy (RBFE) calculations.

Parameters:

Name Type Description Default
ligands dict[str, StructureInput]

Dictionary mapping ligand identifiers to molecules.

required
mode Literal['greedy', 'star_map']

Graph construction strategy: "greedy" or "star_map".

'greedy'
hub_compound_id str | None

Ligand identifier for the hub when mode="star_map".

None
greedy_scoring Literal['best', 'jaccard', 'dummy_atoms']

Edge scoring heuristic for greedy mode: "best", "jaccard", or "dummy_atoms".

'best'
greedy_k_min_cut int

Target edge-connectivity for greedy augmentation. Must be > 0.

3
refine_cutoff float | None

Optional MCS similarity cutoff for graph refinement.

None
seed_graph RBFEGraph | None

RBFE graph from a prior run to extend, as returned by a completed result's graph. Its existing edges (and any computed results) are preserved, and only edges for newly added ligands are built.

None
generate_intermediate_ligands bool

Generate virtual intermediate ligands to make difficult edges easier.

False
intermediate_max_dummy_atoms int

An edge with more dummy atoms than this is split when a generated intermediate brings both resulting legs back to at most this value.

25
intermediate_min_dummy_atom_improvement int

Minimum reduction in the worst leg's dummy-atom count required for a generated intermediate to be accepted.

5
name str

Name of the workflow.

'RBFE Graph'
folder_uuid str | None

UUID of the folder to place the workflow in.

None
folder Folder | None

Folder object to store the workflow in.

None
max_credits int | None

Maximum number of credits to use for the workflow.

None
webhook_url str | None

URL that Rowan will POST to when the workflow completes.

None
is_draft bool

If True, submit the workflow as a draft without starting execution.

False

Returns:

Type Description
Workflow

Workflow object representing the submitted workflow.

Raises:

Type Description
ValueError

If both folder and folder_uuid are provided, if any ligand has no defined charge, or if the ligands do not all share the same formal charge.

requests.HTTPError

if the request to the API fails.