This R script encapsulates a pipeline for estimating pseudotime using Seurat and Monocle, followed by training a machine learning model (XGBoost) to predict pseudotime and identifying important genes associated with the process.
Make sure you have the following R packages installed:
- Seurat
- monocle3
- caret
- xgboost
- Clone the repository:
git clone https://github.com/mode1990/Pseudotime-downstream-by-ML cd Pseudotime-downstream-by-ML
library(Seurat) library(monocle3) library(caret) library(xgboost)
results <- run_pseudotime_pipeline("/path/to/your/seurat_object.rds")
print(results$xgb_rmse) print(results$r2) print(results$top_genes) print(results$emb_time_terms) print(results$gene_fits)