haddock.modules.analysis.rnascan.scan module
rnascan module.
- class haddock.modules.analysis.rnascan.scan.AddDeltaBFactor(model: PDBFile, path: Path, model_results: List[MutationResult])[source]
Bases:
AddDeltaBFactorAdd rnascan delta score in the b-factor column of a PDB.
- class haddock.modules.analysis.rnascan.scan.ClusterOutputer(cluster_scan_data: Dict[str, Dict[str, float | int]], clt_id: str, clt_population: int, scan_residue: str | None = None, generate_plot: bool = False, offline: bool = False, splitplot: bool = False)[source]
Bases:
ClusterOutputerManage the generation of rnascan outputs for cluster-based analysis.
- sort_columns = ['chain', 'resid', 'target_resname']
- class haddock.modules.analysis.rnascan.scan.InterfaceScanner(model: str | Path | Any, scan_bases: List[str] | None = None, params: Dict[str, Any] | None = None)[source]
Bases:
objectScan interface of a model to get target nucleotides and create corresponding mutation jobs.
- class haddock.modules.analysis.rnascan.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, ligand_param_fname: Path | str = '', ligand_top_fname: Path | str = '')[source]
Bases:
objectExecutes a single base point mutation.
- haddock.modules.analysis.rnascan.scan.get_atoms_to_keep(ori_resname: str, target_resname: str) Dict[str, str][source]
Return the atoms to preserve when mutating one base into another.
The result maps each atom name to keep (as found in the original residue) to the atom name it must be written with in the mutated residue. Backbone atoms and same-ring-type base atoms keep their name (mapped to themselves).
The ribose-phosphate backbone is always kept. In addition, when the original and target bases are of the same ring type (both purines or both pyrimidines), the base ring atoms common to that type are kept as well, so that the base orientation is preserved and CNS only rebuilds the differing substituents. For cross-type mutations (purine <-> pyrimidine) the three glycosidic-region anchor atoms are kept and renamed to their counterpart in the target ring system (pyrimidine N1/C2/C6 <-> purine N9/C4/C8), so that the base orientation is preserved and CNS rebuilds the rest of the new base.
- Parameters:
ori_resname (str) – Original (wild-type) residue name.
target_resname (str) – Target base residue name.
- Returns:
dict of str -> str – Mapping of original atom name -> atom name to write for the mutated nucleotide.
- haddock.modules.analysis.rnascan.scan.group_scan_by_cluster(models, results_by_model)[source]
Group rnascan data per cluster, keyed by mutation (base included).
- haddock.modules.analysis.rnascan.scan.mutate(pdb_f, target_chain, target_resid, mut_resname)[source]
Mutate an RNA base in a PDB file into a different base.
The ribose-phosphate backbone is always kept for the mutated nucleotide. When the original and target bases share a ring type (both purines or both pyrimidines) the common base ring atoms are kept as well to preserve the base orientation (see
get_atoms_to_keep). For cross-type mutations (purine <-> pyrimidine) the three glycosidic-region anchor atoms are kept and renamed to their counterpart in the target ring (pyrimidine N1/C2/C6 <-> purine N9/C4/C8). The remaining base atoms are dropped and rebuilt by CNS during scoring.- Parameters:
pdb_f (str) – Path to the pdb file.
target_chain (str) – Chain of the nucleotide to be mutated.
target_resid (int) – Residue number of the nucleotide to be mutated.
mut_resname (str) – Residue name of the target base (e.g.
A,C,G,U).
- Returns:
mut_pdb_fname (str) – Path to the mutated pdb file.
- haddock.modules.analysis.rnascan.scan.validate_scan_bases(scan_bases: List[str]) List[str][source]
Validate and normalise the list of target RNA bases.
Only the canonical RNA residue names (
A,C,G,U) are accepted, in a case-insensitive manner. Two-letter names prefixed withD(DA,DC,DG,DT) denote DNA residues in HADDOCK and are therefore rejected by this RNA-specific module.- Parameters:
scan_bases (list of str) – Target bases requested by the user.
- Returns:
list of str – Normalised, de-duplicated list of canonical RNA residue names, in the order first seen.
- Raises:
ConfigurationError – If
scan_basesis empty or contains an unrecognised base.