moscot.base.problems.OTProblem.set_graph_x#

OTProblem.set_graph_x(data, cost='geodesic', t=None)[source]#

Set a graph for the source quadratic term.

Parameters:
  • data (Union[DataFrame, Tuple[csr_matrix, Series]]) –

    Data containing the graph.

    • If of type DataFrame, its index and columns must be equal to adata_src.obs_names.

    • If of type tuple, it must be of the form (sp.csr_matrix, pd.Series), where the first element is the graph and the second element is the annotation of the graph.

  • cost (Literal['geodesic']) – Which graph-based distance to use.

  • t (Optional[float]) – Time parameter at which to solve the heat equation, see [Crane et al., 2013]. When t is None, t will be set to \(\epsilon / 4\), where \(\epsilon\) is the entropy regularization term. This approaches the geodesic distance and allows for linear memory complexity as the cost matrix does not have to be instantiated [Huguet et al., 2023].

Return type:

None

Returns:

: Nothing, just updates the following fields: