ChemoPy2
A Python library calculating molecular descriptors.
💪 Getting Started
from chemopy import ChemoPy
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",
]
# Ensure hydrogens are explicit
mols = [Chem.AddHs(Chem.MolFromSmiles(smiles)) for smiles in smiles_list]
cmp = ChemoPy()
print(cmp.calculate(mols))
The above calculates 632 two-dimensional (2D) molecular descriptors.
The additional 552 three-dimensional (3D) molecular descriptors can be computed as follows:
⚠️ Molecules are required to have conformers for descriptors to be calculated.
from rdkit.Chem import AllChem
# Ensure molecules have 3D conformations
for mol in mols:
_ = AllChem.EmbedMolecule(mol)
cmp = ChemoPy(ignore_3D=False)
print(cmp.calculate(mols))
To obtain 11 2D molecular fingerprints with default folding size, one can use the following:
from chemopy import Fingerprint
for mol in mols:
print(Fingerprint.get_all_fps(mol))
Other methods of the Fingerprint submodule allow to change folding size and depth of the compatible fingerprints.
Currently, only one 3D fingerprint may be obtained with the following:
from chemopy import Fingerprint3D
for mol in mols:
print(Fingerprint3D.get_all_fps(mol))
Conveniently, the calculation of molecular descriptors and fingerprints can be coupled:
# 2D molecular descriptors and fingerprints
cmp = ChemoPy(include_fps=True)
print(cmp.calculate(mols))
# 2D and 3D molecular descriptors and fingerprints
cmp = ChemoPy(ignore_3D=False, include_fps=True)
print(cmp.calculate(mols))
Finally, details on either one or all molecular descriptors can be obtained like so:
# Obtain details about Thara
print(cmp.get_details('Thara'))
# Obtain details for all descriptors and fingerprints
print(cmp.get_details())
🚀 Installation
ChemoPy requires OpenMOPAC and OpenBabel to be installed.
conda install openbabel mopac -c conda-forge
The most recent release can be installed from PyPI with:
$ pip install chemopy2
The most recent code and data can be installed directly from GitHub with:
$ pip install git+https://github.com/OlivierBeq/chemopy.git
👐 Contributing
Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See CONTRIBUTING.md for more information on getting involved.
👋 Attribution
📖 Citation
- Cao et al., ChemoPy: freely available python package for computational biology and chemoinformatics. Bioinformatics 2013; 29(8), 1092–1094. doi:10.1093/bioinformatics/btt105
🍪 Cookiecutter
This package was created with @audreyfeldroy's cookiecutter package using @cthoyt's cookiecutter-snekpack template.
Metadata
Release files for chemopy2 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chemopy2-1.1.0.tar.gz | 112.4 kB | Without provenance | Details for chemopy2-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chemopy2-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for chemopy2-1.1.0-py3-none-any.whl |
Total release size: 205.0 kB
Release files / chemopy2-1.1.0.tar.gz
| Download URL | chemopy2-1.1.0.tar.gz |
|---|---|
| Size | 112.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c83242235fbe7e04ee1cc122b0631b2371a6f7002e665aaa7237862b7c6bdcf1
|
|
BLAKE2b-256 checksum How to use checksums |
fd8b2c5e72d991f786b234d9976a4414184dd0f39d9a0248f0af785f552a9c44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / chemopy2-1.1.0-py3-none-any.whl
| Download URL | chemopy2-1.1.0-py3-none-any.whl |
|---|---|
| Size | 92.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
449320a2a91a92806e8ff77eeae1b74d0e04409f3a02d781955edf15485c3ebf
|
|
BLAKE2b-256 checksum How to use checksums |
827ae8cc7093596b5c7098260eb7961a8ca75cf527f9a4f02415d1c782535dde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for chemopy2 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.