haddock.modules.analysis.rnascan.rnascan module

rnascan module.

class haddock.modules.analysis.rnascan.rnascan.AddDeltaBFactor(model: PDBFile, path: Path, model_results: List[MutationResult])[source]

Bases: AddDeltaBFactor

Add rnascan delta score in the b-factor column of a PDB.

module_name: str = 'rnascan'

filename suffix / module identifier; overridden by subclasses

class haddock.modules.analysis.rnascan.rnascan.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: ClusterOutputer

Manage the generation of rnascan outputs for cluster-based analysis.

default_scan_residue: str = 'RNA base'
module_name: str = 'rnascan'
plot_xaxis_title: str = 'Mutation'

x-axis label of the cluster plot; mutational scans override it

sort_columns = ['chain', 'resid', 'target_resname']
zscore_reference: str = 'mutations'
class haddock.modules.analysis.rnascan.rnascan.InterfaceScanner(model: str | Path | Any, scan_bases: List[str] | None = None, params: Dict[str, Any] | None = None)[source]

Bases: BaseInterfaceScanner

Scan interface of a model to get target nucleotides and create corresponding mutation jobs.

run()[source]

Get interface nucleotides and create the mutation jobs for this model.

The jobs are returned (not executed): the caller hands them to a haddock Engine so that all mutations are scheduled together.

Returns:

List[ModelPointMutation] – The mutation jobs to perform for this model.

class haddock.modules.analysis.rnascan.rnascan.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: ModelPointMutation

Execute a single rnascan (RNA base) point mutation.

Shares its scoring flow with haddock.libs.libscan.ModelPointMutation and only forwards this module’s mutate/calc_score (which stay patchable in the module namespace).

run()[source]

Execute the point mutation.

haddock.modules.analysis.rnascan.rnascan.get_atoms_to_keep(ori_resname: str, target_resname: str) → Dict[str, str][source]

Return the atoms to preserve when mutating one RNA base into another.

Thin wrapper around haddock.libs.libscan.get_atoms_to_keep() bound to this module’s ribose-phosphate backbone and RNA ring-type classification.

haddock.modules.analysis.rnascan.rnascan.group_scan_by_cluster(models, results_by_model)[source]

Group rnascan data per cluster, keyed by mutation (base included).

haddock.modules.analysis.rnascan.rnascan.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.rnascan.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 with D (DA, DC, DG, DT) denote DNA residues in HADDOCK and are therefore rejected by this RNA-specific module.

Thin wrapper around haddock.libs.libscan.validate_scan_bases().

haddock.modules.analysis.rnascan.rnascan.write_scan_out(results, model_id)[source]

Save rnascan mutation results for one model to a tsv file.