Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ale94mleon committed Nov 25, 2023
1 parent ef6c927 commit 774cb19
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
9 changes: 5 additions & 4 deletions docs/notebooks/how_to.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@
}
],
"source": [
"inspect.getfullargspec(utils.Local.__init__).args"
"inspect.getfullargspec(utils.Local.__init__).args\n",
"# The sam can be done for GA: inspect.getfullargspec(utils.Local.__init__).args"
]
},
{
Expand Down Expand Up @@ -195,7 +196,7 @@
" costfunc: Cost\n",
" costfunc_kwargs:\n",
" vina_executable: vina\n",
" receptor_path: /tmp/your_tmp_dir/x0161.pdbqt\n",
" receptor_pdbqt_path: /tmp/your_tmp_dir/x0161.pdbqt\n",
" boxcenter:\n",
" - 12.11\n",
" - 1.84\n",
Expand Down Expand Up @@ -236,7 +237,7 @@
"```yaml\n",
" costfunc_kwargs:\n",
" vina_executable: vina\n",
" receptor_path: /tmp/your_tmp_dir/x0161.pdbqt\n",
" receptor_pdbqt_path: /tmp/your_tmp_dir/x0161.pdbqt\n",
" boxcenter:\n",
" - 12.11\n",
" - 1.84\n",
Expand Down Expand Up @@ -576,7 +577,7 @@
"try:\n",
" whole_result = utils.decompress_pickle(os.path.join(tmp_path.name, 'custom_fitness', 'local_result.pbz2'))\n",
"except Exception as e:\n",
" print(f\"This was the problem: {e}. So we have to add to the system path the directory where CustomMolDrugFitness.py is located.\") \n",
" print(f\"This was the problem: {e}. So we have to add to the system path the directory where CustomMolDrugFitness.py is located.\")\n",
" sys.path.append(os.path.join(tmp_path.name, 'custom_fitness'))\n",
" whole_result = utils.decompress_pickle(os.path.join(tmp_path.name, 'custom_fitness', 'local_result.pbz2'))\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Summary
Input data
----------

Currently, **MolDrug** only accepts valid RDKit molecules and valid pdbqt files that
will be processed by Vina.
Currently, **MolDrug** only accepts valid RDKit molecules and a valid pdbqt file that
will be processed in case AutoDock-Vina is used.

The idea
--------
Expand Down
32 changes: 25 additions & 7 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ or:
pip install -U git+https://github.com/ale94mleon/MolDrug.git@main
There are multiple methods to obtain `AutoDock-Vina <https://vina.scripps.edu/>`_. You can use `conda <https://anaconda.org/conda-forge/vina>`_ or download the latest release from the `Vina Repository <https://github.com/ccsb-scripps/AutoDock-Vina/releases>`_.
We highly recommend using the ast release posted on method `Vina Repository <https://github.com/ccsb-scripps/AutoDock-Vina/releases>`_, which we will demonstrate here.
We highly recommend using the last release posted on `Vina Repository <https://github.com/ccsb-scripps/AutoDock-Vina/releases>`_.

.. note::



Getting last Vina
~~~~~~~~~~~~~~~~~
Getting last AutoDock-Vina
~~~~~~~~~~~~~~~~~~~~~~~~~~

AutoDock-Vina is an ongoing project, and it is advisable to stay up-to-date by regularly checking for the latest `release <https://github.com/ccsb-scripps/AutoDock-Vina/releases/>`_.
As of the creation of this documentation, the most recent version is `v1.2.5 <https://github.com/ccsb-scripps/AutoDock-Vina/releases/tag/v1.2.5>`_.
Expand Down Expand Up @@ -71,10 +74,10 @@ MacOS
Windows
^^^^^^^

Please, download form `release <https://github.com/ccsb-scripps/AutoDock-Vina/releases/>`_. Conda installation may not work.
Please, download from `release <https://github.com/ccsb-scripps/AutoDock-Vina/releases/>`_. Conda installation may not work.

Via conda
---------
^^^^^^^^^

MolDrug is also available through conda. However, the pip installation is the recommended one.

Expand All @@ -87,17 +90,32 @@ MolDrug is also available through conda. However, the pip installation is the re
.. note::
MacOS users may face some problems trying to install because of the AutoDock-Vina dependency. If that is so, please follow the pip instructions.

If some dependencies are missing, please installed through pip. Some of them could be:
If some dependencies are missing, please install them through pip. Some of them could be:

.. code-block:: bash
pip install meeko crem pyyaml scipy tqdm
Converting pdb to pdbqt
~~~~~~~~~~~~~~~~~~~~~~~

This step can be archived through `OpenBabel <https://github.com/openbabel/openbabel>`__ or through `ADFR <https://ccsb.scripps.edu/adfr/downloads/>`_. We recommend ADFR. Depending on the platform you should be able to access the program `prepare_receptor``. In my case, it lays on `/Users/klimt/ADFRsuite-1.0/bin/prepare_receptor`. Then you can convert your pdb with:

.. code-block:: bash
/Users/klimt/ADFRsuite-1.0/bin/prepare_receptor -r your_protein.pdb -o your_protein.pdbqt
Check `here <https://ccsb.scripps.edu/adfr/how-to-create-a-pdbqt-for-my-receptor/>`_ for more information.

Getting box information
~~~~~~~~~~~~~~~~~~~~~~~

To perform the docking you must provide ``boxcenter`` and ``boxsize`` to the cost functions defined in :mod:`moldrug.fitness` For that two PyMol plugins are useful: `GetBox <https://github.com/MengwuXiao/GetBox-PyMOL-Plugin/blob/master/GetBox%20Plugin.py>`_ and/or `autodock <https://github.com/ADplugin/ADplugin/blob/master/autodock.py>`_. Details of their installation and use are not discussed here, please visit their corresponding repositories for more information.

Work with a docker container
----------------------------

#. Use the `Docker configuration file on GitHub <https://github.com/ale94mleon/MolDrug/blob/main/Dockerfile>`__.
#. Vist the `MolDrug <https://hub.docker.com/r/ale94mleon/4moldrug>`__ docker container.
#. Visit the `MolDrug <https://hub.docker.com/r/ale94mleon/4moldrug>`__ docker container.

Finally ``pip install moldrug`` inside it.
14 changes: 7 additions & 7 deletions src/moldrug/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,8 @@ class GA:
The list of average cost for each generations.
"""
def __init__(self, seed_mol: Union[Chem.rdchem.Mol, Iterable[Chem.rdchem.Mol]],
costfunc: object, costfunc_kwargs: Dict, crem_db_path: str, maxiter: int, popsize: int,
beta: float = 0.001, pc: float = 1, get_similar: bool = False, mutate_crem_kwargs: Dict = None,
costfunc: object, costfunc_kwargs: Dict, crem_db_path: str, maxiter: int = 10, popsize: int = 20,
beta: float = 0.001, pc: float = 1, get_similar: bool = False, mutate_crem_kwargs: Union[None, Dict] = None,
save_pop_every_gen: int = 0, checkpoint: bool = False, deffnm: str = 'ga',
AddHs: bool = False, randomseed: Union[None, int] = None) -> None:
"""Constructor
Expand All @@ -1242,17 +1242,17 @@ def __init__(self, seed_mol: Union[Chem.rdchem.Mol, Iterable[Chem.rdchem.Mol]],
The keyword arguments of the selected cost function
crem_db_path : str
Path to the CReM data base.
maxiter : int
Maximum number of iteration (or generation).
popsize : int
Population size.
maxiter : int, optional
Maximum number of iteration (or generation), by default 10.
popsize : int, optional
Population size, by default 20.
beta : float, optional
Selection pressure, by default 0.001
pc : float, optional
Proportion of children, by default 1
get_similar : bool, optional
If True the searching will be bias to similar molecules, by default False
mutate_crem_kwargs : Dict, optional
mutate_crem_kwargs : Union[None, Dict], optional
Parameters for mutate_mol of CReM, by default {}
save_pop_every_gen : int, optional
Frequency to save the population, by default 0
Expand Down

0 comments on commit 774cb19

Please sign in to comment.