From d3ed1d85d59020d86493dc75ffd03ebd0d4834f2 Mon Sep 17 00:00:00 2001 From: "UENO, M." Date: Fri, 23 Feb 2024 00:06:23 +0900 Subject: [PATCH] Fix a docstring to include `vinardo` for `sf_name` --- build/python/vina/vina.py | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/build/python/vina/vina.py b/build/python/vina/vina.py index b9dce8af..62f20390 100644 --- a/build/python/vina/vina.py +++ b/build/python/vina/vina.py @@ -20,7 +20,7 @@ def __init__(self, sf_name='vina', cpu=0, seed=0, no_refine=False, verbosity=1): """Initialize a Vina object. Args: - sf_name (str): Scoring function name to use (Vina or ad4) (default: vina) + sf_name (str): Scoring function name to use (vina, vinardo 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 @@ -34,7 +34,7 @@ def __init__(self, sf_name='vina', cpu=0, seed=0, no_refine=False, verbosity=1): raise ValueError('Error: Scoring function %s not recognized. (only vina, vinardo or ad4)' % sf_name) self._vina = _Vina(sf_name, cpu, seed, verbosity, no_refine) - + self._sf_name = sf_name if sf_name == 'vina': self._weights = (-0.035579, -0.005156, 0.840245, -0.035069, -0.587439, 50, 0.05846) @@ -56,10 +56,10 @@ def __init__(self, sf_name='vina', cpu=0, seed=0, no_refine=False, verbosity=1): self._seed = self._vina.seed() def __str__(self): - """Print basic information about Docking configuration (rigid receptor, flex receptor, - ligands, scoring function, weights, no_refine, box center, box dimensions, + """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). - + """ info = "Receptor (rigid): %s\n" % self._rigid_receptor info += "Receptor (flex): %s\n" % self._flex_receptor @@ -82,17 +82,17 @@ def __str__(self): info += "Seed: %s" % self._seed return info - + def cite(self): """Print citation message.""" self._vina.cite() def info(self): """Return information about the docking configuration. - + Returns: dict (str): Dictionary of information about the docking configuration. - + Information: rigid_receptor (str), flex_receptor (str), @@ -105,7 +105,7 @@ def info(self): box_spacing (float), box_even_elements (bool), seed (int) - + """ info = {} @@ -120,7 +120,7 @@ def info(self): info['box_spacing'] = self._spacing info['box_even_elements'] = self._even_nelements info['seed'] = self._seed - + return info def set_receptor(self, rigid_pdbqt_filename=None, flex_pdbqt_filename=None): @@ -184,7 +184,7 @@ def set_ligand_from_file(self, pdbqt_filename): self._vina.set_ligand_from_file(pdbqt_filename) self._ligands = pdbqt_filename - + def set_ligand_from_string(self, pdbqt_string): """Set ligand(s) from a string. The chemical file format must be PDBQT. @@ -194,7 +194,7 @@ def set_ligand_from_string(self, pdbqt_string): """ if not isinstance(pdbqt_string, (list, tuple)): pdbqt_string = [pdbqt_string] - + for ps in pdbqt_string: if not isinstance(ps, str): raise TypeError('Error: %s is not a string.' % ps) @@ -276,7 +276,7 @@ def load_maps(self, map_prefix_filename): raise RuntimeError('Error: Cannot find affinity maps with %s' % map_prefix_filename) self._vina.load_maps(map_prefix_filename) - + def write_maps(self, map_prefix_filename='receptor', gpf_filename='NULL', fld_filename='NULL', receptor_filename='NULL', overwrite=False): """Write affinity maps. @@ -302,7 +302,7 @@ def write_maps(self, map_prefix_filename='receptor', gpf_filename='NULL', raise RuntimeError(error_msg) self._vina.write_maps(map_prefix_filename, gpf_filename, fld_filename, receptor_filename) - + def write_pose(self, pdbqt_filename, remarks='', overwrite=False): """Write pose (after randomize or optimize). @@ -319,7 +319,7 @@ def write_pose(self, pdbqt_filename, remarks='', overwrite=False): raise RuntimeError('Error: Cannot overwrite %s, already exists.' % pdbqt_filename) self._vina.write_pose(pdbqt_filename, remarks) - + def write_poses(self, pdbqt_filename, n_poses=9, energy_range=3.0, overwrite=False): """Write poses from docking. @@ -344,7 +344,7 @@ def write_poses(self, pdbqt_filename, n_poses=9, energy_range=3.0, overwrite=Fal raise ValueError('Error: energy range must be greater than zero.') self._vina.write_poses(pdbqt_filename, n_poses, energy_range) - + def poses(self, n_poses=9, energy_range=3.0, coordinates_only=False): """Get poses from docking. @@ -361,7 +361,7 @@ def poses(self, n_poses=9, energy_range=3.0, coordinates_only=False): raise ValueError('Error: number of poses written must be greater than zero.') elif energy_range <= 0: raise ValueError('Error: energy range must be greater than zero.') - + if coordinates_only: # Dirty hack to get the coordinates from C++, it is not advised to have vector>> coordinates = np.array(self._vina.get_poses_coordinates(n_poses, energy_range)) @@ -370,20 +370,20 @@ def poses(self, n_poses=9, energy_range=3.0, coordinates_only=False): return coordinates else: return self._vina.get_poses(n_poses, energy_range) - + def energies(self, n_poses=9, energy_range=3.0): """Get pose energies from docking. Args: 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: - ndarray: Array of energies from each pose (rows=poses, columns=energies) - + ndarray: 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] @@ -403,7 +403,7 @@ def randomize(self, max_steps=10000): """ self._vina.randomize(max_steps) - + def score(self, unbound_energy=None): """Score current pose. @@ -415,7 +415,7 @@ def score(self, unbound_energy=None): 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] @@ -440,7 +440,7 @@ def optimize(self, max_steps=0): 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]