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.3.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.3-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lefshift-0.5.3.tar.gz
Algorithm Hash digest
SHA256 b164997ada2f62fc296150abb2356d40ba7c593b7a6a5693e9124e6538aca82c
MD5 58ec058d500f67fa84da6dfa25352f2f
BLAKE2b-256 081ed31e136d2ebb99baf0acc131c38cbe3245ffc20e285ed2d527543a8690aa

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lefshift-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 15bb525af6c81f5a49662ef33c81648061eafd3c72a193cc452c1cb30324da23
MD5 5a078c4bc20f4c8b60f875d95988dfc6
BLAKE2b-256 af0f3211a4b1615c5aff3e70f5564ea7f8bb3da124c6c52d78e22b7b2fd5ed00

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