theislab / cellrank

CellRank: dynamics from multi-view single-cell data
https://cellrank.org
BSD 3-Clause "New" or "Revised" License
351 stars 46 forks source link

Errors for compute_transition_matrix #1205

Closed mainharryHR closed 4 months ago

mainharryHR commented 4 months ago

... Dear Team,

I am new for this package, please help me with this errors or pipeline.

Here comes my pipeline: CellRank Meets CytoTRACE I imported seurat object as adata. Then I did the PCA and Neighbors.

sc.pl.embedding(adata, basis="X_harmony_UMAP", color="annotationV2") sc.pp.filter_genes(adata, min_cells=1) scv.pp.normalize_per_cell(adata) sc.pp.log1p(adata) sc.pp.highly_variable_genes(adata) adata.layers['spliced'] = adata.X adata.layers['unspliced'] = adata.X scv.pp.moments(adata, n_pcs=None, n_neighbors=None) # hack for CytoTRACEkernel

from cellrank.kernels import CytoTRACEKernel ctk = CytoTRACEKernel(adata).compute_cytotrace()

Compute transition matrix ctk = ctk.compute_cytotrace().compute_transition_matrix(scheme="soft", nu=0.5)

Then I have errors:
Computing CytoTRACE score with 3000 genes. Consider using more than 10000 genes Adding adata.obs['ct_score'] adata.obs['ct_pseudotime'] adata.obs['ct_num_exp_genes'] adata.var['ct_gene_corr'] adata.var['ct_correlates'] adata.uns['ct_params'] Finish (0:00:00) Computing transition matrix based on pseudotime 0%| | 0/3640 [00:00<?, ?cell/s]Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/spawn.py", line 120, in spawn_main exitcode = _main(fd, parent_sentinel) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/spawn.py", line 129, in _main prepare(preparation_data) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/spawn.py", line 240, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/spawn.py", line 291, in _fixup_main_from_path main_content = runpy.run_path(main_path, ^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 290, in run_path File "", line 254, in _get_code_from_file FileNotFoundError: [Errno 2] No such file or directory: '/Users/hairu/PycharmProjects/pythonProject/Lynch project/' Traceback (most recent call last): File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode coro = func() ^^^^^^ File "", line 1, in File "/Users/hairu/PycharmProjects/pythonProject/Lynch project/venv/lib/python3.11/site-packages/cellrank/kernels/_pseudotime_kernel.py", line 158, in compute_transition_matrix biased_conn = scheme.bias_knn( ^^^^^^^^^^^^^^^^ File "/Users/hairu/PycharmProjects/pythonProject/Lynch project/venv/lib/python3.11/site-packages/cellrank/kernels/utils/_pseudotime_scheme.py", line 95, in bias_knn res = parallelize( ^^^^^^^^^^^^ File "/Users/hairu/PycharmProjects/pythonProject/Lynch project/venv/lib/python3.11/site-packages/cellrank/_utils/_parallelize.py", line 90, in wrapper queue = multiprocessing.Manager().Queue() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/context.py", line 57, in Manager m.start() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/managers.py", line 567, in start self._address = reader.recv() ^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/connection.py", line 249, in recv buf = self._recv_bytes() ^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/connection.py", line 413, in _recv_bytes buf = self._recv(4) ^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/connection.py", line 382, in _recv raise EOFError EOFError

WeilerP commented 4 months ago

@mainharryHR, it looks like you running your code in Pycharm. Can you please check if it works when you run it in a standard terminal?

mainharryHR commented 4 months ago

@mainharryHR, it looks like you running your code in Pycharm. Can you please check if it works when you run it in a standard terminal?

Thank you very much. It works in another terminal. I appreciate your kind help and fast response.