Mold2-pywrapper


NameMold2-pywrapper JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/OlivierBeq/Mold2_pywrapper
SummaryPython wrapper for Mold2 descriptors
upload_time2023-08-09 06:22:18
maintainerOlivier J. M. Béquignon
docs_urlNone
authorOlivier J. M. Béquignon
requires_python
license
keywords mold2 molecular descriptors cheminformatics toxicoinformatics 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)

![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white) ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)  

# Mold² Python wrapper

Python wrapper to ease the calculation of Mold2 molecular descriptors.

## Copyright notice

Mold2 is a product designed and produced by the National Center for Toxicological
Research (NCTR).<br/>FDA and NCTR retain ownership of this product.

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

Only the Python wrapper is the work of Olivier J. M. Béquignon.

## Installation

From source:

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

with pip:

```bash
pip install mold2-pywrapper
```

### Get started

```python
from Mold2_pywrapper import Mold2

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",
    # cisplatin
    "N.N.Cl[Pt]Cl"
]
mols = [Chem.MolFromSmiles(smiles) for smiles in smiles_list]

mold2 = Mold2()
print(mold2.calculate(mols))
```

Instantiating a Mold2 object ensures that the executables for your platform are accessible.
If this is not the case, an attempt to download them from the
[website of the FDA](https://www.fda.gov/science-research/bioinformatics-tools/mold2) is made.

Should one have downloaded the original ZIP file available from the
[website of the FDA](https://www.fda.gov/science-research/bioinformatics-tools/mold2), the executables can be installed
using the following:

```python
path_to_zipfile = '...'  # Replace by the path to the ZIP file on your machine
mold2 = Mold2.from_executable(path_to_zipfile)
print(mold2.calculate(mols))
```

Executables will be installed for future use. From then on, default instanciation may be carried out:

```python
mold2 = Mold2()
print(mold2.calculate(mols))
```

### Details about descriptors

Any detail about the 777 Mold2 descriptors can be obtained either for a single descriptor, by providing its index:

```python
print(mold2.descriptor_detail(15))
# rotatable bond fraction
```

Or for all at once:

```python
print(mold2.descriptor_details())
# {"D001": "number of 6-membered aromatic rings (only carbon atoms)",
#  "D002": "number of 03-membered rings",
#  ...
#  }
```

## Documentation

```python
def calculate(mols, show_banner=True, njobs=1, chunksize=100):
```

Default method to calculate #### Parameters

- ***mols  : Iterable[Chem.Mol]***  
  RDKit molecule objects for which to obtain Mold2 descriptors.
- ***show_banner  : bool***  
  Displays default notice about Mold2 descriptors.
- ***njobs  : int***  
  Maximum number of simultaneous processes.
- ***chunksize  : int***  
  Maximum number of molecules each process is charged of.
- ***return_type  : pd.DataFramce***  
  Pandas DataFrame containing Mold2 molecular descriptors.Mold2 descriptors.
  If executables have not previously been downloaded, attempts to download and install them.

________________

```python
def descriptor_detail(index):
```

Obtain detils about one descriptor.

#### Parameters

- ***index  : int***  
  Index of the descriptor.
- ***return_type  : str***  
  Description of the descriptor.

________________

```python
def descriptor_details():
```

Obtain details about all descriptors.

#### Parameters

- ***return_type  : dict***  
  Mapping of molecular descriptors with their details.

________________

```python
def from_executable(zipfile_path):
```

Install executables and instantiate a Mold2 calculator.

#### Parameters

- ***zipfile_path  : str***  
  Path to the user-downloaded ZIP file containing Mold2 executables.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OlivierBeq/Mold2_pywrapper",
    "name": "Mold2-pywrapper",
    "maintainer": "Olivier J. M. B\u00e9quignon",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "\"olivier.bequignon.maintainer@gmail.com\"",
    "keywords": "mold2,molecular descriptors,cheminformatics,toxicoinformatics,QSAR",
    "author": "Olivier J. M. B\u00e9quignon",
    "author_email": "\"olivier.bequignon.maintainer@gmail.com\"",
    "download_url": "https://files.pythonhosted.org/packages/ca/3f/348ba1741c34b31cbe1a8def70933444b5d8902b858a3662649009595416/Mold2_pywrapper-0.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![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white) ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)  \r\n\r\n# Mold\u00b2 Python wrapper\r\n\r\nPython wrapper to ease the calculation of Mold2 molecular descriptors.\r\n\r\n## Copyright notice\r\n\r\nMold2 is a product designed and produced by the National Center for Toxicological\r\nResearch (NCTR).<br/>FDA and NCTR retain ownership of this product.\r\n\r\nOlivier J. M. B\u00e9quignon is **neither** the copyright holder of Mold2 **nor** responsible for it.\r\n\r\nOnly the Python wrapper is the work of Olivier J. M. B\u00e9quignon.\r\n\r\n## Installation\r\n\r\nFrom source:\r\n\r\n    git clone https://github.com/OlivierBeq/Mold2_pywrapper.git\r\n    pip install ./Mold2_pywrapper\r\n\r\nwith pip:\r\n\r\n```bash\r\npip install mold2-pywrapper\r\n```\r\n\r\n### Get started\r\n\r\n```python\r\nfrom Mold2_pywrapper import Mold2\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    # cisplatin\r\n    \"N.N.Cl[Pt]Cl\"\r\n]\r\nmols = [Chem.MolFromSmiles(smiles) for smiles in smiles_list]\r\n\r\nmold2 = Mold2()\r\nprint(mold2.calculate(mols))\r\n```\r\n\r\nInstantiating a Mold2 object ensures that the executables for your platform are accessible.\r\nIf this is not the case, an attempt to download them from the\r\n[website of the FDA](https://www.fda.gov/science-research/bioinformatics-tools/mold2) is made.\r\n\r\nShould one have downloaded the original ZIP file available from the\r\n[website of the FDA](https://www.fda.gov/science-research/bioinformatics-tools/mold2), the executables can be installed\r\nusing the following:\r\n\r\n```python\r\npath_to_zipfile = '...'  # Replace by the path to the ZIP file on your machine\r\nmold2 = Mold2.from_executable(path_to_zipfile)\r\nprint(mold2.calculate(mols))\r\n```\r\n\r\nExecutables will be installed for future use. From then on, default instanciation may be carried out:\r\n\r\n```python\r\nmold2 = Mold2()\r\nprint(mold2.calculate(mols))\r\n```\r\n\r\n### Details about descriptors\r\n\r\nAny detail about the 777 Mold2 descriptors can be obtained either for a single descriptor, by providing its index:\r\n\r\n```python\r\nprint(mold2.descriptor_detail(15))\r\n# rotatable bond fraction\r\n```\r\n\r\nOr for all at once:\r\n\r\n```python\r\nprint(mold2.descriptor_details())\r\n# {\"D001\": \"number of 6-membered aromatic rings (only carbon atoms)\",\r\n#  \"D002\": \"number of 03-membered rings\",\r\n#  ...\r\n#  }\r\n```\r\n\r\n## Documentation\r\n\r\n```python\r\ndef calculate(mols, show_banner=True, njobs=1, chunksize=100):\r\n```\r\n\r\nDefault method to calculate #### Parameters\r\n\r\n- ***mols  : Iterable[Chem.Mol]***  \r\n  RDKit molecule objects for which to obtain Mold2 descriptors.\r\n- ***show_banner  : bool***  \r\n  Displays default notice about Mold2 descriptors.\r\n- ***njobs  : int***  \r\n  Maximum number of simultaneous processes.\r\n- ***chunksize  : int***  \r\n  Maximum number of molecules each process is charged of.\r\n- ***return_type  : pd.DataFramce***  \r\n  Pandas DataFrame containing Mold2 molecular descriptors.Mold2 descriptors.\r\n  If executables have not previously been downloaded, attempts to download and install them.\r\n\r\n________________\r\n\r\n```python\r\ndef descriptor_detail(index):\r\n```\r\n\r\nObtain detils about one descriptor.\r\n\r\n#### Parameters\r\n\r\n- ***index  : int***  \r\n  Index of the descriptor.\r\n- ***return_type  : str***  \r\n  Description of the descriptor.\r\n\r\n________________\r\n\r\n```python\r\ndef descriptor_details():\r\n```\r\n\r\nObtain details about all descriptors.\r\n\r\n#### Parameters\r\n\r\n- ***return_type  : dict***  \r\n  Mapping of molecular descriptors with their details.\r\n\r\n________________\r\n\r\n```python\r\ndef from_executable(zipfile_path):\r\n```\r\n\r\nInstall executables and instantiate a Mold2 calculator.\r\n\r\n#### Parameters\r\n\r\n- ***zipfile_path  : str***  \r\n  Path to the user-downloaded ZIP file containing Mold2 executables.\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python wrapper for Mold2 descriptors",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/OlivierBeq/Mold2_pywrapper"
    },
    "split_keywords": [
        "mold2",
        "molecular descriptors",
        "cheminformatics",
        "toxicoinformatics",
        "qsar"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca646466d2e14bd30be53f21b643ef76210563731edb1fb412069fe15e3fae5f",
                "md5": "e1d4f9102c5dc335f6038db9beccb77f",
                "sha256": "24638cca73b8ecd7c2b9f4bfe047c2013499b5dca24f2eb55dbaec6e287b5c05"
            },
            "downloads": -1,
            "filename": "Mold2_pywrapper-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e1d4f9102c5dc335f6038db9beccb77f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15748,
            "upload_time": "2023-08-09T06:22:17",
            "upload_time_iso_8601": "2023-08-09T06:22:17.235464Z",
            "url": "https://files.pythonhosted.org/packages/ca/64/6466d2e14bd30be53f21b643ef76210563731edb1fb412069fe15e3fae5f/Mold2_pywrapper-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca3f348ba1741c34b31cbe1a8def70933444b5d8902b858a3662649009595416",
                "md5": "cbc514c720e4677c70e347071d2d8c72",
                "sha256": "384d2b33a912b33227006f88b0bca5751536b7ab1cc4a702cf4af1a7ffcd4f67"
            },
            "downloads": -1,
            "filename": "Mold2_pywrapper-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "cbc514c720e4677c70e347071d2d8c72",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17045,
            "upload_time": "2023-08-09T06:22:18",
            "upload_time_iso_8601": "2023-08-09T06:22:18.804858Z",
            "url": "https://files.pythonhosted.org/packages/ca/3f/348ba1741c34b31cbe1a8def70933444b5d8902b858a3662649009595416/Mold2_pywrapper-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-09 06:22:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OlivierBeq",
    "github_project": "Mold2_pywrapper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "mold2-pywrapper"
}
        
Elapsed time: 0.09941s