IUPAC_pKa / README.md
haneulpark's picture
Update README.md
a89088c verified
metadata
version: 1.0.0
license: cc-by-nc-4.0
task_categories:
  - tabular-regression
language:
  - en
tags:
  - IUPAC
  - pKa
pretty_name: IUPAC_pKa
size_categories:
  - 10K<n<100K
dataset_summary: >-
  Curated dataset of pKa values digitized from three IUPAC reference books with
  10,624 uniqe molecules.
citation: https://doi.org/10.5281/zenodo.7236453
dataset_info:
  - config_name: IUPAC_pKa
    features:
      - name: unique_ID
        dtype: string
      - name: SMILES
        dtype: string
      - name: InChI
        dtype: string
      - name: pka_type
        dtype: string
      - name: 'Y'
        dtype: float64
      - name: T
        dtype: string
      - name: remarks
        dtype: string
      - name: method
        dtype: string
      - name: assessment
        dtype: string
      - name: ref
        dtype: string
      - name: ref_remarks
        dtype: string
      - name: entry_remarks
        dtype: string
      - name: original_IUPAC_names
        dtype: string
      - name: name_contributors
        dtype: string
      - name: num_name_contributors
        dtype: int64
      - name: original_IUPAC_nicknames
        dtype: string
      - name: source
        dtype: string
      - name: pressure
        dtype: string
      - name: acidity_label
        dtype: string
      - name: original_T
        dtype: string
      - name: solvent
        dtype: string
      - name: ClusterNo
        dtype: int64
      - name: MolCount
        dtype: int64
      - name: group
        dtype: string
    splits:
      - name: train
        num_bytes: 6849049
        num_examples: 18168
      - name: test
        num_bytes: 2191280
        num_examples: 6054
    download_size: 1465758
    dataset_size: 9040329
  - config_name: default
    features:
      - name: unique_ID
        dtype: string
      - name: SMILES
        dtype: string
      - name: InChI
        dtype: string
      - name: pka_type
        dtype: string
      - name: 'Y'
        dtype: float64
      - name: T
        dtype: string
      - name: remarks
        dtype: string
      - name: method
        dtype: string
      - name: assessment
        dtype: string
      - name: ref
        dtype: string
      - name: ref_remarks
        dtype: string
      - name: entry_remarks
        dtype: string
      - name: original_IUPAC_names
        dtype: string
      - name: name_contributors
        dtype: string
      - name: num_name_contributors
        dtype: int64
      - name: original_IUPAC_nicknames
        dtype: string
      - name: source
        dtype: string
      - name: pressure
        dtype: string
      - name: acidity_label
        dtype: string
      - name: original_T
        dtype: string
      - name: solvent
        dtype: string
      - name: ClusterNo
        dtype: int64
      - name: MolCount
        dtype: int64
      - name: group
        dtype: string
    splits:
      - name: train
        num_bytes: 6849049
        num_examples: 18168
      - name: test
        num_bytes: 2191280
        num_examples: 6054
    download_size: 1465758
    dataset_size: 9040329
configs:
  - config_name: IUPAC_pKa
    data_files:
      - split: train
        path: IUPAC_pKa/train-*
      - split: test
        path: IUPAC_pKa/test-*
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: test
        path: data/test-*

IUPAC_pKa

IUPAC_pKa dataset contains high-confidence pKa values digitized from three IUPAC reference books, with chemical identifiers (SMILES, InChI) and metadata on acidity, temperature, solvent, and measurement methods. The dataset consists of 24,222 rows corresponding to 10,624 uniqe molecules. This is a mirror of the Official Github repo where the dataset v2_2 was uploaded.

Preprocessing

We utilized the raw data uploaded on Github and performed several preprocessing:

  1. Sanitize the molecules using RDKit and MolVS (standardize SMILES format)
  2. Rename the columns
  3. Split the dataset (train, test, validation)

