Skip to main content

Generalised Read-Across (GenRA) in Python

Read-Across is widely used to fill data-gaps for untested chemicals. We developed Genralised Read-Across (GenRA) 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 estimator. We also describe two potential uses-cases for genra-py that uses published chemical structure, bioactivity and toxicity data.

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, Jupter 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
        
       

Release files for genra 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genra 0.2.3
File Size Uploaded
genra-0.2.3.tar.gz 25.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genra 0.2.3
File Interpreter ABI Platform
genra-0.2.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 53.1 kB

Release files / genra-0.2.3.tar.gz

Download URL genra-0.2.3.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b8f3c8f6258e04ad24b196a1d41aced36646c0dc5ff18d2f9083f9defa555ac0
BLAKE2b-256 checksum
How to use checksums
a66a6f9251eb4682094af3399833c694f6c2d28cc3f86a3c3bf6f4091f4e6b17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / genra-0.2.3-py2.py3-none-any.whl

Download URL genra-0.2.3-py2.py3-none-any.whl
Size 27.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d0f135f633aa4b9644b975975182808de467721b20e0fbd95a0572fb8c5e8a0a
BLAKE2b-256 checksum
How to use checksums
855b5dff3181ea4c2a05b61d1642e2360ef3568dd4f7f3c48f3712967ba6875a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page