How yoakiyama/msa_pairformer works
Project type and purpose
• This is an open-source Python library (MSA Pairformer) for embedding multiple‐sequence alignments (MSAs) of protein sequences, predicting residue–residue interactions, and performing zero-shot variant effect prediction.
• It provides training code, data preprocessing, inference utilities, and Google Colab notebooks to reproduce published results and to embed/query MSAs with a parameter-efficient transformer.
File structure
• Top-level:
• MSA_Pairformer/ ← core Python package
• data/complexes/ ← sample MSA FASTA files
• MSA_Pairformer_with_MMseqs2.ipynb ← Colab notebook with end-to-end workflow
• pyproject.toml ← build and packaging config
• Core package modules:
• data_downloader.py ← external tool setup (hhfilter)
• dataset.py ← MSA ingestion, tokenization, mask generation
• positional_encoding.py ← sequence position embedding
• categorical_jacobian.py, pairwise_operations.py, outer_product.py
← tensor operations for pairwise representations
• chunk_layer.py ← sparse/chunk attention mechanism
• model.py ← MSAPairformer model class and from_pretrained() logic
• training_utils.py, regression.py
← training/inference helpers, variant effect regression head
• plotting.py ← contact map visualization
• utils.py, custom_typing.py
← misc helpers and type definitions
• External/tooling:
• HHsuite (hhfilter binary) for MSA subsampling
• HuggingFace Hub client for model weights
• PyTorch for training/inference
README for additional insights
• Data pipeline: MSA download → hhfilter subsampling → tokenization → masking
• Model usage: from_pretrained( ) → prepare inputs → get_embeddings_and_contacts()
• Output: embeddings, contact logits, sequence weights, visualizations
Detail
• Call out the hhfilter setup step under data_downloader
• How from_pretrained abstracts HuggingFace calls