Skip to content

Binding Affinity

Binding affinity workflow — SQM-based scoring of protein–ligand complexes.

BindingAffinityScore dataclass

BindingAffinityScore(
    binding_affinity: float, strain: float | None
)

Binding affinity score for a single pose.

Parameters:

Name Type Description Default
binding_affinity float

binding affinity in kcal/mol

required
strain float | None

strain energy in kcal/mol, or None if not computed

required

BindingAffinityResult dataclass

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

Bases: WorkflowResult

Result from a binding affinity workflow.

scores property

scores: list[BindingAffinityScore]

Binding affinity scores for each scored pose.

messages property

messages: list[Message]

Any messages or warnings from the workflow.

submit_binding_affinity_workflow

submit_binding_affinity_workflow(
    protein: Protein | ProteinUUID,
    ligand_residue_name: str | None = None,
    ligand_structures: list[StructureInput] | None = None,
    binding_affinity_settings: SinglePointEnergySettings
    | None = None,
    name: str = "Binding Affinity Workflow",
    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 a binding affinity workflow to the API.

Scores ligand poses using SQM-based energies. Two submission modes:

Mode 1 — holo protein: protein already contains the bound ligand. Pass ligand_residue_name to identify which residue is the ligand vs. the receptor. Do not pass ligand_structures.

Mode 2 — apo protein + external poses: protein has no bound ligand. Pass ligand_structures with poses that are already in the protein's coordinate frame. Do not pass ligand_residue_name. When scoring multiple ligands, prefer this mode over separate per-ligand workflows — all poses share the same pocket geometry.

Parameters:

Name Type Description Default
protein Protein | ProteinUUID

protein structure. Can be input as a UUID or a Protein object.

required
ligand_residue_name str | None

residue name identifying the ligand in a holo protein PDB (mode 1 only).

None
ligand_structures list[StructureInput] | None

external ligand poses to score, already in the protein's coordinate frame. Must have 3D coordinates (mode 2 only).

None
binding_affinity_settings SinglePointEnergySettings | None

SQM settings controlling geometry optimization and energy evaluation. Defaults to PM6-D3H4X/COSMO optimization followed by PM6-D3H4X/COSMO2 single-point in water.

None
name str

name of the workflow.

'Binding Affinity Workflow'
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 folder arguments conflict.

requests.HTTPError

if the request to the API fails.