B3DB / README.md
maom's picture
fix syntax
b24613f verified
metadata
language: en
license: cc0-1.0
source_datasets: curated
task_categories:
  - tabular-classification
  - tabular-regression
tags:
  - chemistry
  - biology
  - medical
pretty_name: Blood-Brain Barrier Database (B3DB)
dataset_summary: >-
  Curation of 50 published resources of categorical and numeric measurements of
  Blood-Brain Barrier penetration.
citation: |-
  @article{
    Meng_A_curated_diverse_2021,
    author = {Meng, Fanwang and Xi, Yang and Huang, Jinfeng and Ayers, Paul W.},
    doi = {10.1038/s41597-021-01069-5},
    journal = {Scientific Data},
    number = {289},
    title = {A curated diverse molecular database of blood-brain barrier permeability with chemical descriptors},
    volume = {8},
    year = {2021},
    url = {https://www.nature.com/articles/s41597-021-01069-5},
    publisher = {Springer Nature}
  }
size_categories:
  - 1K<n<10K
config_names:
  - B3DB_classification
  - B3DB_classification_extended
  - B3DB_regression
  - B3DB_regression_extended
configs:
  - config_name: B3DB_classification
    data_files:
      - split: test
        path: B3DB_classification/test.csv
      - split: train
        path: B3DB_classification/train.csv
  - config_name: B3DB_classification_extended
    data_files:
      - split: test
        path: B3DB_classification_extended/test.csv
      - split: train
        path: B3DB_classification_extended/train.csv
  - config_name: B3DB_regression
    data_files:
      - split: test
        path: B3DB_regression/test.csv
      - split: train
        path: B3DB_regression/train.csv
  - config_name: B3DB_regression_extended
    data_files:
      - split: test
        path: B3DB_regression_extended/test.csv
      - split: train
        path: B3DB_regression_extended/train.csv
dataset_info:
  - config_name: B3DB_classification
    features:
      - name: NO.
        dtype: int64
      - name: compound_name
        dtype: string
      - name: IUPAC_name
        dtype: string
      - name: SMILES
        dtype: string
      - name: CID
        dtype: float64
      - name: logBB
        dtype: float64
      - name: BBB+/BBB-
        dtype:
          class_label:
            names:
              '0': BBB-
              '1': BBB+
      - name: Inchi
        dtype: string
      - name: threshold
        dtype: float64
      - name: reference
        dtype: string
      - name: group
        dtype: string
      - name: comments
        dtype: string
      - name: ClusterNo
        dtype: int64
      - name: MolCount
        dtype: int64
    splits:
      - name: train
        num_bytes: 656000
        num_examples: 5856
      - name: test
        num_bytes: 218640
        num_examples: 1951
  - config_name: B3DB_classification_extended
    splits:
      - name: train
        num_bytes: 76221824
        num_examples: 5856
      - name: test
        num_bytes: 25394344
        num_examples: 1951
  - config_name: B3DB_regression
    features:
      - name: NO.
        dtype: int64
      - name: compound_name
        dtype: string
      - name: IUPAC_name
        dtype: string
      - name: SMILES
        dtype: string
      - name: CID
        dtype: string
      - name: logBB
        dtype: float64
      - name: Inchi
        dtype: string
      - name: reference
        dtype: string
      - name: smiles_result
        dtype: string
      - name: group
        dtype: string
      - name: comments
        dtype: float64
      - name: ClusterNo
        dtype: int64
      - name: MolCount
        dtype: int64
    splits:
      - name: train
        num_bytes: 82808
        num_examples: 795
      - name: test
        num_bytes: 27480
        num_examples: 263
  - config_name: B3DB_regression_extended
    splits:
      - name: train
        num_bytes: 10347848
        num_examples: 795
      - name: test
        num_bytes: 3423336
        num_examples: 263

Blood-Brain Barrier Database (B3DB)

The Blood-Brain Barrier Database (B3DB) is a large benchmark dataset compiled from 50 published resources (as summarized at raw_data/raw_data_summary.tsv) and categorized based on the consistency between different experimental references/measurements. This dataset was published in Scientific Data and a mirror of the theochem/B3DB the official Github repo where it is occasionally uploaded with new experimental data. Scientists who would like to contribute data should contact the database's maintainers (e.g., by creating a new Issue in the database).

A subset of the molecules in B3DB has numerical logBB values (1058 compounds), while the whole dataset has categorical (BBB+ or BBB-) BBB permeability labels (7807 compounds). Some physicochemical properties of the molecules are also provided.

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 one of the B3DB datasets, e.g.,

>>> B3DB_classification = datasets.load_dataset("maomlab/B3DB", name = "B3DB_classification")
Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 4.40k/4.40k [00:00<00:00, 1.35MB/s]
Downloading data: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 680k/680k [00:00<00:00, 946kB/s]
Downloading data: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.11M/2.11M [00:01<00:00, 1.28MB/s]
Generating test split: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1951/1951 [00:00<00:00, 20854.95 examples/s]
Generating train split: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5856/5856 [00:00<00:00, 144260.80 examples/s]

and inspecting the loaded dataset

>>> B3DB_classification
B3DB_classification
DatasetDict({
  test: Dataset({
     features: ['NO.', 'compound_name', 'IUPAC_name', 'SMILES', 'CID', 'logBB', 'BBB+/BBB-', 'Inchi', 'threshold', 'reference', 'group', 'comments', 'ClusterNo', 'MolCount'],
     num_rows: 1951
  })
  train: Dataset({
      features: ['NO.', 'compound_name', 'IUPAC_name', 'SMILES', 'CID', 'logBB', 'BBB+/BBB-', 'Inchi', 'threshold', 'reference', 'group', 'comments', 'ClusterNo', 'MolCount'],
      num_rows: 5856
  })
})

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 a 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/B3DB', name = 'B3DB_classification')

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_classifier",
    "config": {
        "x_features": ['SMILES::morgan', 'SMILES::maccs_rdkit'],
        "y_features": ['BBB+/BBB-']}})

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

classification_suite = load_suite("classification")

scores = classification_suite.compute(
    references=split_featurised_dataset["test"]['BBB+/BBB-'],
    predictions=preds["cat_boost_classifier::BBB+/BBB-"])

About the DB3B

Features of B3DB

  1. The largest dataset with numerical and categorical values for Blood-Brain Barrier small molecules (to the best of our knowledge, as of February 25, 2021).

  2. Inclusion of stereochemistry information with isomeric SMILES with chiral specifications if available. Otherwise, canonical SMILES are used.

  3. Characterization of uncertainty of experimental measurements by grouping the collected molecular data records.

  4. Extended datasets for numerical and categorical data with precomputed physicochemical properties using mordred.

Data splits

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

Citation

Please use the following citation in any publication using our B3DB dataset:

@article{Meng_A_curated_diverse_2021,
author = {Meng, Fanwang and Xi, Yang and Huang, Jinfeng and Ayers, Paul W.},
doi = {10.1038/s41597-021-01069-5},
journal = {Scientific Data},
number = {289},
title = {A curated diverse molecular database of blood-brain barrier permeability with chemical descriptors},
volume = {8},
year = {2021},
url = {https://www.nature.com/articles/s41597-021-01069-5},
publisher = {Springer Nature}
}