--- license: other license_name: mixed-upstream language: - en tags: - biology - proteins - protein-language-model - contrastive-learning - embeddings - sentence-transformers - pfam - alphafold - string-db - proteingym pretty_name: ProtSent Training Data size_categories: - 100M 70, non-fragment) | | `cluster_id` | string | Foldseek structural-cluster representative | | `afdb50_cluster_id` | string | AFDB50 (50%-identity) representative | | `group_id` | string | positive-pair label; equals `cluster_id` | Sorted by `cluster_id`; single-member clusters dropped. The positive label is the Foldseek structural cluster (`cluster_id`), coarser than AFDB50 sequence identity. ### `stringdb_train.parquet` — STRING-DB v12 PPI (pair-native, 34 GB) | column | type | notes | |---|---|---| | `seq1` | string | interacting protein A | | `seq2` | string | interacting protein B | `combined_score ≥ 400`, Bernett-decontaminated and cluster-deduplicated (see Provenance). Endpoint length filter `[10, 2048]`. ### `dms_cosent.parquet` — ProteinGym DMS / clinical (pair-native, scored, 106 MB) | column | type | notes | |---|---|---| | `sentence_0` | string | sequence A | | `sentence_1` | string | sequence B | | `score` | float | fitness-similarity target for CoSENT (0–1) | 2.18M pairs over 3,576 wild-type targets and 2.09M unique mutants. ## Usage ### Load with `datasets` ```python from datasets import load_dataset pfam = load_dataset("GrimSqueaker/protsent-data", "pfam", split="train") afdb = load_dataset("GrimSqueaker/protsent-data", "afdb", split="train") stringdb = load_dataset("GrimSqueaker/protsent-data", "stringdb", split="train") dms = load_dataset("GrimSqueaker/protsent-data", "dms", split="train") ``` ### Download raw parquets (for the ProtSent training code) ```python from huggingface_hub import snapshot_download snapshot_download("GrimSqueaker/protsent-data", repo_type="dataset", local_dir="data") ``` Files land flat in `data/`. Then train: ```bash accelerate launch --num_processes 8 --mixed_precision bf16 \ protein_pipeline.py train \ --model Synthyra/ESMplusplus_large \ --files data/pfam_sorted.parquet data/afdb_sorted.parquet data/stringdb_train.parquet \ --dms_file data/dms_cosent.parquet \ --loss_mode multi --multi_primary_loss gist \ --max_seq_length 1024 --max_pairs_per_cluster 100 ``` The training code detects file type by schema: `seq1`/`seq2` → PPI pairs; `sentence_0`/`sentence_1`/`score` → DMS/CoSENT; otherwise grouped (`sequence` + `group_id`), with positive pairs formed per group. ## Provenance and filtering - **Pfam** — `Pfam-A.fasta.gz` + `Pfam-A.clans.tsv.gz` (EBI current release). MMseqs2 `easy-linclust` at 70% identity (`--cov-mode 1 -c 0.8`), family→clan join, singleton families dropped, sorted by `(clan_id, family_id)`. - **AFDB** — sequences from `willdaspit/afdb_clustered_seqs` (pLDDT > 70, non-fragment) inner-joined to the Steinegger-Lab AFDB Foldseek v6 S-cluster mapping (`cluFlag ∈ {1,2}`) on the AFDB50 representative; positive label = Foldseek cluster. - **STRING** — STRING v12.0 physical links (`combined_score ≥ 400`). Bernett decontamination: any STRING protein clustering (MMseqs2 linclust, 50% id / 80% cov) with a `Synthyra/bernett_gold_ppi` test sequence is removed. Survivors two-stage clustered (65%/85% then 50%/75%); pairs canonicalized and deduplicated per cluster-pair; endpoint length filter `[10, 2048]`. - **DMS** — `OATML-Markslab/ProteinGym_v1` (DMS + clinical, substitutions + indels). Per-assay z-scored, clipped to [−3, 3], rescaled to [0, 1]; clinical Pathogenic→0 / Benign→1. GB1 and GFP assays dropped (benchmark overlap); supervised test folds removed. Thresholds, identity cutoffs, and seeds are fixed in `data_prep.py`. ## Leakage controls - DMS and STRING are decontaminated against their downstream benchmarks (ProteinGym excluded from evaluation; Bernett test set removed from STRING). - Pfam training uses family-membership labels, disjoint from the fold-level remote-homology eval split. - AFDB uses Foldseek-cluster co-membership rather than SCOPe labels. AFDB sequences are not filtered against SCOPe test domains, so partial sequence overlap with SCOPe-40 retrieval is possible — noted in the paper as a limitation. ## Reproduce ```bash # requires MMseqs2 on PATH for pfam + stringdb python data_prep.py --dataset pfam python data_prep.py --dataset afdb --limit_gb 0 python data_prep.py --dataset stringdb --max_seq_len 2048 --min_seq_len 10 python data_prep.py --dataset dms ``` ## Citation ```bibtex @article{ofer2026protsent, title = {ProtSent: Protein Sentence Transformers}, author = {Ofer, Dan and Perets, Oriel and Linial, Michal and Rappoport, Nadav}, journal = {arXiv preprint arXiv:2605.06830}, year = {2026}, eprint = {2605.06830}, archivePrefix = {arXiv}, primaryClass = {cs.LG}, url = {https://arxiv.org/abs/2605.06830} } ``` ## License Pfam (EBI), AlphaFold DB (CC-BY-4.0), STRING (CC-BY-4.0), and ProteinGym each carry their own license.