How gangcai/scageclock works
scAgeClock is a single-cell transcriptome age-prediction and model-training package. Its main workflow formats AnnData inputs, loads cells and age labels from H5AD files, trains or loads an aging-clock model, and returns per-cell age predictions for evaluation or export. The README also documents cross-validation, alternate model families, GMA feature importance, Monte Carlo dropout prediction, and plotting. The excerpts confirm key loader, model, orchestration, and prediction behavior; links for other documented capabilities are limited to their supported module paths.
Main entry points: scAgeClock.py Training pipeline · evaluation.py Prediction · formatting.py AnnData formatting · pytest_data H5AD datasets
Components 21
Input preparation
- AnnData formatting
scageclock/formatting.py - Input preparation
scageclock/prepare_inputs.py - Feature metadata
data/metadata/h5ad_var.tsv - H5AD datasets
data/pytest_data - Dataset loader
scageclock/dataloader.py - H5AD sampling
scageclock/h5ad_dataloader.py
Training and prediction
- CLI
scageclock/cli.py - Training pipeline
scageclock/scAgeClock.py - Prediction
scageclock/evaluation.py
Aging clock models
- Gated attention
scageclock/model/GatedMultiheadAttention.py - GMA ablation
scageclock/model/GatedMultiheadAttention_Ablation.py - MLP and linear
scageclock/model/MLP.py - Linear model
scageclock/model/Linear.py - Boosted trees
scageclock/model/XGBoost.py - CatBoost
scageclock/model/CatBoost.py - Autoencoder model
scageclock/model/autoencoder.py - Trained weights
data/trained_models/scAgeClock_GMA_model_state_dict.pth
Evaluation and results
- Validation metrics
scageclock/utility.py - Plots and importance
scageclock/visualization.py - Prediction results
Other components
- Researcher
Connections 24
- Researcher → AnnData formatting: formats data
- AnnData formatting → Input preparation: prepares inputs
- Feature metadata → AnnData formatting: defines features
- Researcher → CLI: runs prediction
- CLI → Prediction: invokes
- Researcher → Training pipeline: starts training
- H5AD datasets → Dataset loader: provides cells
- Input preparation → H5AD datasets: writes formatted data
- Training pipeline → Dataset loader: configures datasets
- Dataset loader → H5AD sampling: loads batches
- Training pipeline → Gated attention: selects model
- Training pipeline → GMA ablation: selects model
- Training pipeline → MLP and linear: selects model
- Training pipeline → Linear model: selects model
- Training pipeline → Boosted trees: selects model
- Training pipeline → CatBoost: selects model
- Training pipeline → Autoencoder model: selects model
- Prediction → Trained weights: loads weights
- Prediction → H5AD datasets: reads datasets
- Prediction → Prediction results: returns predictions
- Training pipeline → Validation metrics: computes metrics
- Training pipeline → Plots and importance: requests plots
- Prediction → Plots and importance: plots performance
- Researcher → Prediction results: receives results