Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Package code and make notebook more reusable #3

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
414 changes: 414 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

Binary file removed ChEMBL_1614027.gz
Binary file not shown.
23,384 changes: 22,539 additions & 845 deletions NAA_Workflow_ChEMBL.ipynb

Large diffs are not rendered by default.

85 changes: 18 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,37 @@
# NonadditivityAnalysis
Notebook for standardization of actvity data, nonadditivity analysis and its evaluation.

A jupyter notebook for:
Notebook for standardization of activity data, nonadditivity analysis and its evaluation.

A Python package and corresponding Jupyter notebook for:

1. Cleaning and standardizing ChEMBL activity data
2. Running nonadditivity analysis based on NAA code published by C. Kramer [1]
3. Evaluating the nonadditivity results

[1] Kramer C (2019) Nonadditivity Analysis. J Chem Inf Model 59:4034–4042.
https://doi.org/10.1021/acs.jcim.9b00631

## Installation

--------------------

## Requirements


Installation requirements are the same as for the published NAA code:

- A copy of the RDKit cheminformatics toolkit, available
from http://rdkit.org/

- A running version of mmpdb, a matched molecular pairs
database generation and analysis toolkit, available from
http://github.com/rdkit/mmpdb
```shell
git clone https://github.com/rdkit/mmpdb.git
cd mmpdb
python setup.py install
```

- A running version of NAA, nonadditivity analysis code, available from
https://github.com/KramerChristian/NonadditivityAnalysis
```shell
git clone https://github.com/KramerChristian/NonadditivityAnalysis.git
cd NonadditivityAnalysis
# Add mmpdb path to line 44 of NonadditivityAnalysis.py
```

In order to run the NAA code directly from jupyter notebook,
you need to set an environmental variable.
Therefore, on command line, generate the following directories and files:
First, install a copy of the RDKit cheminformatics toolkit, available
from http://rdkit.org/. The easiest way is to install via PyPI with
`pip install rdkit-pypi`.

```shell
cd $CONDA_PREFIX
mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/env_vars.sh
touch ./etc/conda/deactivate.d/env_vars.sh
```
Install directly from source with:

then edit ./etc/conda/activate.d/env_vars.sh as follows:
```shell
#!/bin/sh
export NAA='/path/to/naa/code/'
```bash
$ pip install git+https://github.com/MolecularAI/NonadditivityAnalysis.git
```

and edit ./etc/conda/deactivate.d/env_vars.sh as follows:
```shell
#!/bin/sh
unset NAA
```
Install the code in development mode with:

Apart from this, standard scientific python libraries like scipy and
numpy are required as well as seaborn and matplotlib for plot generation in the analysis part.
```shell
conda install -c anaconda scipy
conda install -c anaconda numpy
conda install -c conda-forge matplotlib
conda install seaborn
```bash
$ git clone git+https://github.com/MolecularAI/NonadditivityAnalysis.git
$ cd NonadditivityAnalysis
$ pip install -e .
```

-------------------

## Usage


The jupyter notebook can be run directly with gzipped activity data downloaded from ChEMBL,
as an example the activity data for ChEMBL1614027 (ChEMBL Version 27) is included in this package.
'my_path' and 'my_name' has to be adjusted at the beginning of the jupyter notebook to
reflect the user's specific path and output name.





The Jupyter notebook can be run for any ChEMBL assay via the `get_processed_assay_df()` function.
While `ChEMBL1614027` is used as an example, any can be used by changing the `assay_chembl_id` variable.
40 changes: 40 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
##########################
# Setup.py Configuration #
##########################
# Configuring setup()
[metadata]
name = nonadditivity_az
version = 1.0.0
description = An extension of the nonadditivity analysis from Kramer (2019)
long_description = file: README.md
long_description_content_type = text/markdown

[options]
install_requires =
# Scientific python stack
scipy
numpy
pandas
# Plotting
matplotlib
seaborn
# Cheminformatics tools
mmpdb
nonadditivity
chembl_downloader

zip_safe = false
include_package_data = True
python_requires = >=3.6

# Where is my code
packages = find:
package_dir =
= src

[options.packages.find]
where = src

[options.extras_require]
rdkit =
rdkit-pypi
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-

"""Setup module."""

import setuptools

if __name__ == '__main__':
setuptools.setup()
1 change: 1 addition & 0 deletions src/nonadditivity_az/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Extended Nonadditivity Analysis."""
Loading