haddock.modules.analysis.alascan.scan module
alascan module.
- class haddock.modules.analysis.alascan.scan.AddDeltaBFactor(model: PDBFile, path: Path, model_results: List[MutationResult])[source]
Bases:
object
Add delta score in bfactor column of a PDB.
- normalize_score(score: float) float [source]
Normalise the input score based on observed scores for this model
In case normalisation cannot be performed, returns 50.0
- Parameters:
score (float) – Input score to be normalized
- Returns:
norm100 (float) – Normalized score between 0 and 100
- class haddock.modules.analysis.alascan.scan.ClusterOutputer(cluster_scan_data: Dict[str, Dict[str, float | int]], clt_id: str, clt_population: int, scan_residue: str = 'ALA', generate_plot: bool = False, offline: bool = False)[source]
Bases:
object
Manage the generation of alascan outputs for cluster-based analysis.
- class haddock.modules.analysis.alascan.scan.InterfaceScanner(model: str | Path | Any, mutation_res: str = 'ALA', params: Dict[str, Any] | None = None, library_mode: bool = True)[source]
Bases:
object
Scan interface of a model to get tartget residues and create corresponding mutation jobs.
- class haddock.modules.analysis.alascan.scan.ModelPointMutation(model_path: Path, model_id: str, chain: str, resid: int, ori_resname: str, target_resname: str, native_scores: Tuple[float, float, float, float, float], output_mutants: bool = False)[source]
Bases:
object
Executes a single point mutation.
- class haddock.modules.analysis.alascan.scan.MutationResult(model_id: str, chain: str, resid: int, ori_resname: str, target_resname: str, mutant_scores: Tuple[float, float, float, float, float], delta_scores: Tuple[float, float, float, float, float], success: bool, error_msg: str | None = None)[source]
Bases:
object
Result from a single mutation.
- haddock.modules.analysis.alascan.scan.add_zscores(df_scan_clt, column='delta_score')[source]
Add z-scores to the dataframe.
- Parameters:
df_scan (pandas.DataFrame) – Dataframe with the scan results for the model.
colunm (str) – Column to calculate the z-score.
- Returns:
df_scan (pandas.DataFrame) – Dataframe with the z-scores added.
- haddock.modules.analysis.alascan.scan.calc_score(pdb_f, run_dir, outputpdb=False)[source]
Calculate the score of a model.
- Parameters:
pdb_f (str) – Path to the pdb file.
run_dir (str) – Path to the run directory.
outputpdb (bool, optional) – If True, the output, energy-minimized pdb file will be written. Default is False.
- Returns:
score (float) – Haddock score.
vdw (float) – Van der Waals energy.
elec (float) – Electrostatic energy.
desolv (float) – Desolvation energy.
bsa (float) – Buried surface area.
- haddock.modules.analysis.alascan.scan.get_score_string(pdb_f, run_dir, outputpdb=False)[source]
Get score output from cli_score.main.
- Parameters:
pdb_f (str) – Path to the pdb file.
run_dir (str) – Path to the run directory.
outputpdb (bool, optional) – If True, the output, energy-minimized pdb file will be written. Default is False.
- Returns:
out (list) – List of strings with the score output.
- haddock.modules.analysis.alascan.scan.group_scan_by_cluster(models: List[PDBFile], results_by_model: Dict[str, MutationResult]) Tuple[Dict[str, Dict[str, Dict[str, float | int]]], Dict[str, int]] [source]
Group models alascan data per cluster.
- Parameters:
models (List[PDBFile]) – List of input models
- Returns:
clt_scan (Dict[str, Dict[str, Dict[str, Union[float, int]]]]) – Dictionary containing alascan data for each cluster, grouped by residue identifyer.
clt_pops (Dict[str, int]) – Dictionary containing number of entries for each cluster.
- haddock.modules.analysis.alascan.scan.mutate(pdb_f, target_chain, target_resid, mut_resname)[source]
Mutate a residue in a PDB file into a different residue.
- Parameters:
pdb_f (str) – Path to the pdb file.
target_chain (str) – Chain of the residue to be mutated.
target_resid (int) – Residue number of the residue to be mutated.
mut_resname (str) – Residue name of the residue to be mutated.
- Returns:
mut_pdb_fname (str) – Path to the mutated pdb file.
- haddock.modules.analysis.alascan.scan.write_scan_out(results: List[MutationResult], model_id: str) None [source]
Save mutation results per model to tsv file.
- Parameters:
results (List[MutationResult]) – List of mutation results from scanning (comes from MutationResult)
model_id (str) – Identifier for the model used in filename.
- Returns:
None – Function saves results to file scan_{model_id}.tsv.
Notes
If results list is empty, no file is created.