# Generalised Read-Across (GenRA) in Python
[Read-Across](https://www.oecd.org/env/ehs/risk-assessment/groupingofchemicalschemicalcategoriesandread-across.htm) is widely used to fill data-gaps for untested chemicals. We developed [Genralised Read-Across (GenRA)](https://doi.org/10.1016/j.yrtph.2019.104480) as a computational toxicology tool to mimic a human expert’s manual reasoning based on similarity-weighted activity. This repository contains a Python 3 implementation for GenRA, called genra-py, which is based on the [scikit-learn](https://scikit-learn.org) [estimator](https://scikit-learn.org/stable/modules/generated/sklearn.base.BaseEstimator.html?highlight=estimator#sklearn.base.BaseEstimator). We also describe two potential uses-cases for genra-py that uses published chemical structure, bioactivity and toxicity data.
![](figs/genra-viz.jpg)
# Easy starts
`pip install genra`
or try our Docker image from on dockerhub at [https://hub.docker.com/r/patlewig/genra-py]
The image contains the scipy Jupyter notebook, RDKit and a pip installable version of genra-py (https://github.com/i-shah/genra-py/).
In a terminal type:
`docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes --user $(id -u):$(id -g) --group-add users -v "$PWD":/home/jovyan patlewig/genra-py`
Copy/paste the resulting url link into a new browser window. This should start the Jupyter lab session from your current working directory.
To avoid typing the long argument in the terminal, using docker-compose is an alternative means of running the container.
Type `docker-compose -f genra-docker-compose.yml up`
To stop the container simply type:
`docker-compose -f genra-docker-compose.yml down`
# Alternatives
Running the notebooks in this repository requires Python 3, [Anaconda](https://www.anaconda.com/), [Jupter](https://jupyter.org/) and some additional configuration.
1. Install Python 3, anaconda/conda and Jupyter Lab
2. Clone this repo: \
`git clone https://github.com/i-shah/genra-py.git`
3. Go into genra-py directory and create *genra-py* conda environment: \
`make -n create_environment`
4. Activate conda environment:\
`conda activate genra-py`
5. Add this conda environment as a kernel to jupyter-lab: \
`ipython kernel install --user --name=genra-py`
6. Copy the notebooks/dotenv file to notebooks/.env and edit the environemnt variables (replace path_to_top with the correct directory name):\
`TOP=path_to_top/genra-py
SRC=path_to_top/genra-py/src
DAT=path_to_top/genra-py/data
FIG=path_to_top/genra-py/figs
`
Further details are provided in the notebooks/manual directory.
See https://github.com/patlewig/UNC_Rax and run the example using the Binder https://mybinder.org/
# Project Organization
├── LICENSE
├── Makefile <- Makefile with commands like `make data` or `make train`
├── README.md <- The top-level README for developers using this project.
├── data <- Data from public domain sources.
│ └─ shah-2016 <- Data from https://doi.org/10.1016/j.yrtph.2016.05.008
│ └─ helman-2019 <- Data from https://doi.org/10.1016/j.yrtph.2016.05.008
|
├── notebooks <- Jupyter notebooks
| |
| ├─dotenv <- copy this to ".env" and edit this file
| ├─app-note <- use-cases described in manuscript
| └─manual <- user-manual as a jupyter notebook
│
├── requirements.txt <- The requirements file for reproducing the analysis environment, e.g.
│ generated with `pip freeze > requirements.txt`
├── genra-py.yml <- The spec for creating a conda environment.
| conda env create -f condaenv.yml
├── dist <- Source and Wheel Distributions
|
└── genra <- Source code
├─chm <- Chemical structure processing
├─rax <- Read Across prediction
└─utl <- Utilities
Raw data
{
"_id": null,
"home_page": "https://github.com/i-shah/genra-py",
"name": "genra",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "genra",
"author": "Imran Shah",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/a6/6a/6f9251eb4682094af3399833c694f6c2d28cc3f86a3c3bf6f4091f4e6b17/genra-0.2.3.tar.gz",
"platform": null,
"description": "# Generalised Read-Across (GenRA) in Python \n\n\n[Read-Across](https://www.oecd.org/env/ehs/risk-assessment/groupingofchemicalschemicalcategoriesandread-across.htm) is widely used to fill data-gaps for untested chemicals. We developed [Genralised Read-Across (GenRA)](https://doi.org/10.1016/j.yrtph.2019.104480) as a computational toxicology tool to mimic a human expert\u2019s manual reasoning based on similarity-weighted activity. This repository contains a Python 3 implementation for GenRA, called genra-py, which is based on the [scikit-learn](https://scikit-learn.org) [estimator](https://scikit-learn.org/stable/modules/generated/sklearn.base.BaseEstimator.html?highlight=estimator#sklearn.base.BaseEstimator). We also describe two potential uses-cases for genra-py that uses published chemical structure, bioactivity and toxicity data. \n\n![](figs/genra-viz.jpg)\n\n\n# Easy starts \n`pip install genra`\n\nor try our Docker image from on dockerhub at [https://hub.docker.com/r/patlewig/genra-py]\n\nThe image contains the scipy Jupyter notebook, RDKit and a pip installable version of genra-py (https://github.com/i-shah/genra-py/). \n\nIn a terminal type:\n\n`docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes --user $(id -u):$(id -g) --group-add users -v \"$PWD\":/home/jovyan patlewig/genra-py`\n\nCopy/paste the resulting url link into a new browser window. This should start the Jupyter lab session from your current working directory.\n\nTo avoid typing the long argument in the terminal, using docker-compose is an alternative means of running the container.\nType `docker-compose -f genra-docker-compose.yml up`\nTo stop the container simply type:\n`docker-compose -f genra-docker-compose.yml down`\n\n\n# Alternatives\n\nRunning the notebooks in this repository requires Python 3, [Anaconda](https://www.anaconda.com/), [Jupter](https://jupyter.org/) and some additional configuration. \n\n1. Install Python 3, anaconda/conda and Jupyter Lab\n2. Clone this repo: \\\n `git clone https://github.com/i-shah/genra-py.git`\n3. Go into genra-py directory and create *genra-py* conda environment: \\\n `make -n create_environment`\n4. Activate conda environment:\\\n `conda activate genra-py`\n5. Add this conda environment as a kernel to jupyter-lab: \\\n `ipython kernel install --user --name=genra-py`\n6. Copy the notebooks/dotenv file to notebooks/.env and edit the environemnt variables (replace path_to_top with the correct directory name):\\\n `TOP=path_to_top/genra-py\n SRC=path_to_top/genra-py/src\n DAT=path_to_top/genra-py/data\n FIG=path_to_top/genra-py/figs\n `\n\nFurther details are provided in the notebooks/manual directory. \n\nSee https://github.com/patlewig/UNC_Rax and run the example using the Binder https://mybinder.org/\n\n\n# Project Organization\n\n \u251c\u2500\u2500 LICENSE\n \u251c\u2500\u2500 Makefile <- Makefile with commands like `make data` or `make train`\n \u251c\u2500\u2500 README.md <- The top-level README for developers using this project.\n \u251c\u2500\u2500 data <- Data from public domain sources.\n \u2502\u00a0\u00a0 \u2514\u2500 shah-2016 <- Data from https://doi.org/10.1016/j.yrtph.2016.05.008\n \u2502\u00a0\u00a0 \u2514\u2500 helman-2019 <- Data from https://doi.org/10.1016/j.yrtph.2016.05.008\n |\n \u251c\u2500\u2500 notebooks <- Jupyter notebooks \n | | \n | \u251c\u2500dotenv <- copy this to \".env\" and edit this file\n | \u251c\u2500app-note <- use-cases described in manuscript\n | \u2514\u2500manual <- user-manual as a jupyter notebook\n \u2502\n \u251c\u2500\u2500 requirements.txt <- The requirements file for reproducing the analysis environment, e.g.\n \u2502 generated with `pip freeze > requirements.txt`\n \u251c\u2500\u2500 genra-py.yml <- The spec for creating a conda environment.\n | conda env create -f condaenv.yml\n \u251c\u2500\u2500 dist <- Source and Wheel Distributions\n |\n \u2514\u2500\u2500 genra <- Source code \n \u00a0 \u00a0 \u00a0\u00a0 \u251c\u2500chm <- Chemical structure processing\n \u251c\u2500rax <- Read Across prediction\n \u2514\u2500utl <- Utilities\n \n \u00a0\u00a0 \u00a0\u00a0\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Generalised Read Across (GenRA) in Python",
"version": "0.2.3",
"project_urls": {
"Homepage": "https://github.com/i-shah/genra-py"
},
"split_keywords": [
"genra"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "855b5dff3181ea4c2a05b61d1642e2360ef3568dd4f7f3c48f3712967ba6875a",
"md5": "eae88cd3180e41c8f093588e7df4019e",
"sha256": "d0f135f633aa4b9644b975975182808de467721b20e0fbd95a0572fb8c5e8a0a"
},
"downloads": -1,
"filename": "genra-0.2.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "eae88cd3180e41c8f093588e7df4019e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 27784,
"upload_time": "2024-03-19T01:40:09",
"upload_time_iso_8601": "2024-03-19T01:40:09.346530Z",
"url": "https://files.pythonhosted.org/packages/85/5b/5dff3181ea4c2a05b61d1642e2360ef3568dd4f7f3c48f3712967ba6875a/genra-0.2.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a66a6f9251eb4682094af3399833c694f6c2d28cc3f86a3c3bf6f4091f4e6b17",
"md5": "8df0a724d4f733d0d6db65db8eac950e",
"sha256": "b8f3c8f6258e04ad24b196a1d41aced36646c0dc5ff18d2f9083f9defa555ac0"
},
"downloads": -1,
"filename": "genra-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "8df0a724d4f733d0d6db65db8eac950e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 25343,
"upload_time": "2024-03-19T01:40:10",
"upload_time_iso_8601": "2024-03-19T01:40:10.958230Z",
"url": "https://files.pythonhosted.org/packages/a6/6a/6f9251eb4682094af3399833c694f6c2d28cc3f86a3c3bf6f4091f4e6b17/genra-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-19 01:40:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "i-shah",
"github_project": "genra-py",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "backcall",
"specs": [
[
"==",
"0.1.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2020.4.5.1"
]
]
},
{
"name": "cycler",
"specs": [
[
"==",
"0.10.0"
]
]
},
{
"name": "decorator",
"specs": [
[
"==",
"4.4.2"
]
]
},
{
"name": "entrypoints",
"specs": [
[
"==",
"0.3"
]
]
},
{
"name": "flake8",
"specs": [
[
"==",
"3.7.9"
]
]
},
{
"name": "ipykernel",
"specs": [
[
"==",
"5.1.4"
]
]
},
{
"name": "ipython",
"specs": [
[
"==",
"7.13.0"
]
]
},
{
"name": "ipython-genutils",
"specs": [
[
"==",
"0.2.0"
]
]
},
{
"name": "jedi",
"specs": [
[
"==",
"0.16.0"
]
]
},
{
"name": "joblib",
"specs": [
[
"==",
"1.1.0"
]
]
},
{
"name": "jupyter-client",
"specs": [
[
"==",
"6.1.2"
]
]
},
{
"name": "jupyter-core",
"specs": [
[
"==",
"4.6.3"
]
]
},
{
"name": "kiwisolver",
"specs": [
[
"==",
"1.2.0"
]
]
},
{
"name": "lxml",
"specs": [
[
"==",
"4.6.2"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.2.1"
]
]
},
{
"name": "mccabe",
"specs": [
[
"==",
"0.6.1"
]
]
},
{
"name": "mkl-fft",
"specs": [
[
"==",
"1.0.15"
]
]
},
{
"name": "mkl-random",
"specs": [
[
"==",
"1.1.0"
]
]
},
{
"name": "mkl-service",
"specs": [
[
"==",
"2.3.0"
]
]
},
{
"name": "mongoengine",
"specs": [
[
"==",
"0.19.1"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"1.22.1"
]
]
},
{
"name": "olefile",
"specs": [
[
"==",
"0.46"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"1.0.3"
]
]
},
{
"name": "parso",
"specs": [
[
"==",
"0.6.2"
]
]
},
{
"name": "pexpect",
"specs": [
[
"==",
"4.8.0"
]
]
},
{
"name": "pickleshare",
"specs": [
[
"==",
"0.7.5"
]
]
},
{
"name": "Pillow",
"specs": [
[
"==",
"7.0.0"
]
]
},
{
"name": "prompt-toolkit",
"specs": [
[
"==",
"3.0.4"
]
]
},
{
"name": "ptyprocess",
"specs": [
[
"==",
"0.6.0"
]
]
},
{
"name": "pycairo",
"specs": [
[
"==",
"1.19.0"
]
]
},
{
"name": "pycodestyle",
"specs": [
[
"==",
"2.5.0"
]
]
},
{
"name": "pyflakes",
"specs": [
[
"==",
"2.1.1"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.6.1"
]
]
},
{
"name": "pymongo",
"specs": [
[
"==",
"3.9.0"
]
]
},
{
"name": "pyparsing",
"specs": [
[
"==",
"2.4.7"
]
]
},
{
"name": "python-box",
"specs": [
[
"==",
"4.2.2"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.8.1"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2019.3"
]
]
},
{
"name": "pyzmq",
"specs": [
[
"==",
"18.1.1"
]
]
},
{
"name": "ruamel.yaml",
"specs": [
[
"==",
"0.16.10"
]
]
},
{
"name": "ruamel.yaml.clib",
"specs": [
[
"==",
"0.2.0"
]
]
},
{
"name": "scikit-learn",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "scipy",
"specs": [
[
"==",
"1.7.3"
]
]
},
{
"name": "seaborn",
"specs": [
[
"==",
"0.10.0"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.14.0"
]
]
},
{
"name": "threadpoolctl",
"specs": [
[
"==",
"3.1.0"
]
]
},
{
"name": "toml",
"specs": [
[
"==",
"0.10.0"
]
]
},
{
"name": "tornado",
"specs": [
[
"==",
"6.0.4"
]
]
},
{
"name": "traitlets",
"specs": [
[
"==",
"4.3.3"
]
]
},
{
"name": "wcwidth",
"specs": [
[
"==",
"0.1.9"
]
]
},
{
"name": "xlrd",
"specs": [
[
"==",
"1.2.0"
]
]
}
],
"tox": true,
"lcname": "genra"
}