File size: 7,749 Bytes
4ccb372
da83ddd
4ccb372
933283f
 
 
 
36cbebb
3d02a3c
 
 
 
 
36cbebb
6845019
36cbebb
 
 
 
 
 
6845019
36cbebb
 
933283f
 
 
20ed48a
a0d1ae8
933283f
20ed48a
5096aa3
a0d1ae8
20ed48a
a0d1ae8
20ed48a
a0d1ae8
 
 
 
 
3d02a3c
933283f
20ed48a
5096aa3
3d02a3c
 
 
 
 
 
65d18f9
 
 
 
3d02a3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a0d1ae8
3d02a3c
 
 
 
 
 
a0d1ae8
 
3d02a3c
 
 
 
 
 
65d18f9
 
 
 
3d02a3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5096aa3
3d02a3c
 
 
 
 
 
 
 
65f8f8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f9d1f4f
7486ee1
 
 
 
7964533
7214de1
65f8f8c
f9d1f4f
4f41b67
f9d1f4f
b83ee17
f9d1f4f
7214de1
f9d1f4f
b83ee17
f9d1f4f
7214de1
f9d1f4f
 
7214de1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3b7ea70
7214de1
 
 
 
 
 
 
7d4e21a
7214de1
0cbca48
b83ee17
7d4e21a
7214de1
 
 
7d4e21a
7214de1
7d4e21a
b83ee17
 
1aea332
7ed241f
 
9087cf7
7ed241f
 
65f8f8c
 
 
 
 
 
 
4b8c9dc
 
65f8f8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
---
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: int64
    description: >-
      Binary classification where 'O' represents 'negative' and '1' represents 'category 1, Corr'
  - 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: int64
    description: >-
        Binary classification where 'O' represents 'negative' and '1' represents 'category 2, Irrit'          
  - 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](https://huggingface.co/docs/datasets/index) 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](https://exscientia.github.io/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)](https://doi.org/10.1021/acs.jcim.7b00166)

        
## 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