molecular_simulations.analysis.fingerprinter module
- class molecular_simulations.analysis.fingerprinter.Fingerprinter(topology, trajectory=None, target_selection='segid A', binder_selection=None, out_path=None, out_name=None)
Bases:
objectCalculates interaction energy fingerprint between target and binder chains.
- Parameters:
topology (PathLike) – Path to topology file.
trajectory (OptPath) – Defaults to None. If not None, should be a path to a trajectory file or coordinates file.
target_selection (str) – Defaults to ‘segid A’. Any MDAnalysis selection string that encompasses target.
binder_selection (str | None) – Defaults to None. If None, binder is defined as anything that is not the target. Otherwise should be an MDAnalysis selection string that encompasses the binder.
out_path (OptPath) – Defaults to None. If provided will be where outputs are saved to, otherwise the topology parent path is used.
out_name (str | None) – Defaults to None. If None, output file will be called ‘fingerprint.npz’.
- Usage:
m = Fingerprinter(*args) m.run() m.save()
- assign_residue_mapping()
Map each residue index (1-based) to corresponding atom indices.
- Return type:
- Returns:
None
- calculate_fingerprints(frame_index)
Calculates fingerprints for a given frame of the trajectory.
- load_pdb()
Loads topology into MDAnalysis universe object. Can take either a PDB or an AMBER prmtop. If trajectory was not specified, will look for either inpcrd or rst7 with the same path and stem as the topology file.
- Return type:
- Returns:
None
- run()
Main logic. Obtains parameters, loads PDB and then iterates through trajectory to obtain fingerprints.
- Return type:
- Returns:
None
- molecular_simulations.analysis.fingerprinter.dist_mat(xyz1, xyz2)
- molecular_simulations.analysis.fingerprinter.electrostatic(distance, charge_i, charge_j)
Calculate electrostatic energy between two particles. Cutoff at 12 Angstrom without switching.
- molecular_simulations.analysis.fingerprinter.electrostatic_sum(distances, charge_is, charge_js)
Calculate sum of all electrostatic interactions between two sets of particles.
- Parameters:
distances (np.ndarray) – distances between particles, shape: (len(charge_is),len(charge_js))
charge_is (np.ndarray) – group i charges
charge_js (np.ndarray) – group j charges
- molecular_simulations.analysis.fingerprinter.fingerprints(xyzs, charges, sigmas, epsilons, target_resmap, binder_inds)
Calculates electrostatic fingerprint. ES energy between each target residue and all binder residues.
- Returns:
- (np.ndarray, np.ndarray),
shape=(n_target_residues, n_target_residues)
- Return type:
fingerprints
- molecular_simulations.analysis.fingerprinter.lennard_jones(distance, sigma_i, sigma_j, epsilon_i, epsilon_j)
Calculate LJ energy between two particles. Cutoff at 12 Angstrom without switching.
- Parameters:
(float) (epsilon_j)
(float)
(float)
(float)
(float)
Returns (energy (float): LJ interaction energy (kJ/mol))
- molecular_simulations.analysis.fingerprinter.lennard_jones_sum(distances, sigma_is, sigma_js, epsilon_is, epsilon_js)
Calculate sum of all LJ interactions between two sets of particles.
- Parameters:
distances (np.ndarray) – distances between particles, shape: (len(sigma_is),len(sigma_js))
sigma_is (np.ndarray) – group i sigma parameters
sigma_js (np.ndarray) – group j sigma parameters
epsilon_is (np.ndarray) – group i epsilon parameters
epsilon_js (np.ndarray) – group j epsilon parameters