swampfireee AptaBench Anonymous commited on
Commit
52162f8
·
0 Parent(s):

Duplicate from aptabench-anonymous/AptaBench_dataset

Browse files

Co-authored-by: AptaBench Anonymous <aptabench-anonymous@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
13
+ *.mds filter=lfs diff=lfs merge=lfs -text
14
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
+ *.model filter=lfs diff=lfs merge=lfs -text
16
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
17
+ *.npy filter=lfs diff=lfs merge=lfs -text
18
+ *.npz filter=lfs diff=lfs merge=lfs -text
19
+ *.onnx filter=lfs diff=lfs merge=lfs -text
20
+ *.ot filter=lfs diff=lfs merge=lfs -text
21
+ *.parquet filter=lfs diff=lfs merge=lfs -text
22
+ *.pb filter=lfs diff=lfs merge=lfs -text
23
+ *.pickle filter=lfs diff=lfs merge=lfs -text
24
+ *.pkl filter=lfs diff=lfs merge=lfs -text
25
+ *.pt filter=lfs diff=lfs merge=lfs -text
26
+ *.pth filter=lfs diff=lfs merge=lfs -text
27
+ *.rar filter=lfs diff=lfs merge=lfs -text
28
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
29
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
31
+ *.tar filter=lfs diff=lfs merge=lfs -text
32
+ *.tflite filter=lfs diff=lfs merge=lfs -text
33
+ *.tgz filter=lfs diff=lfs merge=lfs -text
34
+ *.wasm filter=lfs diff=lfs merge=lfs -text
35
+ *.xz filter=lfs diff=lfs merge=lfs -text
36
+ *.zip filter=lfs diff=lfs merge=lfs -text
37
+ *.zst filter=lfs diff=lfs merge=lfs -text
38
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
39
+ # Audio files - uncompressed
40
+ *.pcm filter=lfs diff=lfs merge=lfs -text
41
+ *.sam filter=lfs diff=lfs merge=lfs -text
42
+ *.raw filter=lfs diff=lfs merge=lfs -text
43
+ # Audio files - compressed
44
+ *.aac filter=lfs diff=lfs merge=lfs -text
45
+ *.flac filter=lfs diff=lfs merge=lfs -text
46
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ *.ogg filter=lfs diff=lfs merge=lfs -text
48
+ *.wav filter=lfs diff=lfs merge=lfs -text
49
+ # Image files - uncompressed
50
+ *.bmp filter=lfs diff=lfs merge=lfs -text
51
+ *.gif filter=lfs diff=lfs merge=lfs -text
52
+ *.png filter=lfs diff=lfs merge=lfs -text
53
+ *.tiff filter=lfs diff=lfs merge=lfs -text
54
+ # Image files - compressed
55
+ *.jpg filter=lfs diff=lfs merge=lfs -text
56
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
57
+ *.webp filter=lfs diff=lfs merge=lfs -text
58
+ # Video files - compressed
59
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
60
+ *.webm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - en
5
+
6
+ configs:
7
+ - config_name: default
8
+ data_files:
9
+ - split: train
10
+ path: dataset/AptaBench_dataset.csv
11
+
12
+ pretty_name: AptaBench
13
+ task_categories:
14
+ - tabular-classification
15
+ - tabular-regression
16
+ tags:
17
+ - aptamers
18
+ - small-molecules
19
+ - dna
20
+ - rna
21
+ - molecular-machine-learning
22
+ - binding-prediction
23
+ - affinity-prediction
24
+ - benchmark
25
+ - leakage-aware-evaluation
26
+ size_categories:
27
+ - 1K<n<10K
28
+ ---
29
+
30
+ <p align="center">
31
+ <img src="logo.png" width="500">
32
+ </p>
33
+
34
+
35
+ # AptaBench
36
+
37
+ AptaBench is a benchmark for aptamer–small-molecule interaction prediction. It contains curated DNA/RNA aptamer–ligand pairs with standardized sequences, canonical SMILES, experimentally grounded active/inactive labels, quantitative affinity values where available, and fixed leakage-aware evaluation splits.
38
+
39
+ This repository is provided for anonymous peer review. Author identities, affiliations, acknowledgements, citation information, and non-anonymous project links will be added after the review process.
40
+
41
+ ## Dataset summary
42
+
43
+ The current release contains 6,289 aptamer–ligand records covering 1,610 unique aptamer sequences and 942 unique ligands from eight curated sources.
44
+
45
+ The benchmark supports two tasks:
46
+
47
+ - **Binding classification**: predict active vs inactive aptamer–ligand pairs.
48
+ - **Affinity regression**: predict pKd values for entries with quantitative affinity annotations.
49
+
50
+ Inactive labels are based on reported non-binding or low-affinity observations, not synthetic random cross-pairing.
51
+
52
+ ## Files
53
+
54
+ - `dataset/AptaBench_dataset.csv`: main aptamer–ligand interaction table in CSV format.
55
+ - `dataset/AptaBench_dataset.parquet`: parquet version of the dataset for efficient loading and processing.
56
+ - `dataset/splits/`: directory containing fixed leakage-aware evaluation splits.
57
+ - `stratified.json`: stratified in-distribution 5-fold split.
58
+ - `disjoint_molecule.json`: molecule-disjoint 5-fold split.
59
+ - `disjoint_aptamer.json`: aptamer-disjoint 5-fold split.
60
+ - `dataset/make_splits.py`: script used to generate evaluation splits.
61
+
62
+ ## Data fields
63
+
64
+ - `type`: aptamer type, DNA or RNA.
65
+ - `sequence`: standardized aptamer sequence.
66
+ - `canonical_smiles`: canonical ligand SMILES.
67
+ - `pKd_value`: transformed dissociation constant value, where available.
68
+ - `label`: binary activity label; `1` = active, `0` = inactive or low-affinity.
69
+ - `buffer`: reported experimental buffer or assay condition.
70
+ - `origin`: source publication or database record.
71
+ - `source`: curated source name.
72
+
73
+ ## Evaluation splits
74
+
75
+ Each split file contains five folds with:
76
+
77
+ - `fold`: fold identifier.
78
+ - `train_idx`: zero-based row indices for training.
79
+ - `val_idx`: zero-based held-out row indices used for validation or testing.
80
+
81
+ The indices refer to rows in `AptaBench_dataset.csv`.
82
+
83
+ The three protocols are:
84
+
85
+ - **Stratified**: in-distribution evaluation.
86
+ - **Molecule-disjoint**: held-out ligands do not appear in the corresponding training fold.
87
+ - **Aptamer-disjoint**: held-out aptamer sequences do not appear in the corresponding training fold.
88
+
89
+ Random splits are not recommended because they may overestimate generalization by allowing recurring ligands or aptamer sequences across train and held-out data.
90
+
91
+ ## Loading example
92
+
93
+ ```python
94
+ import json
95
+ import pandas as pd
96
+
97
+ data = pd.read_csv("AptaBench_dataset.csv")
98
+
99
+ with open("stratified.json", "r") as f:
100
+ splits = json.load(f)
101
+
102
+ fold0 = splits[0]
103
+ train_df = data.iloc[fold0["train_idx"]]
104
+ test_df = data.iloc[fold0["val_idx"]]
105
+ ```
106
+
107
+ ## Recommended metrics
108
+
109
+ For classification, report ROC-AUC, PR-AUC, accuracy, balanced accuracy, F1-score, precision, and recall.
110
+
111
+ For affinity regression, report R², RMSE, MAE, and Spearman correlation on entries with available `pKd_value`.
dataset/AptaBench_dataset.csv ADDED
The diff for this file is too large to render. See raw diff
 
