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
a
DataFramedefining the conditions with the same columns as theAnnDataused for the initialisation ofCellFlow.an instance of
ConditionData.
rep_dict (
dict[str,str] |None) – Dictionary containing the representations of the perturbation covariates. Will be considered an empty dictionary ifNone.condition_id_key (
str|None) – Key defining the name of the condition. Only available if'covariate_data'is aDataFrame.key_added (
str|None) – Key to store the condition embedding inuns. The mean is stored underkey_addedand the variance underf"{key_added}_var". IfNone, the embeddings are not stored.
- Return type:
tuple[DataFrame,DataFrame]- Returns:
: A
tupleofDataFramewith the mean and variance of the condition embeddings.