cellflow.model.CellFlow.get_condition_embedding

CellFlow.get_condition_embedding(covariate_data, rep_dict=None, condition_id_key=None, key_added='condition_embedding')[source]

Get the embedding of the conditions.

Outputs the mean and variance of the learnt embeddings generated by the ConditionEncoder.

Parameters:
  • covariate_data (DataFrame | ConditionData) –

    Can be one of

  • rep_dict (dict[str, str] | None) – Dictionary containing the representations of the perturbation covariates. Will be considered an empty dictionary if None.

  • condition_id_key (str | None) – Key defining the name of the condition. Only available if 'covariate_data' is a DataFrame.

  • key_added (str | None) – Key to store the condition embedding in uns. The mean is stored under key_added and the variance under f"{key_added}_var". If None, the embeddings are not stored.

Return type:

tuple[DataFrame, DataFrame]

Returns:

: A tuple of DataFrame with the mean and variance of the condition embeddings.