File size: 7,478 Bytes
889d030
 
4b6a235
889d030
 
 
4b6a235
889d030
 
 
 
 
 
5f99fd7
 
 
4b6a235
 
 
ce01506
4b6a235
ea4b663
 
 
 
ce01506
ea4b663
 
ce01506
5f99fd7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
889d030
 
4b6a235
889d030
ea4b663
4b6a235
ce01506
ea4b663
 
 
4b6a235
5f99fd7
4b6a235
ea4b663
5f99fd7
 
 
 
 
4b6a235
ea4b663
 
 
 
 
 
 
 
 
 
 
4b6a235
ea4b663
889d030
ea4b663
 
 
 
 
 
 
 
 
 
 
 
5f99fd7
 
 
 
889d030
ea4b663
 
 
 
 
889d030
ea4b663
 
 
 
 
 
 
237434f
ea4b663
237434f
5f99fd7
 
237434f
d8eb6d7
 
 
 
5f99fd7
 
ea4b663
5f99fd7
 
 
 
d8eb6d7
5f99fd7
 
ea4b663
5f99fd7
 
 
889d030
ea4b663
 
5f99fd7
 
 
4b6a235
ea4b663
5f99fd7
 
 
 
ea4b663
 
 
 
 
 
 
5f99fd7
 
ea4b663
4b6a235
5f99fd7
 
ea4b663
 
 
 
 
 
 
 
 
 
ce01506
ea4b663
 
ce01506
 
 
 
ea4b663
 
 
 
 
 
 
 
 
 
 
 
ce01506
ea4b663
 
 
 
 
 
 
4b6a235
 
889d030
4b6a235
5f99fd7
 
 
ea4b663
5f99fd7
ea4b663
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
---
license: cc-by-4.0
pretty_name: UniProtKB Processed
size_categories:
  - 100M<n<1B
task_categories:
  - feature-extraction
language:
  - en
tags:
  - biology
  - proteins
  - uniprot
  - uniprotkb
  - swiss-prot
  - trembl
  - protein-sequences
  - bioinformatics
  - train-validation-test-split
  - jsonl
