⚠️ Model availability noticePre-trained tAge models are not yet officially released.
They will be made fully available alongside the publication of the manuscript.In the meantime, if you would like to run the models, please contact us and we can assist.
Contacts: dglubokov@bwh.harvard.edu, atyshkovskii@bwh.harvard.edu
R package for transcriptomic biological age prediction from gene expression data.
devtools::install_github("Gladyshev-Lab/tAge")tAge uses Python for model prediction. Set up a virtual environment with required packages:
python -m venv .venv
.venv/bin/pip install joblib pandas scikit-learnThen in R, before running predictions:
Sys.setenv(RETICULATE_PYTHON = ".venv/bin/python")library(tAge)
# Load data
exprs_data <- read.csv("expression_matrix.csv", row.names = 1)
metadata <- read.csv("metadata.csv", row.names = 1)
eset <- make_ExpressionSet(exprs_data, metadata)
# Preprocess
tAge_eset <- tAge_preprocessing(
eset,
species = "mouse",
gene_mapping_type = "Gene.Symbol",
control_group_column = "treatment",
control_group_label = "control"
)
# Predict
model_paths <- list(
scaled_diff = "path/to/EN_scaleddiff.pkl",
yugene_diff = "path/to/EN_yugenediff.pkl"
)
Sys.setenv(RETICULATE_PYTHON = ".venv/bin/python")
results <- predict_tAge(tAge_eset, model_paths, species = "mouse", mode = "EN")library(Seurat)
# Pseudobulk aggregation by sample and tissue
eset <- aggregate_on_obs_columns(
seurat_obj,
obs_column_names = c("sample_id", "tissue"),
coverage_threshold = 1e7
)
# Remove outliers
eset_clean <- remove_outliers(eset, split_by = "tissue")
# Run tAge per tissue
results <- tAge_by_group(
eset_clean,
split_by = "tissue",
model_paths = model_paths,
species = "mouse",
mode = "EN",
control_group_column = "age",
control_group_label = "young"
)Mouse, human, rat, monkey. Non-mouse species are mapped to mouse orthologs internally.
MIT
