theislab / cellrank_notebooks

Tutorials and examples for CellRank.
https://cellrank.org
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

Add a "getting started" tutorial #61

Closed Marius1311 closed 1 year ago

Marius1311 commented 1 year ago

This serves as an entry point for CellRank analysis.

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Marius1311 commented 1 year ago

Hi @michalk8, for some reason, I cannot plot a circular projection here, it complains. KeyError: "Unable to find lineage data inadata.obsm['lineages_fwd']."

But it's weird, because I computed fate probabilities above, it said Addingadata.obsm['lineages_fwd']`, but when I check in AnnData, it's actually not there. Would be great if you could see whether this persists on your machine, the data is downloaded automatically from figshare.

Marius1311 commented 1 year ago

Note: using the same CellRank commit, this worked in the fate probability tutorial.

michalk8 commented 1 year ago

Note: using the same CellRank commit, this worked in the fate probability tutorial.

Can you please check assert adata is pk.adata (or assert g.adata is adata)? I suspect some copy was made. Otherwise will check as soon as I get back. Update: the latter doesn't seem to hold, so a copy is being made somehow. Will fix. Update v2: you initialize the GPCCA with pk, not pk_new; pk is associated with the adata before saving, so after fixing this, it works.

Marius1311 commented 1 year ago

Amazing @michalk8, thank you so much for spotting this!

Marius1311 commented 1 year ago

Hi @michalk8, first of all, thanks for your hint above, that fixed the problem with the circular projection. I re-formated the notebook using myst and in principle, it's ready for your review.

However, the pre-commit hooks were failing. Initially, isort complained with "RuntimeError: The Poetry configuration is invalid". I fixed that by pinning isort to version 5.12.0 in the .pre-commit-config.yaml. However, now black-nb is failing with

Traceback (most recent call last):
  File "/Users/marius/.cache/pre-commit/repo__m858xp/py_env-python3/bin/black-nb", line 8, in <module>
    sys.exit(cli())
  File "/Users/marius/.cache/pre-commit/repo__m858xp/py_env-python3/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/marius/.cache/pre-commit/repo__m858xp/py_env-python3/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/marius/.cache/pre-commit/repo__m858xp/py_env-python3/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/marius/.cache/pre-commit/repo__m858xp/py_env-python3/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/marius/.cache/pre-commit/repo__m858xp/py_env-python3/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/marius/.cache/pre-commit/repo__m858xp/py_env-python3/lib/python3.9/site-packages/black_nb/cli.py", line 190, in cli
    sources = black.get_sources(
  File "src/black/__init__.py", line 637, in get_sources
TypeError: 'NoneType' object is not subscriptable

and I don't really get what it wants.

review-notebook-app[bot] commented 1 year ago

View / edit / reply to this conversation on ReviewNB

michalk8 commented on 2023-06-05T18:45:44Z ----------------------------------------------------------------

I think there's too much text, would shorten (before "In this tutorial") + please add more links (like cite when mentioning RNA velocity (La Manno, Bergen), developmental potentials (CytoTRACE publication), etc.

Please also link to kernels as, e.g., {mod}~cellrank.kernels and {mod}cellrank.estimator.

I'd move the "To demonstrate ..." to a cell above when you create the dataset + link to it using {mod}~cellrank.datasets.bone_marrow.

I slightly prefer using "you will learn how to:" instead of "you will learn how to..." (intead of ..., would use :, also in other places).


Marius1311 commented on 2023-06-07T12:42:25Z ----------------------------------------------------------------

I agree with all and adapted all.