Dataset Viewer
Full Screen
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    ValueError
Message:      invalid literal for int() with base 10: 'NC'
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 99, in get_rows_or_raise
                  return get_rows(
                File "/src/libs/libcommon/src/libcommon/utils.py", line 197, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 77, in get_rows
                  rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2097, in __iter__
                  example = _apply_feature_types_on_example(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1633, in _apply_feature_types_on_example
                  encoded_example = features.encode_example(example)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1993, in encode_example
                  return encode_nested_example(self, example)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1282, in encode_nested_example
                  {k: encode_nested_example(schema[k], obj.get(k), level=level + 1) for k in schema}
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1282, in <dictcomp>
                  {k: encode_nested_example(schema[k], obj.get(k), level=level + 1) for k in schema}
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1352, in encode_nested_example
                  return schema.encode_example(obj) if obj is not None else None
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 528, in encode_example
                  return int(value)
              ValueError: invalid literal for int() with base 10: 'NC'

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

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, [email protected] Corresponding author (Prof.): Yun Tang, [email protected]

Downloads last month
52

Collection including maomlab/AttentiveSkin