Skip to main content

Cheminformatics tools for astrochemistry

Project description

https://img.shields.io/pypi/v/astrochem_ml.svg https://img.shields.io/travis/laserkelvin/astrochem_ml.svg Documentation Status

Doing astrochemistry with robots.

The astrochem_ml package is designed for bringing accessible cheminformatics to astrochemical discovery. The main features, some of which are currently active development, are interfaces to common operations using RDKit that are relevant to astrochemistry, and pre-trained embedding models ready for machine learning projects that combine molecules and astrophysics.

The plan is to deliver a general purpose library, in addition to providing a command line interface to several common tasks.

Installation

Not yet on PyPI, and so for now you can install astrochem_ml via:

`pip install git+https://github.com/laserkelvin/astrochem_ml`

Features

Molecule generation

A significant amount of functionality wraps the rdkit package, the main library for doing cheminformatics in Python. For all molecule interactions, we go back and forth between the native rdkit objects and SMILES/SMARTS strings.

  • Exhaustive isotopologue generation in SMILES

>>> from astrochem_ml.smiles import isotopes
# exhaustively enumerate all possible combinations isotopologues
# user can set the threshold for natural abundance and whether
# to include hydrogens
>>> isotopes.generate_all_isos("c1ccccc1", explicit_h=False)
['c1[13cH]c[13cH][13cH][13cH]1', ... 'c1ccccc1', '[13cH]1[13cH][13cH][13cH][13cH][13cH]1','c1c[13cH][13cH][13cH]c1']
  • Functional group substitutions

Replace substructures with other ones in a tree data structure!

>>> from astrochem_ml.smiles import MoleculeGenerator
# randomly grow out possible structures starting from benzene,
# and iteratively replace structures with other functional groups
>>> benzene = MoleculeGenerator("c1ccccc1", substructs=["c", "cC#N", "cC=O", "cN"])
>>> benzene.grow_tree(50)
100%|██████████████████████████████████████████████████████████████████| 50/50 [00:00<00:00, 237.44it/s]
>>> print(benzene)
c1ccccc1
├── Nc1ccccc1
├── N#Cc1ccccc1
└── O=Cc1ccccc1
├── Nc1ccccc1C=O
   └── N#Cc1ccccc1C=O
├── Nc1cccc(C=O)c1
   ├── Nc1cccc(C=O)c1N
      ├── Nc1c(C=O)ccc(C=O)c1N
      ├── Nc1cc(C=O)cc(C=O)c1N
...

This provides a high level interface to view every structure generated, and from which parent.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

astrochem_ml-0.1.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

astrochem_ml-0.1.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file astrochem_ml-0.1.1.tar.gz.

File metadata

  • Download URL: astrochem_ml-0.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.9.1 Linux/5.13.0-7620-generic

File hashes

Hashes for astrochem_ml-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9e54ebc4c420199f1cd240e5ef14ea743695bd87726bc7a1dd68b04f483696ac
MD5 84d1e1a8d3746a921c290d0dad420405
BLAKE2b-256 53776d496390001babc3eb40866c3103e09657cc9a11227325b5cd14a8208a67

See more details on using hashes here.

File details

Details for the file astrochem_ml-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: astrochem_ml-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.9.1 Linux/5.13.0-7620-generic

File hashes

Hashes for astrochem_ml-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b3053c872e0c3549e8e274ada63890e6f31a24a8c57ef63570dfc4d0aca5ff8
MD5 81a69e8751f077640064226f7b68a014
BLAKE2b-256 8ba90ee183e046697729e2e517edb8f8741bc18e14f1fd346dac2fc73514de4c

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