cellflow.model.CellFlow¶
- class cellflow.model.CellFlow(adata, solver='otfm')[source]¶
CellFlow model for perturbation prediction using Flow Matching and Optimal Transport.
CellFlow builds upon neural optimal transport estimators extending [Tong et al., 2023], [Pooladian et al., 2023], [Eyring et al., 2024], [Klein et al., 2024] which are all based on Flow Matching [Lipman et al., 2022].
- Parameters:
Methods
get_condition_embedding(covariate_data[, ...])Get the embedding of the conditions.
load(filename)Load a
CellFlowmodel from a saved instance.predict(adata, covariate_data[, sample_rep, ...])Predict perturbation responses.
prepare_data(sample_rep, control_key, ...[, ...])Prepare the dataloader for training from
adata.prepare_model([condition_mode, ...])Prepare the model for training.
prepare_validation_data(adata, name[, ...])Prepare the validation data.
save(dir_path[, file_prefix, overwrite])Save the model.
train(num_iterations[, batch_size, ...])Train the model.
Attributes
The
AnnDataobject used for training.The mode of the encoder.
The data manager, initialised with
cellflow.model.CellFlow.adata.The dataloader used for training.
The solver.
The training data.
The trainer used for training.
The validation data.
The conditional velocity field.