Metadata-Version: 2.4
Name: rlec
Version: 0.1.2
Summary: RNA-Ligand Extended Connectivity (RLEC) Fingerprint for binding affinity prediction
Author-email: Stalin A <stalin.bioinfo@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/stalinA/rlec
Project-URL: Documentation, https://rlec.readthedocs.io
Project-URL: Bug Tracker, https://github.com/stalinA/rlec/issues
Keywords: RNA,ligand,fingerprint,binding affinity,cheminformatics,bioinformatics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: scipy>=1.10
Requires-Dist: scikit-learn>=1.3
Requires-Dist: rdkit>=2023.9
Requires-Dist: biopython>=1.81
Requires-Dist: tqdm>=4.65
Requires-Dist: requests>=2.31
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.7; extra == "viz"
Requires-Dist: seaborn>=0.12; extra == "viz"

# RLEC — RNA-Ligand Extended Connectivity Fingerprint

RLEC adapts the PLEC fingerprint (Wójcikowski et al., *Bioinformatics* 2019) to RNA-ligand systems. For each RNA–ligand contact pair, it pairs the Morgan-style chemical environments of the RNA atom and the ligand atom across increasing depths and hashes the pairs into a count vector.

## Installation

```bash
pip install rlec
```

## Quick start

```python
from rlec import RLECFingerprint

fp = RLECFingerprint(
    rna_depth=6,      # Morgan depth for RNA atoms
    ligand_depth=3,   # Morgan depth for ligand atoms
    fp_size=4096,     # folded vector size
    feat_set=1,       # 1 = include nucleotide type (A/U/G/C) in RNA hash
    cutoff=6.0,       # contact distance cutoff (Å)
)

vec = fp.transform("path/to/rna.pdb", "path/to/ligand.sdf")
# vec: np.ndarray shape (4096,), dtype float32
```

`transform` also accepts an RDKit `Mol` object as the second argument (must have a 3D conformer).

For a batch:

```python
X = fp.transform_batch([
    ("rna1.pdb", "lig1.sdf"),
    ("rna2.pdb", "lig2.sdf"),
])
# X: np.ndarray shape (n, 4096)
```

## Feature sets

| `feat_set` | RNA atom invariant |
|---|---|
| 0 | Basic ECFP (atomic num, charge, degree, aromaticity, ring) |
| 1 | + nucleotide type (A/U/G/C/T/modified) — **best** |
| 2 | + PBS group (Phosphate/Sugar/Base) |
| 3 | + nucleotide type + PBS group |

## Performance

Validated on 143 RNA–ligand complexes (LOOCV, LightGBM):

| Method | LOOCV r |
|---|---|
| Ligand-only ECFP | 0.562 |
| RNA-only ECFP | 0.594 |
| Element-pair FP | 0.578 |
| **RLEC feat1** | **0.710** |

95% bootstrap CI: [0.616, 0.790]. RLEC vs ligand-only: Δr = +0.148 (p < 0.0005).

## Requirements

- Python ≥ 3.9
- numpy, scipy, biopython, rdkit

## Citation

If you use RLEC, please cite:

> Stalin A. *RLEC: RNA-Ligand Extended Connectivity Fingerprint for binding affinity prediction.* (2026)

> Wójcikowski M, Kukiełka M, Stepniak-Konieczna M, Antosiewicz JM, Siedlecki P.
> Development of a protein–ligand extended connectivity (PLEC) fingerprint and its
> application for virtual screening. *Bioinformatics* 2019;35(8):1334–1341.
