A library to quickly build QSAR models
Project description
Ersilia's LazyQSAR
A library to build supervised models for chemistry fastly.
Installation
Install LazyQSAR from source:
git clone https://github.com/ersilia-os/lazy-qsar.git
cd lazy-qsar
python -m pip install -e .
To use the default Lazy QSAR descriptors, please install them:
python -m pip install -e .[descriptors]
Binary Classification
LazyQSAR's binary classifier can run either with default descriptors or with custom descriptors passed by the user.
Built-in descriptors
Instantiate the LazyBinaryQSAR class with either of the available descriptors (chemeleon or morgan) and mode (fast, default, slow):
from lazyqsar.qsar import LazyBinaryQSAR
model = LazyBinaryQSAR(descriptor_type="chemeleon")
model.fit(smiles_list=smiles_train, y=y_train)
model.save(model_dir)
y_hat = model.predict_proba(smiles_list=smiles_test)[:,1]
Custom-made descriptors
Pre-calculate your descriptors using the preferred method. We recommend using the Ersilia Model Hub to that end. The .h5 format generated by Ersilia can be directly passed to the LazyQSAR pipeline, or, alternatively, an array with the descriptors.
from lazyqsar.agnostic import LazyBinaryClassifier
model = LazyBinaryClassifier()
model.fit(X=X_train, y=y_train)
model.save(model_dir)
y_hat = model.predict_proba(X=X_test)[:,1]
Using saved models at inference time
By default, models are saved as ONNX files. When a model is trained, you can simply load it using an artifact. In this case, the only crucial dependency is onnxruntime.
from lazyqsar.artifacts import LazyBinaryClassifierArtifact
model = LazyBinaryClassifier.load(model_dir)
y_hat = model.predict_proba(X=X)[:,1]
Tests and benchmarks
In the benchmark repository you will find the performance of the default estimators and descriptors on the TDCommons ADMET dataset. In the /tests folder you can find a quick implementation of the methods described for easily checking any change in the code. The Bioavailability dataset and chemeleon descriptors are used as an example.
Disclaimer
This library is only intended for quick-and-dirty QSAR modeling. For a more complete automated QSAR modeling, please refer to Zaira Chem
About us
Learn about the Ersilia Open Source Initiative!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lazyqsar-2.0.2.tar.gz.
File metadata
- Download URL: lazyqsar-2.0.2.tar.gz
- Upload date:
- Size: 44.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa04cb1b1fc99ac385cff2b441ed22ac17ad213c967de85f0426fd9695eac7ba
|
|
| MD5 |
853d61c11d3099846eccd0ce33201dd8
|
|
| BLAKE2b-256 |
5527bb61aab8d171fb72f679d5ad67c830b34f3b8528c618d12a53a20852e6d2
|
File details
Details for the file lazyqsar-2.0.2-py3-none-any.whl.
File metadata
- Download URL: lazyqsar-2.0.2-py3-none-any.whl
- Upload date:
- Size: 57.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddcec5b95f486745d07d1d1ea32047a36b0f98c40481638498b9692655d00e5e
|
|
| MD5 |
f248f455ad3dc73c892154bf8d7f4758
|
|
| BLAKE2b-256 |
f05a453054e480c308cd7231f4300a54816288083a85cafa700d71cb05544fe1
|