Metadata-Version: 2.4
Name: QEPPIcommunity
Version: 0.1.22
Summary: Community-maintained calculation module for QEPPI
Author-email: blacktanktop <blacktanktopme@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/AspirinCode/QEPPI-community
Project-URL: Repository, https://github.com/AspirinCode/QEPPI-community
Keywords: chemistry,rdkit,QEPPI,protein-protein interactions
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: <3.15,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rdkit>=2025.3.2
Requires-Dist: numpy>=1.23
Requires-Dist: pandas>=1.5
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Dynamic: license-file

<p align="center">
  <img src="https://user-images.githubusercontent.com/7370243/135420088-f616adc8-1e92-4d9b-8b53-0b863497244d.png" width="400px">
</p>

# QEPPI-community

**Quantitative estimate index for early-stage screening of compounds targeting protein-protein interactions**

[![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)
![PyPI](https://img.shields.io/pypi/v/QEPPIcommunity?style=flat-square)
[![Python Versions](https://img.shields.io/pypi/pyversions/QEPPIcommunity.svg)](https://pypi.org/project/QEPPIcommunity/)

## Google Colab

You can calculate QEPPI from SMILES in Google Colab without creating a local environment. If you have many SMILES to calculate, consider converting them to SDF first.

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AspirinCode/QEPPI-community/blob/main/notebook/QEPPI.ipynb)

## Supported Environment

QEPPI-community is tested on Python 3.10, 3.11, 3.12, 3.13, and 3.14 (`requires-python = >=3.10,<3.15`). The package depends on the latest compatible RDKit from PyPI with `rdkit>=2025.3.2`, plus NumPy and pandas. RDKit descriptor behavior may change between RDKit releases, so exact QEPPI values can drift across RDKit versions even when the QEPPI formula and built-in model parameters are unchanged.

## Installation

```bash
python -m pip install QEPPIcommunity
```

For development from a clone:

```bash
git clone https://github.com/AspirinCode/QEPPI-community.git
cd QEPPI-community
python -m pip install -e ".[dev]"
pytest -v
```

## Python API

`QEPPI_Calculator()` loads the built-in QEPPI model by default. You no longer need to call `read()` before scoring.

```python
from rdkit import Chem
from rdkit.Chem import SDMolSupplier
from QEPPI import QEPPI_Calculator, get_qeppi_properties

calculator = QEPPI_Calculator()

smiles = "COC1=CC(=CC=C1NC(=O)[C@@H]1N[C@@H](CC(C)(C)C)[C@@](C#N)([C@H]1C1=CC=CC(Cl)=C1F)C1=CC=C(Cl)C=C1F)C(O)=O"
mol = Chem.MolFromSmiles(smiles)

print(calculator.qeppi(mol))
print(calculator.score(mol))
print(get_qeppi_properties(mol))

supplier = SDMolSupplier("PATH_TO_COMPOUNDS.sdf")
mols = [mol for mol in supplier if mol is not None]
scores = calculator.score_many(mols)
```

Legacy names remain available: `QEPPI_Calculator`, `qeppi`, `descript`, `read`, and `load`. Modern aliases are also available: `QEPPICalculator`, `score`, `descriptors`, and `score_many`.

## CLI

The installed console command is `qeppi`. Exactly one input mode is required: `--smiles`, `--csv`, or `--sdf`.

Single SMILES:

```bash
qeppi --smiles "CCO"
```

CSV input:

```bash
qeppi --csv compounds.csv --out results/qeppi.csv
qeppi --csv compounds.csv --smiles-column structure --out results/qeppi.csv
```

CSV output preserves every original row and column. QEPPI adds `CanonicalSMILES`, `QEPPI`, `QEPPI_status`, and `QEPPI_error`. Invalid SMILES are not dropped: their `QEPPI` field is blank, `QEPPI_status` is `error`, and `QEPPI_error` explains the failure.

SDF input:

```bash
qeppi --sdf compounds.sdf --out results/qeppi.csv
```

SDF output includes `record_index`, `CanonicalSMILES`, `QEPPI`, `QEPPI_status`, and `QEPPI_error`. Failed records are kept and reported on stderr.

The historical script still works as a compatibility wrapper:

```bash
python calc_QEPPI.py --smiles "CCO"
```

## Model Files

By default, QEPPI uses the built-in model constants bundled in the package. The CLI no longer depends on `./model/QEPPI.model` in the current working directory.

Prefer JSON for custom models:

```bash
qeppi --smiles "CCO" --model qeppi-model.json
```

The JSON model must contain `params` and `weights`, parameters for all seven descriptors, six finite ADS coefficients per descriptor, and finite weight vectors with positive sums.

Legacy pickle models are still supported for compatibility:

```bash
qeppi --smiles "CCO" --model model/QEPPI.model
```

Security warning: pickle files can execute code while loading. Only load pickle model files from trusted sources. JSON is recommended for new workflows.

## Development

```bash
python -m pip install -e ".[dev]"
ruff check .
ruff format --check .
pytest -v --cov=QEPPI --cov-report=term-missing
```

## Reference

If you find QEPPI useful, please consider citing this publication:

- Kosugi T, Ohue M. [**Quantitative estimate index for early-stage screening of compounds targeting protein-protein interactions**](https://www.mdpi.com/1422-0067/22/20/10925). _International Journal of Molecular Sciences_, 22(20): 10925, 2021. doi: 10.3390/ijms222010925

Another QEPPI publication (conference paper):

- Kosugi T, Ohue M. [**Quantitative estimate of protein-protein interaction targeting drug-likeness**](https://ieeexplore.ieee.org/abstract/document/9562931/). In _Proceedings of The 18th IEEE International Conference on Computational Intelligence in Bioinformatics and Computational Biology (CIBCB 2021)_, 2021. doi: 10.1109/CIBCB49929.2021.9562931 [(PDF)](https://www.li.c.titech.ac.jp/paper/Kosugi-CIBCB2021.pdf) Copyright 2021 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses.



