moscot.base.problems.BirthDeathProblem.set_graph_x¶
- BirthDeathProblem.set_graph_x(data, cost='geodesic', t=None)¶
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 toadata_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]. Whent
isNone
,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:
- Returns:
: Nothing, just updates the following fields:
x
- the source quadratic term.stage
- set to'prepared'
.