CODE NOTE 001 · 15 AUGUST 2026
How best to use MOFA to model fate-time progression?
The code and experimentation used here .
Using group structure and temporal covariates when modelling multi-modal differentiation trajectories with MOFA2.
Summary. Multi-Omics Factor Analysis (MOFA) is useful for integrating multiple molecular modalities measured across the same samples. However, standard MOFA does not explicitly model temporal relationships between observations. This becomes important when studying differentiation trajectories, where measurements at successive timepoints are biologically related rather than independent!
MOFA offers us two useful approaches to represent repeated trajectories: MOFA2's multi-group functionality and, when temporal smoothness is of interest, incorporate time explicitly using MEFISTO.
Groups encode experimental or trajectory structure, whereas MEFISTO models variation as a function of a continuous covariate such as time.
Problem
Consider a progenitor population differentiating into cell types A, B, and C over several timepoints. At each timepoint, multiple modalities may be measured, for example RNA expression, chromatin accessibility, and protein abundance.
Treating these observations as a single collection of independent samples discards an important part of the experimental design: measurements at adjacent timepoints belong to the same biological trajectory.
Recommended representation
MOFA2 supports multiple groups, allowing variation to be modelled across repeated experimental trajectories. A simplified data structure might therefore look like:
sample group time
cell_001 traj_01 0
cell_002 traj_01 2
cell_003 traj_01 4
cell_004 traj_01 6
cell_005 traj_02 0
cell_006 traj_02 2
cell_007 traj_02 4
cell_008 traj_02 6
This allows the model to distinguish variation that is shared across trajectories from variation that is specific to an individual group.
Important distinction
Groups are not equivalent to time. Assigning samples to groups does not tell vanilla MOFA that timepoint 4 follows timepoint 2, or that neighbouring timepoints should have similar latent representations.
When the temporal ordering itself is biologically meaningful, MEFISTO is the more appropriate extension. It allows latent factors to vary smoothly with continuous covariates such as developmental time.
Practical recommendation
For differentiation experiments, I would therefore treat trajectory identity and developmental time as two separate pieces of information. Use group structure to represent repeated trajectories, and use an explicit temporal covariate when the objective is to model smooth developmental dynamics.
References
- MOFA2 documentation. FAQ on the multi-group functionality. Multi-Omics Factor Analysis. biofam.github.io/MOFA2 .
- Velten B, Braunger JM, Argelaguet R, Arnol D, Wirbel J, Huber W, Stegle O. Identifying temporal and spatial patterns of variation from multi-modal data using MEFISTO. Nature Methods. 2022. MEFISTO documentation .