PaDEL-pywrapper


NamePaDEL-pywrapper JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/OlivierBeq/PaDEL_pywrapper
SummaryPython wrapper for the PaDEL descriptors
upload_time2023-07-04 17:52:42
maintainerOlivier J. M. Béquignon
docs_urlNone
authorOlivier J. M. Béquignon
requires_python
license
keywords padel molecular descriptors cheminformatics qsar
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# PaDEL Python wrapper

Python wrapper to ease the calculation of [PaDEL molecular descriptors](https://doi.org/10.1002/jcc.21707) and fingerprints.

## Copyright notice

Olivier J. M. Béquignon is **neither** the copyright holder of PaDEL **nor** responsible for it.

The work carried out here concerns
- the Python wrapper, 
- the ePaDEL executable,
- the extendedlibpadeldescriptor library. 

## Installation

From source:

    git clone https://github.com/OlivierBeq/PaDEL_pywrapper.git
    pip install ./PaDEL_pywrapper

with pip:

```bash
pip install padel-pywrapper
```

### Get started

#### 1D and 2D descriptors

Descriptors of the module `PaDEL_pywrapper.descriptors` can be computed as follows:

```python
from PaDEL_pywrapper import PaDEL
from PaDEL_pywrapper.descriptor import ALOGP, Crippen, FMF
from rdkit import Chem

smiles_list = [
    # erlotinib
    "n1cnc(c2cc(c(cc12)OCCOC)OCCOC)Nc1cc(ccc1)C#C",
    # midecamycin
    "CCC(=O)O[C@@H]1CC(=O)O[C@@H](C/C=C/C=C/[C@@H]([C@@H](C[C@@H]([C@@H]([C@H]1OC)O[C@H]2[C@@H]([C@H]([C@@H]([C@H](O2)C)O[C@H]3C[C@@]([C@H]([C@@H](O3)C)OC(=O)CC)(C)O)N(C)C)O)CC=O)C)O)C",
    # selenofolate
    "C1=CC(=CC=C1C(=O)NC(CCC(=O)OCC[Se]C#N)C(=O)O)NCC2=CN=C3C(=N2)C(=O)NC(=N3)N",
]
mols = [Chem.MolFromSmiles(smiles) for smiles in smiles_list]

descriptors = [ALOGP, Crippen, FMF]

padel = PaDEL(descriptors)
print(padel.calculate(mols))
```

Instances of descriptors can be supplied as well.

```python
descriptors = [ALOGP(), Crippen(), FMF()]

padel = PaDEL(descriptors)
print(padel.calculate(mols))
```

To calculate all possible descriptors, import the `descriptors` list from the module `PaDEL_pywrapper` directly:


```python
from PaDEL_pywrapper import descriptors

padel = PaDEL(descriptors)
print(padel.calculate(mols))
```

#### 3D descriptors

By default, the `ignore_3D` parameter is set to `True`, preventing any provided 3D descriptor to be calculated.

Should molecules with 3D coordinates be provided, one can turn on 3D descriptor calculation.

```python
from rdkit.Chem import AllChem

mols = [Chem.AddHs(mol) for mol in mols]
_ = [AllChem.EmbedMolecule(mol) for mol in mols]

padel = PaDEL(descriptors, ignore_3D=False)
print(padel.calculate(mols))
```

:warning: A warning is raised if molecules lack hydrogens.<br/>
:warning: An exception is raised if molecules do not have 3D coordinates.

```python
mol = Chem.MolFromSmiles('CCC')

padel = PaDEL(descriptors, ignore_3D=False)
print(padel.calculate([mol]))
# ValueError: Cannot calculate descriptors for a conformer-less molecule
```

#### Fingerprints


Fingerprints of the module `PaDEL_pywrapper.descriptors can be computed as follows:

```python
from PaDEL_pywrapper.descriptor import GraphOnlyFP

fp = GraphOnlyFP

padel = PaDEL([fp], ignore_3D=False)
print(padel.calculate(mols))
```

Custom parameter sets can be provided for some fingerprints:

```python
fp = GraphOnlyFP(size=2048, searchDepth=8)

padel = PaDEL([fp], ignore_3D=False)
print(padel.calculate(mols))
```

### Other parameters

```python
class PaDEL:
    ...
    def calculate(self, mols: Iterable[Chem.Mol], show_banner: bool = True, njobs: int = 1, chunksize: int = 100):
```

#### Parameters

- ***mols  : Iterable[Chem.Mol]***  
  RDKit molecule objects for which to obtain PaDEL descriptors.
- ***show_banner  : bool***  
  Displays default notice about PaDEL descriptors.
- ***njobs  : int***  
  Maximum number of simultaneous processes. Ignored if `self.descriptors` are instances and not class names.
- ***chunksize  : int***  
  Maximum number of molecules each process is charged of. Ignored if `self.descriptors` are instances and not class names.

### Details about descriptors


Details about each descriptor and fingerprint can be obtained as follows:

```python
print(ALOGP.description)

print(GraphOnlyFP.description)
```

For full details about all descriptors, one can obtain the path to the original Excel file of the PaDEL descriptors with:

```python
print(padel.details)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OlivierBeq/PaDEL_pywrapper",
    "name": "PaDEL-pywrapper",
    "maintainer": "Olivier J. M. B\u00e9quignon",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "\"olivier.bequignon.maintainer@gmail.com\"",
    "keywords": "PaDEL,molecular descriptors,cheminformatics,QSAR",
    "author": "Olivier J. M. B\u00e9quignon",
    "author_email": "\"olivier.bequignon.maintainer@gmail.com\"",
    "download_url": "https://files.pythonhosted.org/packages/62/10/b2965b572cb650b515f2f943fbd99573c9970b889aada1bc88ce9cee97cb/PaDEL_pywrapper-1.0.4.tar.gz",
    "platform": null,
    "description": "[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\n# PaDEL Python wrapper\r\n\r\nPython wrapper to ease the calculation of [PaDEL molecular descriptors](https://doi.org/10.1002/jcc.21707) and fingerprints.\r\n\r\n## Copyright notice\r\n\r\nOlivier J. M. B\u00e9quignon is **neither** the copyright holder of PaDEL **nor** responsible for it.\r\n\r\nThe work carried out here concerns\r\n- the Python wrapper, \r\n- the ePaDEL executable,\r\n- the extendedlibpadeldescriptor library. \r\n\r\n## Installation\r\n\r\nFrom source:\r\n\r\n    git clone https://github.com/OlivierBeq/PaDEL_pywrapper.git\r\n    pip install ./PaDEL_pywrapper\r\n\r\nwith pip:\r\n\r\n```bash\r\npip install padel-pywrapper\r\n```\r\n\r\n### Get started\r\n\r\n#### 1D and 2D descriptors\r\n\r\nDescriptors of the module `PaDEL_pywrapper.descriptors` can be computed as follows:\r\n\r\n```python\r\nfrom PaDEL_pywrapper import PaDEL\r\nfrom PaDEL_pywrapper.descriptor import ALOGP, Crippen, FMF\r\nfrom rdkit import Chem\r\n\r\nsmiles_list = [\r\n    # erlotinib\r\n    \"n1cnc(c2cc(c(cc12)OCCOC)OCCOC)Nc1cc(ccc1)C#C\",\r\n    # midecamycin\r\n    \"CCC(=O)O[C@@H]1CC(=O)O[C@@H](C/C=C/C=C/[C@@H]([C@@H](C[C@@H]([C@@H]([C@H]1OC)O[C@H]2[C@@H]([C@H]([C@@H]([C@H](O2)C)O[C@H]3C[C@@]([C@H]([C@@H](O3)C)OC(=O)CC)(C)O)N(C)C)O)CC=O)C)O)C\",\r\n    # selenofolate\r\n    \"C1=CC(=CC=C1C(=O)NC(CCC(=O)OCC[Se]C#N)C(=O)O)NCC2=CN=C3C(=N2)C(=O)NC(=N3)N\",\r\n]\r\nmols = [Chem.MolFromSmiles(smiles) for smiles in smiles_list]\r\n\r\ndescriptors = [ALOGP, Crippen, FMF]\r\n\r\npadel = PaDEL(descriptors)\r\nprint(padel.calculate(mols))\r\n```\r\n\r\nInstances of descriptors can be supplied as well.\r\n\r\n```python\r\ndescriptors = [ALOGP(), Crippen(), FMF()]\r\n\r\npadel = PaDEL(descriptors)\r\nprint(padel.calculate(mols))\r\n```\r\n\r\nTo calculate all possible descriptors, import the `descriptors` list from the module `PaDEL_pywrapper` directly:\r\n\r\n\r\n```python\r\nfrom PaDEL_pywrapper import descriptors\r\n\r\npadel = PaDEL(descriptors)\r\nprint(padel.calculate(mols))\r\n```\r\n\r\n#### 3D descriptors\r\n\r\nBy default, the `ignore_3D` parameter is set to `True`, preventing any provided 3D descriptor to be calculated.\r\n\r\nShould molecules with 3D coordinates be provided, one can turn on 3D descriptor calculation.\r\n\r\n```python\r\nfrom rdkit.Chem import AllChem\r\n\r\nmols = [Chem.AddHs(mol) for mol in mols]\r\n_ = [AllChem.EmbedMolecule(mol) for mol in mols]\r\n\r\npadel = PaDEL(descriptors, ignore_3D=False)\r\nprint(padel.calculate(mols))\r\n```\r\n\r\n:warning: A warning is raised if molecules lack hydrogens.<br/>\r\n:warning: An exception is raised if molecules do not have 3D coordinates.\r\n\r\n```python\r\nmol = Chem.MolFromSmiles('CCC')\r\n\r\npadel = PaDEL(descriptors, ignore_3D=False)\r\nprint(padel.calculate([mol]))\r\n# ValueError: Cannot calculate descriptors for a conformer-less molecule\r\n```\r\n\r\n#### Fingerprints\r\n\r\n\r\nFingerprints of the module `PaDEL_pywrapper.descriptors can be computed as follows:\r\n\r\n```python\r\nfrom PaDEL_pywrapper.descriptor import GraphOnlyFP\r\n\r\nfp = GraphOnlyFP\r\n\r\npadel = PaDEL([fp], ignore_3D=False)\r\nprint(padel.calculate(mols))\r\n```\r\n\r\nCustom parameter sets can be provided for some fingerprints:\r\n\r\n```python\r\nfp = GraphOnlyFP(size=2048, searchDepth=8)\r\n\r\npadel = PaDEL([fp], ignore_3D=False)\r\nprint(padel.calculate(mols))\r\n```\r\n\r\n### Other parameters\r\n\r\n```python\r\nclass PaDEL:\r\n    ...\r\n    def calculate(self, mols: Iterable[Chem.Mol], show_banner: bool = True, njobs: int = 1, chunksize: int = 100):\r\n```\r\n\r\n#### Parameters\r\n\r\n- ***mols  : Iterable[Chem.Mol]***  \r\n  RDKit molecule objects for which to obtain PaDEL descriptors.\r\n- ***show_banner  : bool***  \r\n  Displays default notice about PaDEL descriptors.\r\n- ***njobs  : int***  \r\n  Maximum number of simultaneous processes. Ignored if `self.descriptors` are instances and not class names.\r\n- ***chunksize  : int***  \r\n  Maximum number of molecules each process is charged of. Ignored if `self.descriptors` are instances and not class names.\r\n\r\n### Details about descriptors\r\n\r\n\r\nDetails about each descriptor and fingerprint can be obtained as follows:\r\n\r\n```python\r\nprint(ALOGP.description)\r\n\r\nprint(GraphOnlyFP.description)\r\n```\r\n\r\nFor full details about all descriptors, one can obtain the path to the original Excel file of the PaDEL descriptors with:\r\n\r\n```python\r\nprint(padel.details)\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python wrapper for the PaDEL descriptors",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/OlivierBeq/PaDEL_pywrapper"
    },
    "split_keywords": [
        "padel",
        "molecular descriptors",
        "cheminformatics",
        "qsar"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a76246223d0f266e64f47a5769a121ea94bebe2fdb525e0682e355b513282147",
                "md5": "af1a3b9f4838e4629f4d6aa5778351c0",
                "sha256": "029d2725551c82bff2c7b37345f1de2b520d3c630fec6087abbb516f651679f8"
            },
            "downloads": -1,
            "filename": "PaDEL_pywrapper-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "af1a3b9f4838e4629f4d6aa5778351c0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 37471767,
            "upload_time": "2023-07-04T17:52:11",
            "upload_time_iso_8601": "2023-07-04T17:52:11.781141Z",
            "url": "https://files.pythonhosted.org/packages/a7/62/46223d0f266e64f47a5769a121ea94bebe2fdb525e0682e355b513282147/PaDEL_pywrapper-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6210b2965b572cb650b515f2f943fbd99573c9970b889aada1bc88ce9cee97cb",
                "md5": "d63f796b9903f0fda406b1be3626db8c",
                "sha256": "bdf36a9b7ce2c84bedad885abbfd6792bf4da87fcce4279c2b7a526c27d49ea1"
            },
            "downloads": -1,
            "filename": "PaDEL_pywrapper-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d63f796b9903f0fda406b1be3626db8c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 37451525,
            "upload_time": "2023-07-04T17:52:42",
            "upload_time_iso_8601": "2023-07-04T17:52:42.521240Z",
            "url": "https://files.pythonhosted.org/packages/62/10/b2965b572cb650b515f2f943fbd99573c9970b889aada1bc88ce9cee97cb/PaDEL_pywrapper-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-04 17:52:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OlivierBeq",
    "github_project": "PaDEL_pywrapper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "padel-pywrapper"
}
        
Elapsed time: 0.12774s