moscot.base.problems.OTProblem.set_graph_xy¶
- OTProblem.set_graph_xy(data, cost='geodesic', t=None)[source]¶
Set a graph for the linear term for graph based distances.
- Parameters:
data (
Union[DataFrame,Tuple[csr_matrix,Series,Series]]) –Data containing the graph.
If of type
DataFrame, its index must be equal toadata_src.obs_namesand its columns toadata_tgt.obs_names.If of type
tuple, it must be of the form (sp.csr_matrix, pd.Series, pd.Series), where the first element is the graph, the second element and the third element are the annotations 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]. WhentisNone,twill 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:
- Returns:
: Nothing, just updates the following fields:
xy- the linear term.stage- set to'prepared'.