pseudodynamics.functions.reader_funs.compute_mellon_timesense_u

pseudodynamics.functions.reader_funs.compute_mellon_timesense_u(adata, cellstate_key, timepoint_key, ls_time_estimate=None, n_dimension=None)[source]

wrapping mellon time-sense density

Args:

adata : the cells from which for estimating density cellstate_key : the low dimensional representation timepoint_key : the obs key that record tiempoint, dtype should be int or float ls_time_estimate : float, the length scaler for time n_dimension : [int, None] ,

Returns:

: log_u : np.array of shape (n_timepoints, n_cells), the log density density_predictor : trained mellon.TimeSensitiveDensityEstimator.predict

Example:

>>> import pseudodynamics as pdp
>>> # a simple example for estimating density of a specific condition
>>> adata_c1 = adata[adata.obs['condition'] == 'condition_1'].copy()
>>> timepoints = adata_c1.obs['time'].unique()
>>> # time ls for exploration
>>> ls_time_estimate = 1.5 * np.mean(np.diff(np.sort(timepoints)))
>>> # timesensitive estimator
>>> log_u, estimator = pdp.tl.compute_mellon_timesense_u(adata_c1, 'DM_EigenVectors', 'time',   ls_time_estimate)