AutoDock Vina
vina.vina
- class vina.vina.Vina(sf_name='vina', cpu=0, seed=0, no_refine=False, verbosity=1)
Bases:
object
- __init__(sf_name='vina', cpu=0, seed=0, no_refine=False, verbosity=1)
Initialize a Vina object.
- Parameters:
sf_name (str) – Scoring function name to use (Vina or ad4) (default: vina)
cpu (int) – Number of CPU to use (default: 0; use all of them)
seed (int) – Random seed (default: 0; ramdomly choosed)
no_refine (boolean) – when receptor is provided, do not use explicit receptor atoms (instead of precalculated grids) for: (1) local optimization and scoring after docking, (2) –local_only jobs, and (3) –score_only jobs (default: False)
verbosity (int) – verbosity 0: not output, 1: normal, 2: verbose (default: 1; some output)
- __str__()
Print basic information about Docking configuration (rigid receptor, flex receptor, ligands, scoring function, weights, no_refine, box center, box dimensions, box spacing, box even nelements, seed).
- cite()
Print citation message.
- info()
Return information about the docking configuration.
- Returns:
Dictionary of information about the docking configuration.
- Information:
rigid_receptor (str), flex_receptor (str), ligands (list), scoring_function (str), weights (tuple), no_refine (bool), box_center (list), box_size (list), box_spacing (float), box_even_elements (bool), seed (int)
- Return type:
dict (str)
- set_receptor(rigid_pdbqt_filename=None, flex_pdbqt_filename=None)
Set receptor.
- Parameters:
rigid_pdbqt_filename (str) – rigid pdbqt receptor filename (default: None)
flex_pdbqt_filename (str) – flexible residues pdbqt filename (default: None)
- set_ligand_from_file(pdbqt_filename)
Set ligand(s) from a file. The chemical file format must be PDBQT.
- Parameters:
pdbqt_filename (str or list) – Name or list of PDBQT filename(s)
- set_ligand_from_string(pdbqt_string)
Set ligand(s) from a string. The chemical file format must be PDBQT.
- Parameters:
pdbqt_string (str or list) – string or list of PDBQT strings
- set_weights(weights)
Set potential weights for vina or ad4 scoring function.
- Parameters:
weights (list) – list or weights
- compute_vina_maps(center, box_size, spacing=0.375, force_even_voxels=False)
Compute affinity maps using Vina scoring function.
- Parameters:
center (list) – center position
box_size (list) – size of the box in Angstrom
spacing (float) – grid spacing (default: 0.375)
force_even_voxels (boolean) – Force the number of voxels (NPTS/NELEMENTS) to be an even number (and forcing the number of grid points to be odd) (default: False)
- load_maps(map_prefix_filename)
Load vina or ad4 affinity maps.
- Parameters:
map_prefix_filename (str) – affinity map prefix filename
- write_maps(map_prefix_filename='receptor', gpf_filename='NULL', fld_filename='NULL', receptor_filename='NULL', overwrite=False)
Write affinity maps.
- Parameters:
map_prefix_filename (str) – affinity map pathname (path directory + prefix)
gpf_filename (str) – grid protein filename (default: NULL)
fld_filename (str) – fld filename (default: NULL)
filename (receptor) – receptor filename (default: NULL)
overwrite (bool) – allow overwriting (default: false)
- write_pose(pdbqt_filename, remarks='', overwrite=False)
Write pose (after randomize or optimize).
- Parameters:
pdbqt_filename (str) – output PDBQT filename
remarks (str) – REMARKS to add in the PDBQT filename
overwrite (bool) – allow overwriting (default: false)
- write_poses(pdbqt_filename, n_poses=9, energy_range=3.0, overwrite=False)
Write poses from docking.
- Parameters:
pdbqt_filename (str) – PDBQT file containing poses found
n_pose (int) – number of poses to write (default: 9)
energy_range (float) – maximum energy difference from best pose (default: 3.0 kcal/mol)
overwrite (bool) – allow overwriting (default: false)
- poses(n_poses=9, energy_range=3.0, coordinates_only=False)
Get poses from docking.
- Parameters:
n_pose (int) – number of poses to retrieve (default: 9)
energy_range (float) – maximum energy difference from best pose (default: 3.0 kcal/mol)
coordinates_only (bool) – return coordinates for each pose only
- Returns:
PDBQT file string or Array of coordinates of poses if coordinates_only=True
- Return type:
str/ndarray
- energies(n_poses=9, energy_range=3.0)
Get pose energies from docking.
- Parameters:
n_pose (int) – number of poses to retrieve (default: 9)
energy_range (float) – maximum energy difference from best pose (default: 3.0 kcal/mol)
- Returns:
Array of energies from each pose (rows=poses, columns=energies)
- Vina/Vinardo FF:
columns=[total, inter, intra, torsions, intra best pose]
- AutoDock FF:
columns=[total, inter, intra, torsions, -intra]
- Return type:
ndarray
- randomize(max_steps=10000)
Randomize the input ligand conformation.
- Parameters:
max_steps (int) – Number of poses to generate for selection of the best one.
- score(unbound_energy=None)
Score current pose.
- Parameters:
unbound_energy (float) – Optionally pass the unbound systems energy of the ligand.
- Returns:
Array of energies from current pose.
- Vina/Vinardo FF:
columns=[total, lig_inter, flex_inter, other_inter, flex_intra, lig_intra, torsions, lig_intra best pose]
- AutoDock FF:
columns=[total, lig_inter, flex_inter, other_inter, flex_intra, lig_intra, torsions, -lig_intra]
- Return type:
nadarray
- optimize(max_steps=0)
Quick local BFGS energy optimization.
- Parameters:
max_steps (int) – Maximum number of local minimization steps (default: 0). When max_steps is equal to 0, the maximum number of steps will be equal to (25 + num_movable_atoms) / 3).
- Returns:
Array of energies from optimized pose.
- Vina/Vinardo FF:
columns=[total, lig_inter, flex_inter, other_inter, flex_intra, lig_intra, torsions, lig_intra best pose]
- AutoDock FF:
columns=[total, lig_inter, flex_inter, other_inter, flex_intra, lig_intra, torsions, -lig_intra]
- Return type:
nadarray
- dock(exhaustiveness=8, n_poses=20, min_rmsd=1.0, max_evals=0)
Docking: global search optimization.
- Parameters:
exhaustiveness (int) – Number of MC run (default: 8)
n_poses (int) – number of pose to generate (default: 20)
min_rmsd (float) – minimum RMSD difference between poses (default: 1.0 Ansgtrom)
max_evals (int) – Maximum number of evaluation (default: 0; use heuristics rules)
vina.utils
- vina.utils.check_file_writable(fnm)
Source: https://www.novixys.com/blog/python-check-file-can-read-write/