haddock.modules.analysis.seletopclusts.seletopclusts module
Set of functions related to the selection of top clusters.
- haddock.modules.analysis.seletopclusts.seletopclusts.map_clusters_models(models: list[PDBFile]) dict[int, list[PDBFile]] [source]
Group models by clusters.
- Parameters:
models (list[PDBFile]) – List of PDBfiles models to be grouped.
- Returns:
by_clusters (dict[int, list[PDBFile]]) – _description_
- haddock.modules.analysis.seletopclusts.seletopclusts.rank_clust_order(by_clusters: dict[int, list[PDBFile]]) list[int] [source]
Select best clusters based on structures scores.
- Parameters:
models_to_select (list[PDBFile]) – List of input models on which selection must be performed.
top_clusters (int) – Number of best clusters to take into account.
top_models (int) – Number of best models in each cluster to take into account.
- Returns:
models_to_export (list[PDBFile]) – List of PDBfiles to export.
notes (list[str]) – List of notes to be printed.
- haddock.modules.analysis.seletopclusts.seletopclusts.select_top_clusts_models(sortby: str, models_to_select: list[PDBFile], top_clusters: int, top_models: int | float) tuple[list[PDBFile], list[str]] [source]
Select best clusters based on structures scores.
- Parameters:
sortby (str) – How to order clusters: by score or by size.
models_to_select (list[PDBFile]) – List of input models on which selection must be performed.
top_clusters (int) – Number of best clusters to take into account.
top_models (int) – Number of best models in each cluster to take into account.
- Returns:
models_to_export (list[PDBFile]) – List of PDBfiles to export.
notes (list[str]) – List of notes to be printed.
- haddock.modules.analysis.seletopclusts.seletopclusts.size_clust_order(by_clusters: dict[int, list[PDBFile]]) list[int] [source]
Select best clusters based on structures scores.
- Parameters:
models_to_select (list[PDBFile]) – List of input models on which selection must be performed.
top_clusters (int) – Number of best clusters to take into account.
top_models (int) – Number of best models in each cluster to take into account.
- Returns:
models_to_export (list[PDBFile]) – List of PDBfiles to export.
notes (list[str]) – List of notes to be printed.
- haddock.modules.analysis.seletopclusts.seletopclusts.sort_models(models: list[PDBFile]) tuple[list[PDBFile], None | str] [source]
Sort models based on their rank in cluster.
- Parameters:
models (list[PDBFile]) – List of input models on which ordering must be performed.
- Returns:
sorted_mdls (list[PDBFile]) – List of sorted models.
- haddock.modules.analysis.seletopclusts.seletopclusts.write_selected_models(output_path: str | Path, models: list[PDBFile], module_path: str | Path) list[PDBFile] [source]
Dump selected models and new names in a file.
- Parameters:
output_path (Union[str, Path]) – Name of tne file to create.
models (list[PDBFile]) – List of PDBfiles of selected models.
module_path (Union[str, Path]) – Path of the module.
- Returns:
models (list[PDBFile]) – Updated list of selected models.