haddock
Prepare structures, configure workflows and execute HADDOCK3 refinement.
RefineOptions
dataclass
¶
Options for refining a structure with HADDOCK3.
Attributes:
| Name | Type | Description |
|---|---|---|
ncores |
PositiveInt
|
Number of CPU cores to use for a single fitted structure. Use a large number such as 9999 to use all available CPU cores. |
rigidbody_sampling |
PositiveInt
|
Number of rigidbody samples. |
top_clusters |
PositiveInt
|
Number of top clusters to keep. |
top_models |
PositiveInt
|
Number of top models to keep. |
water_refinement_sampling_factor |
PositiveInt
|
Factor for determining the number of water refinement samples. |
water_refinement_solvent |
Literal['water', 'dmso', 'none']
|
Solvent used for water refinement. |
fcc_clust_cutoff |
float
|
Minimum fraction of common contacts (FCC) to be considered in a cluster. |
generate_haddock3_config_body(run_dir, fitted_model, processed_known_structure, options)
¶
Generate the configuration body for a HADDOCK3 refinement run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_dir
|
Path
|
Path of the HADDOCK3 run directory. |
required |
fitted_model
|
Path
|
Path to the fitted model file. |
required |
processed_known_structure
|
Path
|
Path to the known structure file. |
required |
options
|
RefineOptions
|
Refinement parameters for HADDOCK3. |
required |
Returns:
| Type | Description |
|---|---|
str
|
HADDOCK3 configuration text for the refinement run. |
generate_unrefined_config_body(run_dir, complex_file, ncores)
¶
Configure the separate energy-minimized fitted-structure baseline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_dir
|
Path
|
HADDOCK3 scoring output directory. |
required |
complex_file
|
Path
|
Combined fitted and known structure file. |
required |
ncores
|
int
|
Number of CPU cores to use. |
required |
Returns:
| Type | Description |
|---|---|
str
|
HADDOCK3 configuration text for baseline scoring. |
prepare_fitted_and_known(fitted_model, processed_known_structure, output_dir)
¶
Combine fitted chain A and known chain B without transforming coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fitted_model
|
Path
|
Fitted structure containing only chain A. |
required |
processed_known_structure
|
Path
|
Prepared known structure containing only chain B. |
required |
output_dir
|
Path
|
Directory in which to write the combined structure. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to fitted-and-known.pdb. |
Raises:
| Type | Description |
|---|---|
ValueError
|
An input has multiple models or unexpected chains. |
prepare_known_structure(input_known_structure, refine_dir, out_chain='B', *, remove_known_chains=None)
¶
Prepare the known structure for refinement.
Save the original input, remove selected chains, and prepare the chain-B partner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_known_structure
|
Path
|
Path to the known structure file. |
required |
refine_dir
|
Path
|
Directory where the refined structure will be saved. |
required |
out_chain
|
str
|
The chain identifier to rename to if necessary. |
'B'
|
remove_known_chains
|
set[str] | None
|
Original chain identifiers to remove from every model before renaming. For mmCIF inputs, use author chain identifiers (auth_asym_id). |
None
|
Returns:
| Type | Description |
|---|---|
tuple[Path, Path]
|
Paths to the prepared PDB and the saved original input, respectively. |
Raises:
| Type | Description |
|---|---|
ValueError
|
A requested chain is missing or all chains would be removed. |
run_haddock3(config_file, log_level=logging.INFO)
¶
set_haddock3_log_level(log_level)
¶
Set the level of the HADDOCK3 logger and its own console handler.
HADDOCK3 logs through its own stdout handler at INFO level, so the root logger level does not apply. Propagation to the root logger is disabled to avoid printing each message twice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_level
|
int
|
Logging level, for example |
required |