Skip to content

run

Select fitted structures and coordinate independent refinement runs.

KnownStructure dataclass

Known partner inputs and the original chains omitted from refinement.

create_refinement_run(session_dir, refine_run_id=None)

Create an exclusive refinement directory with a safe, independent run ID.

Parameters:

Name Type Description Default
session_dir Path

Existing session directory in which to create the run.

required
refine_run_id str | None

Explicit run ID, starting with an ASCII letter or digit and containing only ASCII letters, digits, underscores, dots and hyphens. When omitted, use the next numeric ID above the existing maximum, using the refine_run_ prefix.

None

Returns:

Type Description
Path

Newly created directory under the session's refinement directory.

Raises:

Type Description
ValueError

The explicit run ID is not a safe path component.

FileExistsError

The selected run directory already exists.

refine_structure_task(fitted_model, /, *, session_dir, root_refine_dir, known_structure, options, haddock_log_level=logging.INFO)

Configure and run HADDOCK3 for one fitted model.

Parameters:

Name Type Description Default
fitted_model Path

Fitted input, absolute or relative to the session directory.

required
session_dir Path

Absolute session directory containing PowerFit results.

required
root_refine_dir Path

Directory for the independent refinement run.

required
known_structure KnownStructure

Prepared and original partner paths with omitted chain IDs.

required
options RefineOptions

Refinement parameters for HADDOCK3.

required
haddock_log_level int

Logging level of HADDOCK3 messages.

INFO

Returns:

Type Description
tuple[Path, Path]

Absolute fitted input and its directory containing both workflows.

Raises:

Type Description
FileExistsError

The model output directory already exists.

ValueError

The fitted input is outside the session's PowerFit directory.

refine_structures(*, session_dir, refine_dir, fitted_models, known_structure, options, scheduler_address, haddock_log_level=logging.INFO)

Refine selected models using the configured scheduler.

Parameters:

Name Type Description Default
session_dir Path

Absolute session directory containing PowerFit results.

required
refine_dir Path

Directory for the independent refinement run.

required
fitted_models list[Path]

Fitted inputs, absolute or relative to the session directory.

required
known_structure KnownStructure

Prepared and original partner paths with omitted chain IDs.

required
options RefineOptions

Refinement parameters for HADDOCK3.

required
scheduler_address str

Dask scheduler address, or sequential execution mode.

required
haddock_log_level int

Logging level of HADDOCK3 messages.

INFO

Returns:

Type Description
list[tuple[Path, Path]]

Absolute fitted inputs paired with their directories containing both workflows.

refine_with_haddock3(session_dir, input_known_structure, /, *, refine_options=None, remove_known_chains=None, refine_run_id=None, powerfit_run_id=None, scheduler_address=None, haddock_log_level=logging.INFO)

Refine selected fitted models against a known structure with HADDOCK3.

Store the input/output mapping before launching work and record successful results, configurations and effective options in the session's RO-Crate.

Parameters:

Name Type Description Default
session_dir Path

Session directory containing fitted PowerFit results.

required
input_known_structure Path

Known partner in the fitted models' coordinate system.

required
refine_options RefineOptions | None

HADDOCK3 parameters; defaults to the standard refinement options.

None
remove_known_chains set[str] | None

Original chain identifiers to remove before renaming remaining chains to B. Use author chain identifiers for mmCIF inputs.

None
refine_run_id str | None

Independent refinement ID; defaults to the next numeric ID above the existing maximum, using the refine_run_ prefix.

None
powerfit_run_id str | None

Source fitting run to select; defaults to all fitting runs.

None
scheduler_address str | None

Dask scheduler address, or 'sequential' to run locally without Dask. When omitted, create a local cluster.

None
haddock_log_level int

Logging level of HADDOCK3 messages. Applied inside each worker, as workers do not share the logging configuration.

INFO

Raises:

Type Description
ValueError

No models are selected, an input path or run ID is invalid, or the requested chain removal is invalid.

FileNotFoundError

A selected fitted input or known partner is missing.

FileExistsError

The refinement run directory already exists.