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.tar.gz (274.5 kB 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-py3-none-any.whl (272.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: molspotter-0.0.1.tar.gz
  • Upload date:
  • Size: 274.5 kB
  • 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.tar.gz
Algorithm Hash digest
SHA256 4bfb3c452a80a7623609ae4e2ff57be31c9f4ac835263912d668fcf26a9c12a8
MD5 2d0cb4a1c766383672159f0324ebf45b
BLAKE2b-256 327497bae672173d950c16ab50c525f9d117bbabc9b14c9d335727e4b4ab252c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: molspotter-0.0.1-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.10.8

File hashes

Hashes for molspotter-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0cc403d9af53db0ee88ee86d48a4ec362a0d969276ed9d86d0387e7fa8c6b168
MD5 3576350b24142e9e90b461731c7938af
BLAKE2b-256 60d109e40fb5682c5f80426cf931de4816e899fd8f504c714395dd16c06c30fb

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