If you would like to try these processes with the original dataset, please follow the instructions in the preprocessing script file located in our IUPAC_pKa repository.

Data splits

The original IUPAC_pKa dataset does not define splits, so here we have used the 'Realistic Split' method described in Martin et al., 2018.

Quickstart Usage

Load a dataset in python

Each subset can be loaded into python using the Huggingface datasets library. First, from the command line install the datasets library

$ pip install datasets

then, from within python load the datasets library

>>> import datasets

and load the IUPAC_pKa datasets, e.g.,

>>> IUPAC_pKa = datasets.load_dataset('maomlab/IUPAC_pKa')
README.md: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5.06k/5.06k [00:00<00:00, 771kB/s]
train-00000-of-00001.parquet: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 947k/947k [00:00<00:00, 34.0MB/s]
test-00000-of-00001.parquet: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 519k/519k [00:00<00:00, 23.5MB/s]
Generating train split: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 18168/18168 [00:00<00:00, 260823.23 examples/s]
Generating test split: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 6054/6054 [00:00<00:00, 231724.00 examples/s]

and inspecting the loaded dataset

>>> IUPAC_pKa
DatasetDict({
    train: Dataset({
        features: ['unique_ID', 'SMILES', 'InChI', 'pka_type', 'Y', 'T', 'remarks', 'method', 'assessment', 'ref', 'ref_remarks', 'entry_remarks', 'original_IUPAC_names', 'name_contributors', 'num_name_contributors', 'original_IUPAC_nicknames', 'source', 'pressure', 'acidity_label', 'original_T', 'solvent', 'ClusterNo', 'MolCount', 'group'],
        num_rows: 18168
    })
    test: Dataset({
        features: ['unique_ID', 'SMILES', 'InChI', 'pka_type', 'Y', 'T', 'remarks', 'method', 'assessment', 'ref', 'ref_remarks', 'entry_remarks', 'original_IUPAC_names', 'name_contributors', 'num_name_contributors', 'original_IUPAC_nicknames', 'source', 'pressure', 'acidity_label', 'original_T', 'solvent', 'ClusterNo', 'MolCount', 'group'],
        num_rows: 6054
    })
})

Use a dataset to train a model

One way to use the dataset is through the MolFlux package developed by Exscientia. First, from the command line, install MolFlux library with catboost and rdkit support

pip install 'molflux[catboost,rdkit]'

then load, featurize, split, fit, and evaluate the catboost model

import json
from datasets import load_dataset
from molflux.datasets import featurise_dataset
from molflux.features import load_from_dicts as load_representations_from_dicts
from molflux.splits import load_from_dict as load_split_from_dict
from molflux.modelzoo import load_from_dict as load_model_from_dict
from molflux.metrics import load_suite

split_dataset = load_dataset('maomlab/IUPAC_pKa')

split_featurised_dataset = featurise_dataset(
  split_dataset,
  column = "SMILES",
  representations = load_representations_from_dicts([{"name": "morgan"}, {"name": "maccs_rdkit"}]))

model = load_model_from_dict({
    "name": "cat_boost_regressor",
    "config": {
        "x_features": ['SMILES::morgan', 'SMILES::maccs_rdkit'],
        "y_features": ['Y']}})

model.train(split_featurised_dataset["train"])
preds = model.predict(split_featurised_dataset["test"])

regression_suite = load_suite("regression")

scores = regression_suite.compute(
    references=split_featurised_dataset["test"]['Y'],
    predictions=preds["cat_boost_regressor::Y"])

Citation

Zheng, Jonathan W. and Lafontant-Joseph, Olivier. (2024) IUPAC Digitized pKa Dataset, v2.2. Copyright Β© 2024 International Union of Pure and Applied Chemistry (IUPAC), The dataset is reproduced by permission of IUPAC and is licensed under a CC BY-NC 4.0. Access at https://doi.org/10.5281/zenodo.7236453.