Skip to main content

SMPrecursorPredictor

A ML pipeline for the prediction of specialised metabolites starting substances.

Installation

Manually

  1. Clone the repository and move into the directory:
git clone
cd SMPrecursorPredictor
  1. Create a conda environment and activate it:
conda create -n sm_precursor_predictor python=3.10
conda activate sm_precursor_predictor
  1. Install the dependencies:
pip install -r requirements.txt
  1. Install the package:
pip install .

Pypi

  1. Create a conda environment and activate it:
conda create -n sm_precursor_predictor python=3.10
conda activate sm_precursor_predictor
pip install SMPrecursorPrediction

Making predictions

Models available:

  • Layered FP + Low Variance FS + Ridge Classifier
  • Morgan FP + Ridge Classifier
from sm_precursor_predictor import predict_precursors
precursors = predict_precursors(
            ["[H][C@]89CN(CCc1c([nH]c2ccccc12)[C@@](C(=O)OC)(c3cc4c(cc3OC)N(C)[C@@]5([H])[C@@]"
             "(O)(C(=O)OC)[C@H](OC(C)=O)[C@]7(CC)C=CCN6CC[C@]45[C@@]67[H])C8)C[C@](O)(CC)C9",
             "COC1=C(C=CC(=C1)C2=C(C(=O)C3=C(C=C(C=C3O2)O)O)O[C@H]4[C@@H]([C@H]([C@H]([C@H](O4)CO)O)O)O)O"],
             model="Layered FP + Low Variance FS + Ridge Classifier")
print(precursors)

or

read a csv file with a column of SMILES and a column of IDs and save the predictions in a csv file:

from sm_precursor_predictor import predict_from_csv
predictions = predict_from_csv("path_to_csv", 
                               smiles_field="SMILES", 
                               ids_field="ID",
                               model="Layered FP + Low Variance FS + Ridge Classifier")
predictions.to_csv("path_to_save_predictions.csv")

Making and explaining predictions

This is only possible with one model: Morgan FP + Ridge Classifier.

Example with linalool:

from sm_precursor_predictor import get_prediction_and_explanation

prediction, images, plots = get_prediction_and_explanation(smiles="CC(=CCCC(C)(C=C)O)C", threshold=0.20)

feature_importance

prediction
['Geranyl diphosphate']
images[0]

Linalool

Metadata

Release files for SMPrecursorPrediction 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SMPrecursorPrediction 0.0.2
File Size Uploaded
SMPrecursorPrediction-0.0.2.tar.gz 338.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SMPrecursorPrediction 0.0.2
File Interpreter ABI Platform
SMPrecursorPrediction-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 676.6 kB

Release files / SMPrecursorPrediction-0.0.2.tar.gz

Download URL SMPrecursorPrediction-0.0.2.tar.gz
Size 338.2 kB
Tags Source
SHA-256 checksum
How to use checksums
55870beb2ebded67b6a4c9a901ca774161a0958b8766a4c49e8363da2bf77810
BLAKE2b-256 checksum
How to use checksums
363c1465c1c4144be9fddb6c30d158058cacd5e569f2961142b4f07d2f73c8cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Release files / SMPrecursorPrediction-0.0.2-py3-none-any.whl

Download URL SMPrecursorPrediction-0.0.2-py3-none-any.whl
Size 338.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
455015b74bdb59ba867ccc6b6687b493416ed9a90b7666f85b5914bad4e19bdb
BLAKE2b-256 checksum
How to use checksums
1b30d5b82523924d55e3a23297a497ebbcc226115153aca3c7002a281a2b702b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page