Skip to main content

Predict 19F chemical shift

Project description

Local Environment of Fluorine (LEF) Shift Prediction Tools

Getting Started

A PyPi package is available:

pip install lefshift

You can also clone the repo manually and then install the lefshift package:

git clone https://github.com/PatrickPenner/lefshift.git
cd lefshift
pip install .

Be aware that the data/ and model/ directory used in the following are in the lefshift repo.

Running lefshift --help should give you an overview of how to use the lefshift commandline tool. You can quickly train a model using the Enamine data in data/ like this:

lefshift train data/train.csv --model models/my_model --id-column 'Catalog ID' --shift-column 'Shift 1 (ppm)' --smiles-column 'SMILES' --verbose

Training requires 3 columns: an ID column, a chemical shift column, and a SMILES column. The above command gives the name of those columns explicitly. You can also check the lefshift train --help output to see the default column names that lefshift expects.

You can perform a prediction with the model you just trained with the following command:

lefshift predict data/test.csv --model models/my_model data/test_predicted.csv --smiles-column 'SMILES' --verbose

Prediction only requires a SMILES column. This is once again give explicitly, but you can also ensure that there is an input column named "SMILES".

To split a data set into those samples in the applicability domain of the model and those not in the applicability domain run this command:

lefshift split data/test.csv --model models/my_model data/test_known.csv data/test_unknown.csv --verbose

Splitting also only requires a SMILES column. The SMILES column in the input is already called "SMILES" so we don't have to be explicit.

For more advanced usage please check the --help output of lefshift and the subtools train, predict, and split. There is also a QM Assisted ML Tutorial.md that describes a workflow to combine lefshift and lefqm.

Development

Formatting pre-commit hook

Pre-commit is only used for consistent formatting. The core of that is the black formatter and code style.

Install the formatting pre-commit hook with:

pre-commit install

Code Quality

All quality criteria have a range of leniency.

Criteria Threshold
pylint >9.0
coverage (overall) >90%
coverage (single file) >80%

Utility commands

Pre-commit on one file:

pre-commit run --files

Test command:

python -m unittest tests

PyLint command:

pylint lefshift tests > pylint.out

Coverage commands:

coverage run -m unittest tests
coverage html

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

lefshift-0.5.2.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

lefshift-0.5.2-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file lefshift-0.5.2.tar.gz.

File metadata

  • Download URL: lefshift-0.5.2.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for lefshift-0.5.2.tar.gz
Algorithm Hash digest
SHA256 82404ba1060adcbb4bded750c9023bd504295abb70ea581d0ac948a92d9b0083
MD5 1baa06d79837958e3379763c89b8fcf0
BLAKE2b-256 a2a3213688215b8ec6eb8efdba3cd09939d8b2a280901f9f2e516fff1d0edb4c

See more details on using hashes here.

File details

Details for the file lefshift-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: lefshift-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for lefshift-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fb90f1e71f0aae2853f6dfafb6778be676fa365100e86cc6d1d38473279e983
MD5 cacad47a3fb210374527bb0f68e86b98
BLAKE2b-256 d0b153b698e9bce65cd6c8a2734f854593acdb5346bc7593df7bc4c75daa760a

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