cellrank icon indicating copy to clipboard operation
cellrank copied to clipboard

RuntimeError: No coarse-grained stationary distribution found

Open xyxuq opened this issue 8 months ago • 6 comments

... 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 information RuntimeError: 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.

Computing Schur decomposition
Adding `adata.uns['eigendecomposition_fwd']`
       `.schur_vectors`
       `.schur_matrix`
       `.eigendecomposition`
    Finish (1:59:34)
Computing `15` macrostates
Adding `.macrostates`
       `.macrostates_memberships`
       `.coarse_T`
       `.coarse_initial_distribution
       `.coarse_stationary_distribution`
       `.schur_vectors`
       `.schur_matrix`
       `.eigendecomposition`
    Finish (4:33:05)
Writing `GPCCA[kernel=RealTimeKernel[n=1222515], initial_states=None, terminal_states=None]` to `test.initial_terminal_state.fate_probabilities.pickle`
Adding `adata.obs['term_states_fwd']`
       `adata.obs['term_states_fwd_probs']`
       `.terminal_states`
       `.terminal_states_probabilities`
       `.terminal_states_memberships
    Finish`
Writing `GPCCA[kernel=RealTimeKernel[n=1222515], initial_states=None, terminal_states=['0_1', '0_2', '0_3', '14', '18_1', '18_2', '18_3', '19_1', '19_2', '5_1', '5_2', '5_3', '6_1', '6_2', '6_3']]` to `test.initial_terminal_state.fate_probabilities.pickle`
Traceback (most recent call last):
  File "cellrank_macrostates.test.py", line 45, in <module>
    g.predict_initial_states(allow_overlap=False)
  File "~/miniconda3/envs/cellrank/lib/python3.11/site-packages/cellrank/estimators/terminal_states/_gpcca.py", line 368, in predict_initial_states
    raise RuntimeError("No coarse-grained stationary distribution found.")
RuntimeError: No coarse-grained stationary distribution found.

The version of packages:

cellrank==2.0.0 scanpy==1.9.5 anndata==0.9.2 numpy==1.24.4 numba==0.57.1 scipy==1.11.2 pandas==1.5.3 pygpcca==1.0.4 scikit-learn==1.1.3 statsmodels==0.14.0 python-igraph==0.10.8 scvelo==0.3.0 pygam==0.8.0 matplotlib==3.6.3 seaborn==0.12.2

cellrank_check_script.txt

xyxuq avatar Oct 24 '23 02:10 xyxuq