PaTz β€” Physics-Aware Transformer with eXplainability
● API Offlinepatz_env

Data Preprocessing

COMPLETE

4-stage pipeline: UniProtKB acquisition β†’ ESM-2 embedding extraction β†’ GO annotation processing β†’ MMseqs2 cluster-based splitting. All 2,620 proteins processed.

🧬
2,620
Total Proteins
HIV-1 + M. tuberculosis
πŸ“‹
354
GO Vocab Size
min 5 proteins/term
πŸ“
280 aa
Median Seq Len
range 30–1,011
πŸ”¬
841
Proteins w/ PDB
32% structural coverage
Pipeline Stages
01
Data Acquisitionscripts/01_acquire_data.pyβœ“ DONE

Downloads HIV-1 (taxid 11676) and M. tuberculosis (taxid 83332) protein sequences from UniProtKB/Swiss-Prot. Filters to reviewed entries only. Fetches Gene Ontology annotations (MF, BP, CC namespaces).

data/raw/hiv1_proteins.jsonldata/raw/mtb_proteins.jsonl
02
ESM-2 Embedding Extractionscripts/02_extract_embeddings.pyβœ“ DONE

Loads facebook/esm2_t33_650M_UR50D from HuggingFace. Extracts per-residue embeddings (1280-dim) for all 2,620 proteins. Saves to HDF5 cache. Sequences >1,011 residues are truncated to model max length (1022 tokens).

data/embeddings/embeddings.h5data/embeddings/embedding_index.json
03
Sequence Cleaning & GO Parsingsrc/data/ (pipeline)βœ“ DONE

Removes proteins with zero GO annotations (219 removed β†’ 2,620 retained). Builds GO vocabulary of 354 most-frequent terms (min 5 proteins per term). Computes inverse-frequency class weights for imbalanced multilabel loss.

data/processed/all_proteins.jsonldata/processed/go_vocabulary.jsondata/processed/go_class_weights.npy
04
MMseqs2 Sequence ClusteringMMseqs2 (external)βœ“ DONE

Clusters all proteins at 30% sequence identity to prevent data leakage. Cluster-level stratified split: train 1,833 / val 262 / test 525. Ensures no homologous sequences appear in both train and test.

data/processed/split_manifest.jsondata/processed/train.jsonldata/processed/val.jsonldata/processed/test.jsonl
Sequence Length Distribution (approx.)
Loading chart…
MMseqs2 Cluster-Based Split
Loading chart…
Dataset Composition
FieldValueNotes
Total proteins2,620After removing proteins with 0 GO annotations
HIV-1 proteins~847UniProtKB Swiss-Prot, taxid 11676
M. tuberculosis proteins~1,773UniProtKB Swiss-Prot, taxid 83332
Proteins with PDB structure841 (32%)Has CΞ± coordinates for physics loss
GO vocabulary size354Terms with β‰₯5 annotated proteins
Mean GO terms/protein4.69Sparse multilabel annotation
Split methodMMseqs2 30%Cluster-level to prevent data leakage
Sequence length range30 – 1,011 aaMedian 280 aa, mean 318 aa
Embedding dimension1,280ESM-2 650M per-residue