moscot.base.problems.OTProblem.pull¶
- OTProblem.pull(data=None, subset=None, normalize=True, *, split_mass=False, scale_by_marginals=False)[source]¶
Pull data through the
transport_matrix
.- Parameters:
data (
Union
[str
,ndarray
[Any
,dtype
[float64
]],None
]) –Data to pull through the transport matrix. Valid options are:
ndarray
- array of shape[m,]
or[m, d]
.str
- key inadata_tgt.obs['{data}']
. Ifsubset
is alist
, the data will be a boolean mask determined by the subset. Useful for categorical data.None
- the value depends on thesubset
.list
- names inadata_tgt.obs_names
to pull.tuple
- start and offset indices \((subset[0], subset[0] + subset[1])\). that define a boolean mask to pull.None
- uniform array of \(1\).
subset (
Union
[str
,List
[str
],Tuple
[int
,int
],None
]) – Pull values contained only within the subset.normalize (
bool
) – Whether to normalize the columns ofdata
to sum to \(1\).split_mass (
bool
) – Whether to split non-zero values indata
into separate columns.scale_by_marginals (
bool
) – Whether to scale by the target :term`marginals`b
.
- Return type:
- Returns:
: The transported values, array of shape
[n, d]
.