Metadata-Version: 2.2
Name: CompDesc
Version: 2.0.0
Summary: Compute 1D, 2D, and 3D molecular descriptors from a SMILES string
Author-email: Alexandre Borrel <a.borrel@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/ABorrel/CompDESC
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: rdkit
Requires-Dist: numpy
Requires-Dist: scipy
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"

# CompDesc

CompDesc computes 1D, 2D, and 3D molecular descriptors from a SMILES string. Version 2.0.0 is one installable package. Descriptor names, prepared SMILES, and the descriptor tables are unchanged from 1.x.

## Install

```bash
pip install .
```

Tested with Python 3.12.4, RDKit 2024.3.5, NumPy 2.1.0, and SciPy 1.14.1. The package requires Python 3.9 or newer, plus RDKit, NumPy, and SciPy.

## Example

```python
import CompDesc

chem = CompDesc.CompDesc("N=C(O)[C@@H](N)CS", "results/")
chem.prepChem()
chem.computeAll2D()
chem.writeMatrix("2D")
chem.set3DChemical()
chem.computeAll3D()
chem.writeMatrix("3D")
```

`results/2D/<inchikey>.csv` and `results/3D/<inchikey>.csv` each contain two tab-separated lines: the descriptor names, then the values.

## What the files are

| Path | Contents |
| --- | --- |
| `SMI/<inchikey>.smi` | Prepared SMILES |
| `PNG/<inchikey>.png` | 500×500 depiction |
| `2D/<inchikey>.csv` | 1D/2D descriptors |
| `3D/<inchikey>.csv` | 3D descriptors |
| `SDF3D/`, `MOLCLEAN/` | 3D coordinates used for the 3D descriptors |

Pass `update=1` to recompute a descriptor table that is already on disk. Pass `p_salts` as a path to an RDKit salt-definition file to replace the built-in salt list.

PNG drawing uses RDKit. `computePNG(bg="white")` draws on white. Any other `bg` draws a transparent PNG when RDKit's Cairo drawer is available.

## Further reading

- [Method reference](docs/api.md)
- [Descriptor families](docs/descriptors.md)
- [Adding a descriptor](docs/maintainer.md)
- [Changelog](docs/changelog.md)
