triprorep-pretrain / README.md
hyosoon0's picture
Upload README.md with huggingface_hub
7c5c490 verified
|
Raw
History Blame Contribute Delete
1.55 kB
---
license: mit
tags:
- protein
- structure
- pretrain
- tokens
---
# K-Fold Structure Pretrain Corpus
ELECTRA pretraining corpus: 83.6M ATLAS + PDB structures, tokenized with
our backbone (aminoaseed VQ-VAE, from
[StructTokenBench](https://github.com/KatarinaYuan/StructTokenBench)) +
full-atom (CHI VQ-VAE) tokenizers.
## Format
Single LMDB. Per-record value (pickle):
```python
{
"seq": int64 [L], # AA sequence tokens
"bb": int64 [L], # backbone tokens
"fa": int64 [L], # full-atom tokens
}
```
Keyed by structure ID.
## Why sharded
The native `data.mdb` is ~654 GB, which exceeds HF's 50 GB per-file hard
limit. We byte-split into 17 parts of ~40 GB each. Reassemble before opening:
```bash
hf download k-fold-structure/triprorep-pretrain --local-dir ./pretrain.lmdb
cd ./pretrain.lmdb
cat data.mdb.part_* > data.mdb && rm data.mdb.part_*
# Now ./pretrain.lmdb/ is a valid LMDB.
```
## Quickstart
```python
import lmdb, pickle
env = lmdb.open("./pretrain.lmdb", readonly=True, lock=False, readahead=False)
with env.begin() as txn:
rec = pickle.loads(txn.get(b"<your-key>"))
print(rec["seq"].shape, rec["bb"].shape, rec["fa"].shape)
```
## Train/valid/test split
This LMDB contains all 83.6M structures pooled together, with no per-split
sub-LMDBs. For ELECTRA training, point the dataloader's ``lmdb_dir`` at
the reassembled directory and set ``train_split`` / ``val_split`` to
your own filter logic (or symlink ``train.lmdb`` → this dir if you want
to skip a validation pass).
## License
MIT