Skip to content
guoruihanPublic

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

MutAtlas Release

This folder is the staging area for the public MutAtlas data and inference release.

Release Scope

Version 0.1 is intended to include:

  • Released logits data and a documented data schema.
  • Inference utilities for scoring protein mutations.
  • ESM2 model training code for distilling released logits.
  • Checkpoint loading code for future fine-tuned MutAtlas checkpoints.
  • Small examples that show how to load the data and score a mutation CSV.

Version 0.1 does not include:

  • Fine-tuned checkpoints.
  • Internal experiment outputs, caches, or camera-ready figure assets.

Fine-tuned checkpoints can be added in a later release without changing the data schema, model code, or public scoring API.

Layout

mutatlas_release/
  .gitignore
  README.md
  DATA_SCHEMA.md
  pyproject.toml
  mutatlas/
    __init__.py
    constants.py
    mutation.py
    scoring.py
    data.py
    model.py
    training.py
    inference.py
    cli.py
  scripts/
    inspect_release_data.py
    score_mutation_csv.py
    train_model.py
    infer_checkpoint.py
    convert_grouped_pickle_to_release.py
  data/
    README.md
    mutatlas-logits-v1/
      README.md
      manifest.jsonl        # generated full-data artifact, ignored by git
      metadata.json         # generated full-data artifact, ignored by git
      checksums.sha256      # generated full-data artifact, ignored by git
      shards/
        shard_00000.npz     # generated full-data artifact, ignored by git
  examples/
    README.md
    mutations.csv
    mini_manifest.jsonl
    mini_logits/
      shard_00000.npz
    expected_scores_foldx.csv

Quick Start

From this folder:

python scripts/inspect_release_data.py \
  --manifest examples/mini_manifest.jsonl \
  --limit 3 \
  --check-arrays

Score the example mutation CSV with released FoldX logits:

python scripts/score_mutation_csv.py \
  --manifest examples/mini_manifest.jsonl \
  --mutations examples/mutations.csv \
  --source foldx \
  --output examples/expected_scores_foldx.csv

This path does not require a fine-tuned checkpoint.

Model Training

Install the optional model dependencies before using training or checkpoint inference:

pip install -e ".[model]"

Train a small ESM2 logits model from the release manifest:

python scripts/train_model.py \
  --manifest data/mutatlas-logits-v1/manifest.jsonl \
  --output-dir outputs/foldx_supervised \
  --esm-model-name esm2_t12_35M_UR50D \
  --target foldx \
  --loss supervised \
  --epochs 1 \
  --batch-size 1

For a CPU smoke run, use the mini example and a small ESM2 backbone:

python scripts/train_model.py \
  --manifest examples/mini_manifest.jsonl \
  --output-dir outputs/smoke \
  --esm-model-name esm2_t6_8M_UR50D \
  --target foldx \
  --loss supervised \
  --epochs 1 \
  --batch-size 1 \
  --limit 2 \
  --device cpu

Supported loss names include the previous internal loss family: supervised, pairwise_margin, weighted_pairwise_margin, mpdl, hard_consensus, soft_consensus, disagreement_aware, kl_distillation, and weighted_kl_distillation, plus source-specific aliases such as foldx_kl_distillation and esmif_weighted_kl_distillation.

Checkpoint Inference

Checkpoints are not included in this release, but the loading path is ready. After a checkpoint is available, score mutations for a raw sequence:

python scripts/infer_checkpoint.py \
  --checkpoint outputs/foldx_supervised/final_model.pt \
  --sequence ACDEFGHIKLMNPQRSTVWY \
  --mutation A1G \
  --mutation D3N \
  --output scores.csv

Or score a sequence looked up from a manifest:

python scripts/infer_checkpoint.py \
  --checkpoint outputs/foldx_supervised/final_model.pt \
  --manifest data/mutatlas-logits-v1/manifest.jsonl \
  --id 12as_A \
  --mutations A1G,D3N \
  --output scores.csv

Full Data Export

The public full-data artifact should be staged as:

data/mutatlas-logits-v1/
  manifest.jsonl
  metadata.json
  checksums.sha256
  shards/
    shard_00000.npz
    shard_00001.npz
    ...

Generate it from the current internal grouped pickle:

python scripts/convert_grouped_pickle_to_release.py \
  --preset full \
  --input ../experiments/4.visualization/dataset_statistics/test_data_86479_structures_grouped.pkl \
  --output-dir data/mutatlas-logits-v1 \
  --entries-per-shard 1000

The generated full-data files are intentionally ignored by git. They should be uploaded as a dataset artifact, while this code folder keeps the loader, schema, and mini example.

Data Sources

The example data was converted from the local grouped logits pickle used during development. Full release data should use the same manifest and .npz array contract documented in DATA_SCHEMA.md.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages