Simulation#
- class scdiffeq.tools._simulation.Simulation(use_key: str = 'X_pca', time_key: str = 'Time point', N: int = 1, device: device | None = device(type='cpu'), *args, **kwargs)[source]#
Bases:
ABCParseSampled trajectories from an scDiffEq model
- Parameters:
- Returns:
None
- __init__(use_key: str = 'X_pca', time_key: str = 'Time point', N: int = 1, device: device | None = device(type='cpu'), *args, **kwargs)[source]#
- property idx#
- _assert_time_span() None[source]#
The span is read from
adata.obs[time_key]of the object passed – not fromidx. Passing only the t0 cells therefore collapses the span to a single point, which would integrate nothing and return the input.
- _to_adata_sim(Z_hat: ndarray) AnnData[source]#
- Parameters:
Z_hat (np.ndarray)
- Returns:
adata_sim (anndata.AnnData)
- __call__(diffeq, adata: AnnData, idx: Index, dt: float = 0.1, t: Tensor | None = None, *args, **kwargs) AnnData[source]#
Simulate trajectories by sampling from an scDiffEq model.
- Parameters:
() (diffeq) – lightning model.
adata (AnnData) – Input AnnDat object.
idx (pd.Index) – cell indices (corresponding to adata from which the model should initiate sampled trajectories.
- Returns:
adata_sim (anndata.AnnData)
- __parse__(kwargs: Dict, public: List | None = [None], private: List | None = [], ignore: List | None = []) None#
Made to be called during cls.__init__ of the inherited class. Central function of this autoparsing base class.