dataset/AptaBench_dataset.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f8b01685137cc495b35b50681eccf6e1fd4ade476b13067462ea5f2d6cc4459
3
+ size 112730
dataset/make_splits.py ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ import json
4
+ import numpy as np
5
+ import pandas as pd
6
+
7
+ # make src/ available
8
+ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
9
+
10
+ from data.split import (
11
+ stratified_group_splits,
12
+ disjoint_aptamer_splits,
13
+ disjoint_molecule_splits,
14
+ )
15
+
16
+ # ======================================================
17
+ # CONFIG
18
+ # ======================================================
19
+ DATASET_PATH = os.path.join(os.path.dirname(__file__), "AptaBench_dataset_v3.csv")
20
+ N_SPLITS = 5
21
+ RANDOM_STATE = 42
22
+ FRAC_TOLERANCE = 0.02 # acceptable abs deviation from expected test fraction
23
+ MAX_TRIES = 200 # retry different seeds to meet ratio
24
+
25
+ # ======================================================
26
+ # LOAD DATA
27
+ # ======================================================
28
+ df = pd.read_csv(DATASET_PATH)
29
+
30
+ # ======================================================
31
+ # MAKE OUTPUT DIR
32
+ # ======================================================
33
+ outdir = os.path.join(os.path.dirname(__file__), "splits")
34
+ os.makedirs(outdir, exist_ok=True)
35
+
36
+ # ======================================================
37
+ # HELPER TO SAVE SPLITS
38
+ # ======================================================
39
+ def save_splits(name, splits):
40
+ outpath = os.path.join(outdir, f"{name}.json")
41
+ data = []
42
+ for i, (tr, va) in enumerate(splits):
43
+ data.append({
44
+ "fold": i,
45
+ "train_idx": tr.tolist(),
46
+ "val_idx": va.tolist(),
47
+ })
48
+ with open(outpath, "w") as f:
49
+ json.dump(data, f, indent=2)
50
+ print(f"Saved {name} splits -> {outpath}")
51
+
52
+
53
+ # ======================================================
54
+ # STRATIFIED
55
+ # ======================================================
56
+ splits = stratified_group_splits(
57
+ df,
58
+ n_splits=N_SPLITS,
59
+ random_state=RANDOM_STATE,
60
+ frac_tolerance=FRAC_TOLERANCE,
61
+ max_tries=MAX_TRIES,
62
+ )
63
+ save_splits("stratified", splits)
64
+
65
+ # ======================================================
66
+ # DISJOINT APTAMER
67
+ # ======================================================
68
+ splits = disjoint_aptamer_splits(
69
+ df,
70
+ n_splits=N_SPLITS,
71
+ random_state=RANDOM_STATE,
72
+ frac_tolerance=FRAC_TOLERANCE,
73
+ max_tries=MAX_TRIES,
74
+ )
75
+ save_splits("disjoint_aptamer", splits)
76
+
77
+ # ======================================================
78
+ # DISJOINT MOLECULE
79
+ # ======================================================
80
+ splits = disjoint_molecule_splits(
81
+ df,
82
+ n_splits=N_SPLITS,
83
+ random_state=RANDOM_STATE,
84
+ scaffold_missing="separate",
85
+ frac_tolerance=FRAC_TOLERANCE,
86
+ max_tries=MAX_TRIES,
87
+ )
88
+ save_splits("disjoint_molecule", splits)
89
+
90
+ print("All splits successfully saved in dataset/splits/")
dataset/splits/disjoint_aptamer.json ADDED
The diff for this file is too large to render. See raw diff
 
dataset/splits/disjoint_molecule.json ADDED
The diff for this file is too large to render. See raw diff
 
dataset/splits/stratified.json ADDED
The diff for this file is too large to render. See raw diff
 
logo.png ADDED

Git LFS Details

  • SHA256: c339552331cd29a39947849a2ebcd9d2b0b7c948267e4b750178c08d60df247f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.11 MB