mrl-pypi


Namemrl-pypi JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/DarkMatterAI/mrl/tree/main/
SummaryMolecular reinforcement learning
upload_time2023-03-22 03:19:19
maintainer
docs_urlNone
authorKarl Heyer
requires_python>=3.7
licenseMIT License
keywords machine learning cheminformatics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Molecular Reinforcement Learning
> Unlocking reinforcement learning for drug design


MRL is an open source python library designed to unlock the potential of drug design with reinforcement learning. 

MRL bridges the gap between generative models and practical drug discovery by enabling fine-tuned control over chemical spaces. Control what structures are generated and where they occur.

MRL is suitable for all stages of drug discovery, from high diversity hit expansion screens to hyper-focused lead optimization

<img src="nbs/files/mols.png" width="800" alt="rgroup optimization" style="max-width: 800px">

## Use Cases

MRL can be applied to:
- [Small molecules](https://darkmatterai.github.io/mrl/tutorials.html#Small-Molecules)
- [Proteins](https://darkmatterai.github.io/mrl/tutorials.html#Proteins)
- [Polymers](https://darkmatterai.github.io/mrl/tutorials.html#Polymers)
- [DNA](https://darkmatterai.github.io/mrl/tutorials.html#DNA)

View our [tutorials](https://darkmatterai.github.io/mrl/tutorials.html) for more examples

## Install

### Without Installing

MRL can be used without installing via [Google Collab](https://colab.research.google.com/notebooks/intro.ipynb). Open any page in the [documentation](https://darkmatterai.github.io/mrl/) and click the "Open in Collab" button to open the notebook in Google Collab. Make sure to change the runtime to GPU.

### Anaconda

MRL is available via Anaconda.

```
conda create -n mrl python=3.7
conda install -c dmai -c rdkit -c pytorch -c fastai -c conda-forge mrl
pip install selfies>=2.0.0
```

### PyPi

MRL is available via pypi. First [install pytorch](https://pytorch.org/get-started/locally/). Then run the following:

```
pip install mrl-pypi
```

### Developer Install 

If you plan to develop the library or want the most up to date release, use an editable install. First [install pytorch](https://pytorch.org/get-started/locally/). Then run the following:

```
git clone https://github.com/DarkMatterAI/mrl
pip install -e .
```

## How to use

Here's an example of using a MRL pre-trained model to generate compounds based on the [ChEMBL](https://www.ebi.ac.uk/chembl/) library:

```python
from mrl.model_zoo import LSTM_LM_Small_Chembl

agent = LSTM_LM_Small_Chembl()

preds, log_probs = agent.model.sample_no_grad(512, 90)
smiles = agent.reconstruct(preds)

smiles[:10]
>['COC(=O)C1=C(Nc2ccc(Br)cc2)SCC1=O',
 'Cc1nnc2n1CN(C(C)=O)CC2c1ccc2c(c1)OCO2',
 'COc1ccc(C(=O)NNc2c(C#N)cnn2-c2ccccc2)c(OC)c1',
 'COC(=O)C1(C)C=C(N2CC2)C(=O)C(C(C)=O)=C1',
 'CC(O)(c1cccc(Cl)c1)c1nc(-c2cccc(-n3cncn3)c2)co1',
 'Clc1cccc2ccc(-n3c(-c4ccccc4)nc4ccccc4c3=O)nc12',
 'Cc1cccc(NC(=O)CSc2nnnn2-c2ccc3c(c2)OCCO3)c1',
 'Nc1n[nH]c(=O)c2cc(NCc3ccc(C(=O)O)c(Cl)c3)ccc12',
 'CCOc1ccc(NC(=O)c2oc3ccccc3c2NC(=O)c2ccccc2OC)cc1',
 'Cc1ccc2c(N3CCN(CC(=O)Nc4ccc(N5CCCCC5=O)cc4)CC3)cccc2n1']
```

## Getting Started

See the MRL [documentation page](https://darkmatterai.github.io/mrl/) for full documentaion

See the MRL [tutorials page](https://darkmatterai.github.io/mrl/tutorials.html) for examples

## Contributing

MRL uses [nbdev](https://github.com/fastai/nbdev) for development. This allows us to build code, tests and documentation at the same time.

To contribute, install [nbdev](https://github.com/fastai/nbdev). Then run `nbdev_install_git_hooks` in your terminal. This sets up git hooks, which clean up the notebooks to remove the extraneous stuff stored in the notebooks which causes unnecessary merge conflicts.

If you make changes to a notebook, run `nbdev_build_lib` to update the library.

If you make changes to the library, run `nbdev_update_lib` to update the notebooks.

Submit PRs to the `dev` branch.

Before submitting a PR, run `nbdev_diff_nbs` to verify the notebooks and the library match.

## Acknowledgements

MRl is built using many open source libraries. We would especially like to thank the development teams behind [Pytorch](https://github.com/pytorch/pytorch), [RDKit](https://github.com/rdkit/rdkit) and [fastai](https://github.com/fastai)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DarkMatterAI/mrl/tree/main/",
    "name": "mrl-pypi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "machine learning,cheminformatics",
    "author": "Karl Heyer",
    "author_email": "karl@darkmatterai.co",
    "download_url": "https://files.pythonhosted.org/packages/cb/97/7d38df95b8afa4b3516175063b33358aa79483cd1c4c0b58f8e6849a12e6/mrl-pypi-0.1.5.tar.gz",
    "platform": null,
    "description": "# Molecular Reinforcement Learning\n> Unlocking reinforcement learning for drug design\n\n\nMRL is an open source python library designed to unlock the potential of drug design with reinforcement learning. \n\nMRL bridges the gap between generative models and practical drug discovery by enabling fine-tuned control over chemical spaces. Control what structures are generated and where they occur.\n\nMRL is suitable for all stages of drug discovery, from high diversity hit expansion screens to hyper-focused lead optimization\n\n<img src=\"nbs/files/mols.png\" width=\"800\" alt=\"rgroup optimization\" style=\"max-width: 800px\">\n\n## Use Cases\n\nMRL can be applied to:\n- [Small molecules](https://darkmatterai.github.io/mrl/tutorials.html#Small-Molecules)\n- [Proteins](https://darkmatterai.github.io/mrl/tutorials.html#Proteins)\n- [Polymers](https://darkmatterai.github.io/mrl/tutorials.html#Polymers)\n- [DNA](https://darkmatterai.github.io/mrl/tutorials.html#DNA)\n\nView our [tutorials](https://darkmatterai.github.io/mrl/tutorials.html) for more examples\n\n## Install\n\n### Without Installing\n\nMRL can be used without installing via [Google Collab](https://colab.research.google.com/notebooks/intro.ipynb). Open any page in the [documentation](https://darkmatterai.github.io/mrl/) and click the \"Open in Collab\" button to open the notebook in Google Collab. Make sure to change the runtime to GPU.\n\n### Anaconda\n\nMRL is available via Anaconda.\n\n```\nconda create -n mrl python=3.7\nconda install -c dmai -c rdkit -c pytorch -c fastai -c conda-forge mrl\npip install selfies>=2.0.0\n```\n\n### PyPi\n\nMRL is available via pypi. First [install pytorch](https://pytorch.org/get-started/locally/). Then run the following:\n\n```\npip install mrl-pypi\n```\n\n### Developer Install \n\nIf you plan to develop the library or want the most up to date release, use an editable install. First [install pytorch](https://pytorch.org/get-started/locally/). Then run the following:\n\n```\ngit clone https://github.com/DarkMatterAI/mrl\npip install -e .\n```\n\n## How to use\n\nHere's an example of using a MRL pre-trained model to generate compounds based on the [ChEMBL](https://www.ebi.ac.uk/chembl/) library:\n\n```python\nfrom mrl.model_zoo import LSTM_LM_Small_Chembl\n\nagent = LSTM_LM_Small_Chembl()\n\npreds, log_probs = agent.model.sample_no_grad(512, 90)\nsmiles = agent.reconstruct(preds)\n\nsmiles[:10]\n>['COC(=O)C1=C(Nc2ccc(Br)cc2)SCC1=O',\n 'Cc1nnc2n1CN(C(C)=O)CC2c1ccc2c(c1)OCO2',\n 'COc1ccc(C(=O)NNc2c(C#N)cnn2-c2ccccc2)c(OC)c1',\n 'COC(=O)C1(C)C=C(N2CC2)C(=O)C(C(C)=O)=C1',\n 'CC(O)(c1cccc(Cl)c1)c1nc(-c2cccc(-n3cncn3)c2)co1',\n 'Clc1cccc2ccc(-n3c(-c4ccccc4)nc4ccccc4c3=O)nc12',\n 'Cc1cccc(NC(=O)CSc2nnnn2-c2ccc3c(c2)OCCO3)c1',\n 'Nc1n[nH]c(=O)c2cc(NCc3ccc(C(=O)O)c(Cl)c3)ccc12',\n 'CCOc1ccc(NC(=O)c2oc3ccccc3c2NC(=O)c2ccccc2OC)cc1',\n 'Cc1ccc2c(N3CCN(CC(=O)Nc4ccc(N5CCCCC5=O)cc4)CC3)cccc2n1']\n```\n\n## Getting Started\n\nSee the MRL [documentation page](https://darkmatterai.github.io/mrl/) for full documentaion\n\nSee the MRL [tutorials page](https://darkmatterai.github.io/mrl/tutorials.html) for examples\n\n## Contributing\n\nMRL uses [nbdev](https://github.com/fastai/nbdev) for development. This allows us to build code, tests and documentation at the same time.\n\nTo contribute, install [nbdev](https://github.com/fastai/nbdev). Then run `nbdev_install_git_hooks` in your terminal. This sets up git hooks, which clean up the notebooks to remove the extraneous stuff stored in the notebooks which causes unnecessary merge conflicts.\n\nIf you make changes to a notebook, run `nbdev_build_lib` to update the library.\n\nIf you make changes to the library, run `nbdev_update_lib` to update the notebooks.\n\nSubmit PRs to the `dev` branch.\n\nBefore submitting a PR, run `nbdev_diff_nbs` to verify the notebooks and the library match.\n\n## Acknowledgements\n\nMRl is built using many open source libraries. We would especially like to thank the development teams behind [Pytorch](https://github.com/pytorch/pytorch), [RDKit](https://github.com/rdkit/rdkit) and [fastai](https://github.com/fastai)\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Molecular reinforcement learning",
    "version": "0.1.5",
    "split_keywords": [
        "machine learning",
        "cheminformatics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab355be997ae89abd12179ea88d52807958afc6b0a8f0474386ff8d769b7070e",
                "md5": "0610dce0e0ed31c893a84c03844af1b7",
                "sha256": "ac326d302704c664b3ade19dc03240ae80b06eba72ab2e4cfcbd00b1d7478397"
            },
            "downloads": -1,
            "filename": "mrl_pypi-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0610dce0e0ed31c893a84c03844af1b7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 109901,
            "upload_time": "2023-03-22T03:19:17",
            "upload_time_iso_8601": "2023-03-22T03:19:17.536800Z",
            "url": "https://files.pythonhosted.org/packages/ab/35/5be997ae89abd12179ea88d52807958afc6b0a8f0474386ff8d769b7070e/mrl_pypi-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb977d38df95b8afa4b3516175063b33358aa79483cd1c4c0b58f8e6849a12e6",
                "md5": "a6b21c032fe138e2c2d39f8f62b34104",
                "sha256": "5f45575f3e48bc197413c19c65c695b7acb5c36a733d8f090d354ebe37732538"
            },
            "downloads": -1,
            "filename": "mrl-pypi-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "a6b21c032fe138e2c2d39f8f62b34104",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 97531,
            "upload_time": "2023-03-22T03:19:19",
            "upload_time_iso_8601": "2023-03-22T03:19:19.819834Z",
            "url": "https://files.pythonhosted.org/packages/cb/97/7d38df95b8afa4b3516175063b33358aa79483cd1c4c0b58f8e6849a12e6/mrl-pypi-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-22 03:19:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "mrl-pypi"
}
        
Elapsed time: 0.04663s