Skip to main content

CDDD models in ONNX format with automatic model downloading

Project description

CDDD-ONNX

This package provides CDDD (Continuous and Data-Driven Descriptors) models in ONNX format with automatic model downloading capabilities. This is an ONNX runtime version of the original CDDD package.

Limitations

  • Currently, only the encoder model is implemented. The decoder uses TensorFlow-specific opcodes that are not supported by ONNX. I am working on a solution.

Installation

pip install cddd-onnx

Usage

Command Line Interface

Extract molecular descriptors from SMILES using the command line interface:

cddd-onnx --input smiles.smi --output descriptors.csv

For CSV files with a custom SMILES column header:

cddd-onnx --input molecules.csv --output descriptors.csv --smiles_header smiles_column

Python Interface

The format is the same as in the original CDDD package. Just import cddd_onnx instead of cddd:

from cddd_onnx import InferenceModel
# Create model instance
model = InferenceModel()

smiles_list = ["CCCCO", "CCCN", "CC1=CC=CC=C1"]
embeddings = model.seq_to_emb(smiles_list)
  • The preprocessing stage is inside the seq_to_emb function, so you do not need to run it separately.
  • Be aware that if the SMILES is out of AD, the preprocessor returns None, resulting in a row of NaNs for such compounds.

Input Formats

Supported input formats:

  • CSV files with SMILES column
  • SMI files (one SMILES per line)

Models

The models are automatically downloaded to ~/.cddd_onnx/models/ directory when first used.

Requirements

  • onnxruntime
  • numpy
  • pandas
  • tqdm
  • rdkit

License

MIT License

Citation

If you use this software, please cite the original CDDD paper:

@article{Winter2019,
  title = {Learning continuous and data-driven molecular descriptors by translating equivalent chemical representations},
  volume = {10},
  ISSN = {2041-6539},
  url = {http://dx.doi.org/10.1039/C8SC04175J},
  DOI = {10.1039/c8sc04175j},
  number = {6},
  journal = {Chemical Science},
  publisher = {Royal Society of Chemistry (RSC)},
  author = {Winter,  Robin and Montanari,  Floriane and Noé,  Frank and Clevert,  Djork-Arné},
  year = {2019},
  pages = {1692–1701}
}

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

cddd_onnx-0.1.0.tar.gz (453.5 kB view details)

Uploaded Source

Built Distribution

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

cddd_onnx-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file cddd_onnx-0.1.0.tar.gz.

File metadata

  • Download URL: cddd_onnx-0.1.0.tar.gz
  • Upload date:
  • Size: 453.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for cddd_onnx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abd441d006d61589fff77a70712b85c264c91290cfcd12801a998f07ad0faedd
MD5 381fb3e23edd52d1cddf958cd18c3243
BLAKE2b-256 bc277596d53b8773fa1436906ae847919de8f30652d057e60c093e8826ea585b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cddd_onnx-0.1.0.tar.gz:

Publisher: publish.yml on sergsb/cddd-onnx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cddd_onnx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cddd_onnx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for cddd_onnx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7711f7c9a913787fdfb1bb511347b2387472603a64a7f05e1451f434a664235
MD5 9d5fbed4df2a190c0a43aafd7dbfe111
BLAKE2b-256 a9c597c6f622497c809645a978135647270b2d08a6053db1e9fa3dca11818ac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cddd_onnx-0.1.0-py3-none-any.whl:

Publisher: publish.yml on sergsb/cddd-onnx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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