AttentiveSkin / README.md
haneulpark's picture
Update README.md
b83ee17 verified
metadata
language: en
license: mit
tags:
  - chemistry
  - toxicology
pretty_name: AttentiveSkin
dataset_summary: >-
  Compiled GHS dataset comprising 731 Corrosion, 1283 Irritation, and 1205
  Negative samples from 6 governmental databases and 2 external datasets. 
  Results of the two binary tasks (Corr vs Neg, Irrit vs Neg) will be generated
  separately.
citation: |-
  @article{,
    author = {Zejun Huang and Shang Lou and Haoqiang Wang and Weihua Li and Guixia Liu, and Yun Tang},
    doi = {10.1021/acs.chemrestox.3c00332},
    journal = {Journal of Chemical Information and Modeling},
    number = {2},
    title = {AttentiveSkin: To Predict Skin Corrosion/Irritation Potentials of Chemicals via Explainable Machine Learning Methods},
    volume = {37},
    year = {2024},
    url = {https://pubs.acs.org/doi/10.1021/acs.chemrestox.3c00332},
    publisher = {ACS publications}
  }
size_categories:
  - 1K<n<10K
config_names:
  - Corr_Neg
  - Irrit_Neg
configs:
  - config_name: Corr_Neg
    data_files:
      - split: test
        path: Corr_Neg/test.csv
      - split: train
        path: Corr_Neg/train.csv
  - config_name: Irrit_Neg
    data_files:
      - split: test
        path: Irrit_Neg/test.csv
      - split: train
        path: Irrit_Neg/train.csv
dataset_info:
  - config_name: Corr_Neg
    features:
      - name: Name
        dtype: string
      - name: Synonym
        dtype: string
      - name: CAS RN
        dtype: string
      - name: 'Y'
        dtype:
          class_label:
            names:
              '0': NC
              '1': Cat 1
      - name: Detailed Page
        dtype: string
      - name: Evidence
        dtype: string
      - name: OECD TG 404
        dtype: string
      - name: Data Source
        dtype: string
      - name: Frequency
        dtype: int64
      - name: SMILES
        dtype: string
      - name: SMILES URL
        dtype: string
      - name: SMILES Source
        dtype: string
      - name: Canonical SMILES
        dtype: string
      - name: Split
        dtype: string
    splits:
      - name: train
        num_bytes: 196688
        num_examples: 1755
      - name: test
        num_bytes: 20400
        num_examples: 181
  - config_name: Irrit_Neg
    features:
      - name: Name
        dtype: string
      - name: Synonym
        dtype: string
      - name: CAS RN
        dtype: string
      - name: 'Y'
        dtype:
          class_label:
            names:
              '0': NC
              '1': Cat 2
      - name: Detailed Page
        dtype: string
      - name: Evidence
        dtype: string
      - name: OECD TG 404
        dtype: string
      - name: Data Source
        dtype: string
      - name: Frequency
        dtype: int64
      - name: SMILES
        dtype: string
      - name: SMILES URL
        dtype: string
      - name: SMILES Source
        dtype: string
      - name: Canonical SMILES
        dtype: string
      - name: Split
        dtype: string
    splits:
      - name: train
        num_bytes: 249776
        num_examples: 2229
      - name: test
        num_bytes: 29136
        num_examples: 259
task_categories:
  - tabular-classification

Attentive Skin

To Predict Skin Corrosion/Irritation Potentials of Chemicals via Explainable Machine Learning Methods Download: https://github.com/BeeBeeWong/AttentiveSkin/releases/tag/v1.0

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 AttentiveSkin datasets, e.g.,

>>> Corr_Neg = datasets.load_dataset("maomlab/AttentiveSkin", name = 'Corr_Neg')
Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 64.0k/64.0k [00:00<00:00, 11.7kkB/s] 
Downloading data: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.02M/1.02M [00:00<00:00, 4.88MkB/s]
Generating test split: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 181/181 [00:00<00:00, 3189.72examples/s]
Generating train split: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1755/1755 [00:00<00:00, 19806.87examples/s] 

and inspecting the loaded dataset

>>> Corr_Neg
DatasetDict({
test: Dataset({
    features: ['Name', 'Synonym', 'CAS RN', 'Y', 'Detailed Page', 'Evidence', 'OECD TG 404', 'Data Source', 'Frequency', 'SMILES', 'SMILES URL', 'SMILES Source', 'Canonical SMILES', 'Split'],
    num_rows: 181
})
train: Dataset({
    features: ['Name', 'Synonym', 'CAS RN', 'Y', 'Detailed Page', 'Evidence', 'OECD TG 404', 'Data Source', 'Frequency', 'SMILES', 'SMILES URL', 'SMILES Source', 'Canonical SMILES', 'Split'],
    num_rows: 1755
})

})

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/AttentiveSkin', name = 'Corr_Neg')

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": ['Y']}})

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"]['Y'],
    predictions=preds["cat_boost_classifier::Y"])

Data splits

Here we have used the Realistic Split method described in (Martin et al., 2018)

AttentiveSkin

To Predict Skin Corrosion/Irritation Potentials of Chemicals via Explainable Machine Learning Methods Download: https://github.com/BeeBeeWong/AttentiveSkin/releases/tag/v1.0

Tutorial

Basic:

AttentiveSkin is a software used for predicting GHS-defined (the Globally Harmonized System of Classification and Labeling of Chemicals) Skin Corrosion/Irritation labels of chemicals. Download and unzip the "AttentiveSkin_v1.0.zip" at the URL above. Place the file "AttentiveSkin.exe" and dir "dependency" in the same directory. Launch the "AttentiveSkin.exe" and wait until the GUI being initialized.

Input:

The input SMILES can be listed to the first column in .txt or .tsv files. User can follow the manner of example in "./example/input.txt". Click the button "Input" to open the text file containing input SMILES.

Output:

The interpretable prediction containing attetion weights will be placed in .html files, while basic info will be written to .xlsx files. Results of the two binary tasks (Corr vs Neg, Irrit vs Neg) are generated separately. Click the button "Output" to select the directory to store the prediction results.

Citation

Cite this: Chem. Res. Toxicol. 2024, 37, 2, 361–373 Publication Date:January 31, 2024 https://doi.org/10.1021/acs.chemrestox.3c00332 Copyright Β© 2024 American Chemical Society

Contact

Developer: Zejun Huang, incorrectwong11@gmail.com Corresponding author (Prof.): Yun Tang, ytang234@ecust.edu.cn