Open xyxuq opened 1 year ago
mh, not sure what's going on here, do you have any idea @michalk8 ?
I randomly took subsets of the whole dataset and increased the cells by 5% for each subset. At most, only up to 30% cells (366,754) could run successfully.
I check the scripts step by step; g.coarse_stationary_distribution is empty when I run with the whole dataset.
The (coarse) stationary distribution is not guaranteed to always exist. Running g.predict_initial_states(allow_overlap=False)
sometimes needs it when there is only 1 initial macrostate detected automatically.
To overcome this, if you know how many initial macrostates you expect, you can pass it as g.predict_initial_states(n_states=..., allow_overlap=False)
, since this won't require access to the coarse stationary distribution.
I check the scripts step by step; g.coarse_stationary_distribution is empty when I run with the whole dataset.
The (coarse) stationary distribution is not guaranteed to always exist. Running
g.predict_initial_states(allow_overlap=False)
sometimes needs it when there is only 1 initial macrostate detected automatically.To overcome this, if you know how many initial macrostates you expect, you can pass it as
g.predict_initial_states(n_states=..., allow_overlap=False)
, since this won't require access to the coarse stationary distribution.
Hi @michalk8,
I tried your comment above but still I receive the same error.
g.fit(cluster_key="annotation_cell_states", n_states=[0, 25],n_cells=15)
Computing Schur decomposition
Adding `adata.uns['eigendecomposition_fwd']`
`.schur_vectors`
`.schur_matrix`
`.eigendecomposition`
Finish (0:00:14)
WARNING: Minimum value must be larger than `1`, found `2`. Setting `min=2`
WARNING: In most cases, 2 clusters will always be optimal. If you really expect 2 clusters, use `n_states=2`. Setting `min=3`
Calculating minChi criterion in interval `[3, 25]`
Computing `22` macrostates
Adding `.macrostates`
`.macrostates_memberships`
`.coarse_T`
`.coarse_initial_distribution
`.coarse_stationary_distribution`
`.schur_vectors`
`.schur_matrix`
`.eigendecomposition`
Finish (0:04:44)
GPCCA[kernel=PseudotimeKernel[n=93458], initial_states=None, terminal_states=None]
g.predict_initial_states(n_states=22, allow_overlap=False)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[87], line 1
----> 1 g.predict_initial_states(n_states=22, allow_overlap=False)
File ~/anaconda3/envs/trajectories_1/lib/python3.11/site-packages/cellrank/estimators/terminal_states/_gpcca.py:368, in GPCCA.predict_initial_states(self, n_states, n_cells, allow_overlap)
366 stat_dist = self.coarse_stationary_distribution
367 if stat_dist is None:
--> 368 raise RuntimeError("No coarse-grained stationary distribution found.")
370 states = list(stat_dist[np.argsort(stat_dist)][:n_states].index)
371 return self.set_initial_states(states, n_cells=n_cells, allow_overlap=allow_overlap)
RuntimeError: No coarse-grained stationary distribution found.
I have tried n_states from 1 to 22, but still I experience the same error. May I know if this can be fixed? Many thanks!
mh, any idea @michalk8 ?
Hi, thought I'd mention that I've been getting the same error too, though only when computing the initial state. Both with and without specifying the n_states.
I was able to compute the terminal states with no errors.
... Hi there,
I am trying to compute the initial and terminal states of cells from time series experiments with the codes in the attached cellrank_check_script.txt.
It worked when I ran the script with a small subset of data but failed with the whole dataset with 1,222,515 cells. When I run
g.predict_initial_states(allow_overlap=False)
, it gave me the error informationRuntimeError: No coarse-grained stationary distribution found.
I check the scripts step by step;
g.coarse_stationary_distribution
is empty when I run with the whole dataset. Could you please help me check this issue? Thanks in ahead.The log file is below.
The version of packages:
cellrank_check_script.txt