configs:
  - config_name: default
    data_files:
      - split: train
        path:
          - data/train-*.jsonl.gz
      - split: test
        path:
          - data/test-*.jsonl.gz
  - config_name: sprot
    data_files:
      - split: train
        path:
          - tables/source_set=sprot/split=train/*.jsonl.gz
      - split: validation
        path:
          - tables/source_set=sprot/split=validation/*.jsonl.gz
      - split: test
        path:
          - tables/source_set=sprot/split=test/*.jsonl.gz
  - config_name: sprot_varsplic
    data_files:
      - split: train
        path:
          - tables/source_set=sprot_varsplic/split=train/*.jsonl.gz
      - split: validation
        path:
          - tables/source_set=sprot_varsplic/split=validation/*.jsonl.gz
      - split: test
        path:
          - tables/source_set=sprot_varsplic/split=test/*.jsonl.gz
  - config_name: trembl
    data_files:
      - split: train
        path:
          - tables/source_set=trembl/split=train/*.jsonl.gz
      - split: validation
        path:
          - tables/source_set=trembl/split=validation/*.jsonl.gz
      - split: test
        path:
          - tables/source_set=trembl/split=test/*.jsonl.gz
---

# UniProtKB Processed

This repository contains two useful views of LiteFold/UniProtKB:

- `default`: a compact JSONL file/table shard index that is easy to browse in the Hugging Face Dataset Viewer.
- `sprot`, `sprot_varsplic`, and `trembl`: the full parsed UniProtKB protein-entry tables from the original repository.

The `default` config does not duplicate all 203M protein rows. It indexes the repository files, table shards, source sets, source sizes, and split-level row counts so the dataset has a stable table preview while the full source-specific tables remain available through named configs.

## Dataset Summary

| Source set | Description | Protein records |
|---|---|---:|
| `sprot` | Swiss-Prot reviewed canonical proteins | 574,627 |
| `sprot_varsplic` | Swiss-Prot alternative isoform sequences | 41,333 |
| `trembl` | TrEMBL unreviewed proteins | 202,556,314 |
| **Total** |  | **203,172,274** |

Additional source totals:

| Metric | Value |
|---|---:|
| Total residues | 75,747,523,712 |
| Sequence shards | 205 |
| Protein-entry table shards | 615 |
| Default index rows | 830 |
| Sequence shard bytes | 46,504,287,641 |
| Metadata records bytes | 74,373,082,266 |
| Protein-entry table bytes | 18,549,213,567 |

## Default Index Splits

The default Dataset Viewer index is split deterministically by `sha256(file_id) % 10`: bucket `0` is `test`, and buckets `1` through `9` are `train`.

| Split | Rows |
|---|---:|
| `train` | 733 |
| `test` | 97 |

## Protein-Entry Splits

The full protein-entry tables use deterministic exact-sequence hash splits. Exact duplicate amino-acid sequences are kept in the same split.

| Split | Protein records |
|---|---:|
| `train` | 162,548,965 |
| `validation` | 20,308,533 |
| `test` | 20,314,776 |

These are exact-sequence splits, not homology-cluster splits. For strict homology-aware model evaluation, create an additional split using UniRef, MMseqs, or another sequence-clustering method.

## Loading With `datasets`

Load the default file/table index:

```python
from datasets import load_dataset

index = load_dataset("LiteFold/UniProtKB")
print(index)
print(index["train"][0])
```

Load Swiss-Prot reviewed protein entries:

```python
from datasets import load_dataset

sprot = load_dataset("LiteFold/UniProtKB", "sprot")
train = sprot["train"]
valid = sprot["validation"]
test = sprot["test"]
```

Load Swiss-Prot alternative isoform entries:

```python
from datasets import load_dataset

isoforms = load_dataset("LiteFold/UniProtKB", "sprot_varsplic")
```

Stream TrEMBL entries:

```python
from datasets import load_dataset

rows = load_dataset("LiteFold/UniProtKB", "trembl", split="train", streaming=True)
for row in rows:
    print(row["accession"], row["protein_name"])
    break
```

Use the default index to discover table shards:

```python
from datasets import load_dataset

index = load_dataset("LiteFold/UniProtKB", split="train")
trembl_train_shards = index.filter(
    lambda row: row["role"] == "protein_entry_table_shard"
    and row["source_set"] == "trembl"
    and row["table_split"] == "train"
)
print(trembl_train_shards[0]["path"])
```

## Default Columns

| Column | Type | Description |
|---|---|---|
| `file_id` | string | Stable file identifier, currently the repository path. |
| `repo_id` | string | Hugging Face dataset repository id. |
| `source_sha` | string | Source repository commit used to build the index. |
| `dataset_id` | string | Source dataset id from `_MANIFEST.json`. |
| `source_set` | string | `sprot`, `sprot_varsplic`, `trembl`, or empty for repository-level files. |
| `source_slug` | string | Source file slug used in the original manifests. |
| `source_file` | string | Original source file path. |
| `path` | string | Path in this Hugging Face repository. |
| `role` | string | File role such as `protein_entry_table_shard`, `sequence_shard`, or `metadata_records`. |
| `table_split` | string | Protein-entry split for table shards. |
| `shard_index` | int64 | Parsed shard index when present, otherwise `-1`. |
| `size_bytes` | int64 | File size in bytes. |
| `compression` | string | Compression format when applicable. |
| `records_in_source` | int64 | Protein records in the source set, otherwise `-1`. |
| `residues_in_source` | int64 | Residues in the source set, otherwise `-1`. |
| `shards_in_source` | int64 | Number of sequence shards in the source set, otherwise `-1`. |
| `records_in_table_split` | int64 | Protein records in that source set and split, otherwise `-1`. |
| `records_total` | int64 | Total protein records across UniProtKB. |
| `residues_total` | int64 | Total residues across UniProtKB. |
| `total_sequence_shards` | int64 | Total sequence shards. |
| `is_sequence_shard` | bool | Whether the row points to a FASTA sequence shard. |
| `is_table_shard` | bool | Whether the row points to a parsed protein-entry table shard. |
| `is_metadata_records` | bool | Whether the row points to metadata records. |
| `download_pattern` | string | Glob or exact path that can be used for file downloads. |
| `access_note` | string | Short note describing how to load the row's data. |
| `split_bucket` | int64 | Deterministic bucket used for the default train/test split. |

## Files

- `data/*.jsonl.gz`: default file/table index for Dataset Viewer.
- `tables/source_set=*/split=*/*.jsonl.gz`: full parsed protein-entry tables.
- `sequences/*/*.fasta.zst`: compressed source sequence shards.
- `metadata/*.records.jsonl`: source metadata records.
- `_MANIFEST.json`: source sequence manifest.
- `_POSTPROCESS_MANIFEST.json`: table-generation manifest.
- `dataset_summary.json`: summary of the default index build.
- `scripts/prepare_uniprotkb_dataset.py`: script used to generate the default index.

## License

CC BY 4.0.

## Citation

If you use the UniProtKB records, cite UniProt:

The UniProt Consortium. UniProt: the Universal Protein Knowledgebase in 2023. Nucleic Acids Research, 51(D1):D523-D531, 2023.