Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ale94mleon committed Jul 11, 2022
1 parent 981e5c9 commit d936535
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Please refer to the `citation page <https://moldrug.readthedocs.io/en/latest/sou
:target: https://moldrug.readthedocs.io/en/latest/?badge=latest
:alt: Documentation
.. |tests| image:: https://github.com/ale94mleon/moldrug/actions/workflows/conda.yml/badge.svg
:target: https://github.com/ale94mleon/moldrug/actions/workflows/conda.yml/
:target: https://github.com/ale94mleon/moldrug/actions/workflows/tests.yml/
:alt: tests
.. |pypi-version| image:: https://img.shields.io/pypi/v/moldrug.svg
:target: https://pypi.python.org/pypi/moldrug/
Expand Down
49 changes: 31 additions & 18 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ will be procesed by Vina.
The idea
--------
The idea is simple: we want the best drug for some application. The problem is
that it is not simple as it sounds. The chemical space is enormous and the estimation
that it is not as simple as it sounds. The chemical space is enormous and the estimation
of the fitness is also a term of concern.

Here we address this problem using a GA. The inputs are:
Expand All @@ -31,27 +31,40 @@ This cycle will run for ``maxiter`` generations.
Fitness functions
-----------------

The default fitness function could be access through::
The default fitness function could be access through.

```python
from moldrug import fitness
cost = fitness.Cost
```
A molecule must present several properties to be considered a drug. Some of the must important are: be potent, reach the biological target (good ADME profile) and be real. The last obvious property could be a bottleneck for computer assisted drug design. Because we want to optimize several response variables at the same time; this `cost` function use the concept of desirability functions ([see this paper](https://www.sciencedirect.com/science/article/pii/S0169743911000797)) which optimize several response variables on the hub.
.. code-block:: python
from moldrug import fitness
cost = fitness.Cost
A molecule must present several properties to be considered a drug. Some of the must important are:
be potent, reach the biological target (good ADME profile) and be real. The last obvious property could
be a bottleneck for computer assisted drug design. Because we want to optimize several response variables
at the same time; this ``cost`` function use the concept of `desirability functions <https://www.sciencedirect.com/science/article/pii/S0169743911000797>`__
which optimize several response variables on the hub.

The following are the response variables:
1. Vina Scoring Function. [paper](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3041641/)
1. Quantitative Estimation of Drug-likeness. [paper](https://www.nature.com/articles/nchem.1243)
2. Synthetic accessibility. [paper](https://jcheminf.biomedcentral.com/articles/10.1186/1758-2946-1-8)

For each of this response variables we create their corresponded Derringer-Suich desirability functions. And them we combine them as a geometric mean:
#. `Vina Scoring Function. <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3041641/>`_
#. `Quantitative Estimation of Drug-likeness. <https://www.nature.com/articles/nchem.1243>`_
#. `Synthetic accessibility. <https://jcheminf.biomedcentral.com/articles/10.1186/1758-2946-1-8)>`_

For each of this response variables we create their corresponded Derringer-Suich desirability functions.
And them we combine them as a geometric mean:

.. math::
D = {\left[\prod_{i = 1}^{3} d_i^{w_i}\right]}^{\frac{1}{\sum_i w_i}}
$$
D = {\left[\prod_{i = 1}^{3} d_i^{w_i}\right]}^{\frac{1}{\sum_i w_i}}
$$
where $w_i$ are the weights of each variable; and $d_i$ the desirability functions. Each individual $d_i$ ranges from 0 to 1 and therefore also $D$.
Because we are looking for the minimum, the function `cost` return $ 1 - D$.
where :math:`w_i` are the weights of each variable; and :math:`d_i` the desirability functions.
Each individual :math:`d_i` ranges from 0 to 1 and therefore also :math:`D`.
Because we are looking for the minimum, the function `cost` return :math:`1 - D`.

### Multi Receptor
Could be that our receptor presents high flexibility or that we are interested in generate specific small molecules. In this case could be convenient to add more than one receptor to the cost function. In the `fitness` module the cost function `CostMultiReceptors` tries to reach this goal. For the case of flexibility, we could perform docking in an ensemble of protein structures, and just keep the lower scoring rather that included all of them in the final desirability function.
Multi Receptor
--------------
Could be that our receptor presents high flexibility or that we are interested in generate specific
small molecules. In this case could be convenient to add more than one receptor to the cost function.
In the ``fitness`` module the cost function ``CostMultiReceptors`` tries to reach this goal. For the case
of flexibility, we could perform docking in an ensemble of protein structures, and just keep the lower
scoring rather that included all of them in the final desirability function.
15 changes: 14 additions & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ Requirements:
* `CReM <https://github.com/DrrDom/crem>`_ (0.2.9+)
* `OpenBabel <https://openbabel.org/docs/dev/Installation/install.html>`_ (3.1.0+)

.. note::

If you have OpenBabel and RDKit already installed you could try with ``conda install moldrug``.
But if it is not the case or some version conflicts occurred, think about installed in a isoleated enviroment
as it will be show in brief.


It is recomendable to install through ``conda``::

$ conda create -n moldrug
$ conda activate moldrug
$ conda install -c ale94mleon -c conda-forge -c bioconda moldrug

.. warning::

Ussually pip has the lates stable version. But we are working to constantlly update the conda packege.
Future plans are deployed inside conda-forge.

Another possible way is direclly install from pip. But in this case you must have a correct installation
of OpenBabel, RDKit and autodock-vina. One posibility is::

Expand All @@ -41,4 +53,5 @@ or::
# To get the last "stable" version. This project is still in beta state.
pip install moldrug
We are currently working in a ``docker`` container.
We are currently working in a ``docker`` container. But you could use the `Docker configuration file on GitHub <https://github.com/ale94mleon/MolDrug/blob/main/Dockerfile>`__.
and ``pip install moldrug`` inside it.
7 changes: 7 additions & 0 deletions docs/tmp/packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ conda build -c conda-forge -c bioconda moldrug
```

Valid `anaconda upload` command, with correct paths, is printed in the terminal at the end of building.

## For the documentation

```bash
make html
sphinx-build -b html source/. public
```

0 comments on commit d936535

Please sign in to comment.