Skip to main content

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:

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.06666666666666667

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)

Silly bits highlighted in the molecular structure

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

molspotter-0.0.1.dev1.tar.gz (5.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

molspotter-0.0.1.dev1-py3-none-any.whl (5.3 MB view details)

Uploaded Python 3

File details

Details for the file molspotter-0.0.1.dev1.tar.gz.

File metadata

  • Download URL: molspotter-0.0.1.dev1.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for molspotter-0.0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 fbc28341e527966d608a5adbdea2db89345768bfdcea2c36aa73b62b9db805e9
MD5 39ffe472093e26eda689d7d7e305b24a
BLAKE2b-256 b3b9f897ace4edc726254817f0f3ded06cbf410ac8eeb01a62cc2d6544866070

See more details on using hashes here.

File details

Details for the file molspotter-0.0.1.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for molspotter-0.0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 44214891dafb96fd5f6d51868769148a442872b04cfc5fb5ce2aad00c48c6b3a
MD5 6afcb06632e2850536605149bebc06ad
BLAKE2b-256 06d4564f92bce9e67048df744bf51cd3fb8c5276fb2756bf6ba94333773f8d0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page