Skip to content

powerfit

Rescore fitted and refined candidates at their supplied coordinates.

PowerfitScore

Bases: NamedTuple

Fixed-coordinate PowerFit scores in CSV column order.

RefinementScore

Bases: NamedTuple

A refined member's model ID and paired PowerFit scores.

rescore_refinement(session_dir, fitted_model, refine_run_dir)

Write before/after PowerFit scores for every reconstructed refinement member.

Score the fitted input once and each refined candidate at its saved atomic coordinates, reusing the source map, resolution and scoring options recorded in the session's RO-Crate. Fixed-coordinate scores can differ from the original PowerFit search scores because density and masks are rebuilt.

Read model IDs and refined candidate paths from refinement/9_reconstruct/io.csv under refine_run_dir. Candidate paths are relative to the refinement workflow. Write one CSV row per member, repeating the input's before scores alongside that member's after scores. Each stage includes CC, Fisher z and relative z. Write the output only after all structures have been scored successfully.

Parameters:

Name Type Description Default
session_dir Path

Absolute session directory containing PowerFit results and RO-Crate metadata.

required
fitted_model Path

Absolute fitted input path under session_dir/powerfit/.

required
refine_run_dir Path

Model run directory containing the completed refinement workflow.

required

Returns:

Type Description
Path

Path to powerfit-recscores.csv in refine_run_dir. An existing file is overwritten.

Raises:

Type Description
ValueError

The fitted input is outside the PowerFit directory, required provenance is missing, recorded arguments cannot be read, or a pose has zero density variance inside its scoring mask.

FileNotFoundError

The source map, fitted input, reconstruction index or a refined candidate is missing.