Identify silly molecules
Project description
molspotter
Disclaimer
This repository is based on the awesome silly_walks
work of Patrick Walters.
Summary
Identify silly molecules.
molspotter
helps finding unusual/silly atom arrangements in molecules.
To do so a reference dataset of molecules is used. Any fingerprint bit of a new molecule not appearing in the reference set is considered silly.
Installation
pip install molspotter
Usage
Three prepared spotters are included in molspotter
. They are respectively trained on:
- ChEMBL (version 32)
- ExCAPE-DB (Zenodo)
- Papyrus (version 05.6)
API
One can easily load a spotter as follows:
from molspotter import SillyMolSpotter
sms = SillyMolSpotter.from_pretrained('chembl')
New molecules can easily be scored using this spotter instance:
from rdkit import Chem
mol = Chem.MolFromSmiles('C=C=C1CN(C)CCN1Cc5ccc(C(=O)Nc4ccc(C)c(Nc3nccc(c2cccnc2)n3)c4)cc5')
sms.score_mol(mol)
# 0.023809523809523808
The silly bit score is defined as $score = \frac{n_{silly bits}}{n_{on bits}}$. A value of 0.0 means that the molecule does not contain any silly bit, while a value of 1.0 means the molecule is only made of silly bits.
Silly bits can also be displayed:
img = sms.show_mol(mol)
One can create their own spotter using the following:
# Instantiate a spotter with radius of Morgan fingerprint value of 2
sms = SillyMolSpotter(fp_radius=2)
sms.add_file('PATH_TO_MOLECULAR_FILE')
Finally, a spotter can be saved and loaded back from disk:
sms.save('PATH_TO_SAVE_SPOTTER_TO')
sms2 = SillyMolSpotter.from_file('PATH_TO_SAVED_SPOTTER')
Command-line interface
- Create a spotter
molspotter create -o examples/chembl_drugs.sp -i examples/chembl_drugs.sd
- Score with a spotter
molspotter score -s examples/chembl_drugs.sp -i examples/chembl_drugs.sd
molspotter score -s chembl -i examples/chembl_drugs.sd
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file molspotter-0.0.2.tar.gz
.
File metadata
- Download URL: molspotter-0.0.2.tar.gz
- Upload date:
- Size: 274.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd395376c290fa75a9970b1b7995d0d7140fb3f4fc0845f2562a431c095b51d9 |
|
MD5 | dd4f5e268e1822045df924b34795b5be |
|
BLAKE2b-256 | bcb1bc000bddf4efd642d6660fe766e748f8503106954d410cb8b53181dea657 |
File details
Details for the file molspotter-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: molspotter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 272.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f404e03de97d13c38a696d6b9c71226d83388c5616476c781fc6a817a1191a4c |
|
MD5 | 6054da24d69869def2174040f8250466 |
|
BLAKE2b-256 | eda104217b75295edbf864a2343898b04f85e915cf158beddaf53243df3baec7 |