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 in adata_tgt.obs['{data}']. If subset is a list, the data will be a boolean mask determined by the subset. Useful for categorical data.

    • None - the value depends on the subset.

      • list - names in adata_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 of data to sum to \(1\).

  • split_mass (bool) – Whether to split non-zero values in data into separate columns.

  • scale_by_marginals (bool) – Whether to scale by the target :term`marginals` b.

Return type:

ndarray[Any, dtype[float64]]

Returns:

: The transported values, array of shape [n, d].