came.make_features

came.make_features(adatas, vars1: Sequence, vars2: Sequence, df_varmap: DataFrame, col_weight: str | None = None, union_node_feats: bool = True, keep_non1v1: bool = True, non1v1_trans_to: int = 0)

Decide and make a pair of aligned feature matrices for CAME input.

Parameters:
  • adatas – a pair of sc.AnnData

  • vars1 – variable-names in adatas[0], as the candidates

  • vars2 – variable-names in adatas[1], as the candidates

  • df_varmap – A pd.DataFrame with (at least) 2 columns. variable mappings between features in the given pair of datasets.

  • col_weight – a column name in df_varmap, used for weighted-average-transformation of the non-1v1 features.

  • union_node_feats (bool) – whether to take the union of the cell-node features

  • keep_non1v1 (bool) – whether to take into account the non-1v1 variables as the node features.

  • non1v1_trans_to (int) – the direction to transform non-1v1 features, should either be 0 or 1. Set as 0 to transform query data to the reference (default), 1 to transform the reference data to the query. If set keep_non1v1_feats=False, this parameter will be ignored.

Returns:

  • features (a tuple of length 2)

  • trans (pp.AdjacentTrans)