Skip to main content

FRACTAL: Framework for Representation-guided Atomic ConsTruction & ALignment - A protein structure prediction system

Project description

FRACTAL

FRACTAL (Framework for Representation-guided Atomic ConsTruction & ALignment) is a research-grade protein folding system inspired by AlphaFold-style pipelines and modern protein language models (ESM-2).

Philosophy:

  • Intelligence predicts structured geometric constraints (distance distributions, contacts, torsions, confidence)
  • Deterministic code enforces geometry + physics-inspired priors

This repository intentionally does not predict raw XYZ coordinates from the neural network.

Recent Updates (AlphaFold-Style Enhancements)

New capabilities:

  • Validation loop with automatic model selection
  • Checkpointing with training state resumption
  • Learning rate scheduling (ReduceLROnPlateau)
  • Early stopping based on validation loss
  • Evaluation metrics: RMSD, TM-score, GDT-TS, contact accuracy
  • Enhanced training with better logging and error handling

Repository layout

  • src/fractal/models/ : ESM-2 backbone wrappers + lightweight constraint heads
  • src/fractal/data/ : dataset formats + preprocessing utilities
  • src/fractal/geometry/ : deterministic folding/assembly engine
  • src/fractal/training/ : trainers, losses, configs (with validation & checkpointing)
  • src/fractal/inference/ : FASTA → constraints pipeline
  • src/fractal/evaluation/ : NEW - RMSD, TM-score, GDT-TS metrics
  • scripts/ : CLI-adjacent utilities (preprocess/train/eval/infer)
  • configs/ : YAML configs
  • tests/ : unit tests (geometry + model components)

Quickstart

Create an environment and install:

  • Minimal install: pip install -e .
  • With ESM support: pip install -e '.[esm]'
  • With tests: pip install -e '.[test]'

Run CLI help:

fractal --help

Training with Validation

The new training pipeline supports:

  • Automatic validation during training
  • Best model selection based on validation loss
  • Learning rate reduction on plateau
  • Early stopping to prevent overfitting
  • Checkpoint management (keeps last N checkpoints)

Train from scratch:

python scripts/train.py configs/train.yaml

Resume from checkpoint:

python scripts/train.py configs/train.yaml --resume checkpoints/best

Config options (see configs/train.yaml):

trainer:
  epochs: 50
  validate_every_n_epochs: 1
  save_every_n_epochs: 5
  keep_last_n_checkpoints: 3
  use_lr_scheduler: true
  early_stopping_patience: 15

Evaluation

Evaluate a trained model:

python scripts/eval.py checkpoints/best data/processed/test_manifest.jsonl -o results.json

Metrics computed:

  • Distance prediction accuracy (bin classification)
  • Contact prediction accuracy (binary classification)
  • Torsion angle error (degrees)
  • Structure quality (when ground truth available):
    • RMSD (Cα atoms)
    • TM-score
    • GDT-TS

Next Steps to Reach AlphaFold Performance

  1. Scale dataset: Download 10K+ PDB structures using scripts/download_rcsb.py
  2. Add MSA features: Integrate evolutionary information via MMseqs2/HMMER
  3. Implement structure module: Replace simple optimization with learned refinement
  4. Add template features: Use homologous structure templates
  5. Distributed training: Scale to multi-GPU with PyTorch DDP

Note: the current implementation focuses on a correct modular system skeleton with proper training infrastructure. Dataset preprocessing/training loops are research-grade and ready for expansion.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fractalml-1.0.0.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fractalml-1.0.0-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

Details for the file fractalml-1.0.0.tar.gz.

File metadata

  • Download URL: fractalml-1.0.0.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fractalml-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4b04680c836742a80ce01af9ef08edd528cf3718fcc468f21416f817c2fb116f
MD5 06216ea77cbb1e8ba3b19f3d5b4b4901
BLAKE2b-256 2ece2ab587393434ab63572ec4d77eda9f560da90ec4621132176d4edbb9c276

See more details on using hashes here.

Provenance

The following attestation bundles were made for fractalml-1.0.0.tar.gz:

Publisher: publish.yml on Aayan-Mishra/FractalGPT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fractalml-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fractalml-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fractalml-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e47faa3e16e00817c83b8934064557cbda0ee189513481a8b42d82784927edc
MD5 97d71d3a954e859e58d52f0924d5ca39
BLAKE2b-256 f29aeac09eb25545526f0791dfefdc2b5efd5d5451c1278f6dedf747f6aa1bf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for fractalml-1.0.0-py3-none-any.whl:

Publisher: publish.yml on Aayan-Mishra/FractalGPT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page