cellflow.model.CellFlow.predict¶
- CellFlow.predict(adata, covariate_data, sample_rep=None, condition_id_key=None, key_added_prefix=None, rng=None, **kwargs)[source]¶
Predict perturbation responses.
- Parameters:
adata (
AnnData) – AnAnnDataobject with the source representation.covariate_data (
DataFrame) – Covariate data defining the condition to predict. ThisDataFrameshould have the same columns asobsofcellflow.model.CellFlow.adata, and as registered incellflow.model.CellFlow.data_manager.sample_rep (
str|None) – Key inobsmwhere the sample representation is stored or'X'to useX. IfNone, the key is assumed to be the same as for the training data.condition_id_key (
str|None) – Key in'covariate_data'defining the condition name.key_added_prefix (
str|None) – If notNone, prefix to store the prediction inobsm. IfNone, the predictions are not stored, and the predictions are returned as adict.rng (
ndarray[tuple[Any,...],dtype[float64]] |None) – Random number generator. IfNoneandcellflow.model.CellFlow.conditino_modeis'stochastic', the condition vector will be the mean of the learnt distributions, otherwise samples from the distribution.kwargs (
Any) – Keyword arguments for the predict function, i.e.cellflow.solvers.OTFlowMatching.predict()orcellflow.solvers.GENOT.predict().
- Return type:
- Returns:
: If
'key_added_prefix'isNone, adictwith the predicted sample representation for each perturbation, otherwise stores the predictions inobsmand returnsNone.