Scoring Modules

Subpackages

Module contents

HADDOCK3 modules to score models.

class haddock.modules.scoring.CNSScoringModule(order: int, path: Path, initial_params: str | Path, cns_script: str | Path)[source]

Bases: BaseCNSModule, ScoringModule

Parent class for CNS Scoring modules.

static build_interface_sets_combinations(interface_combinations: list[str]) list[str][source]

Build desired combinatation of interfaces.

Parameters:

interface_combinations (list[str] | None) – Input list of chains to be considered. Each list entry must be composed of two chains separated by coma. e.g.: [] -> Consider all non-redundant chain pairs [“A,H”, “A,L”] -> Consider only the interface scores between A,H and A,L

Returns:

combinations (list[str]) – Unpacked list of interface combinations to consider. [“A,H”, “A,L”] -> [“A_H”, “A_L”]

static compute_interfaces_score(interface_energies: dict[str, dict[str, float]], interface_sets_combinations: list[str]) float | None[source]

Compute the sum of selected interface haddock score.

Parameters:
  • interfaces_scores (dict[str, dict[str, float]]) – Scores of the various interfaces present in the pdb.

  • interface_sets_combinations (list[str]) – List of interface combinations to consider

extract_interface_combinations() list[str][source]

Read interface specific parameters.

Removes the interface_combinations from the parameters as not supported by CNS. Sets the per_interface_scoring to True if interface_combinations is not empty, as it is required for the interface-scores to be present in the PDB file.

Returns:

interface_combinations (list[str]) – List of user-defined combinations.

per_interface_output(output_fname: str | Path, models: list[HaddockModel], sep: str = '\t', ascending_sort: bool = True) None[source]

Generate per interface scoring tsv output files.

Parameters:
  • output_fname (FilePath) – Path to the file where to write scoring data.

  • models (list[HaddockModel]) – List of HaddockModel object obtained by loading the PDB files.

  • sep (str, optional) – Character used as separator in file, by default “t”

  • ascending_sort (bool, optional) – Should the data be sorted in ascending order, by default True

update_pdb_scores(interface_combinations: list[str]) tuple[list[HaddockModel], dict[str, list[str]]][source]

Update the score attributes in the output pdb files.

Parameters:

interface_combinations (list[str]) – Input list of chains to be considered. Each list entry must be composed of two chains separated by coma. e.g.: [] -> Consider all non-redundant chain pairs [“A,H”, “A,L”] -> Consider only the interface scores between A,H and A,L

Returns:

output_haddock_models (list[HaddockModel]) – List of HaddockModel for each input pdb, that contain the actual scores loaded from the file.

class haddock.modules.scoring.ScoringModule(order: int, path: Path, params_fname: str | Path)[source]

Bases: BaseHaddockModule

Parent class for Scoring modules.

output(output_fname: str | Path, sep: str = '\t', ascending_sort: bool = True) None[source]

Save the output in comprehensive tables.

Parameters:
  • output_fname (FilePath) – Path to the file where to write scoring data.

  • sep (str, optional) – Character used as separator in file, by default “t”

  • ascending_sort (bool, optional) – Should the data be sorted in ascending order, by default True