haddock.modules.analysis.alascan.scan module
alascan module.
- 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, res_num: 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, res_num: 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_delta_to_bfactor(pdb_f, df_scan)[source]
Add delta scores as b-factors.
- Parameters:
pdb_f (str) – Path to the pdb file.
df_scan (pandas.DataFrame) – Dataframe with the scan results for the model
- Returns:
pdb_f (str) – Path to the pdb file with the b-factors added.
- 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.alascan_cluster_analysis(models)[source]
Perform cluster analysis on the alascan data.
- Parameters:
models (list) – List of models.
path (str) – Path to the run directory.
- 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.create_alascan_plots(clt_alascan, scan_residue, offline=False)[source]
Create the alascan plots.
- haddock.modules.analysis.alascan.scan.generate_alascan_output(models, path)[source]
Generate the alascan output files.
- Parameters:
models (list) – List of models.
path (str) – Path to the run directory.
- 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.mutate(pdb_f, target_chain, target_resnum, 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_resnum (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[Any], model_id: str) None [source]
Save mutation results per model to tsv file.
- Parameters:
results (List[Any]) – 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.