theislab / scvelo

RNA Velocity generalized through dynamical modeling
https://scvelo.org
BSD 3-Clause "New" or "Revised" License
400 stars 103 forks source link

scv.tl.rank_velocity_genes() Doesn't Rank All Genes #1207

Open jwalewski opened 5 months ago

jwalewski commented 5 months ago

When I run scv.tl.rank_velocity_genes() on my own data (grouped by "Cell_type", and there are at least hundreds of cells per type), I see only four genes being ranked. Despite this, I can see that many, many genes have expression and contribution to RNA velocity in the phase maps. What's going on here?? The docs say that there's no limit to the number of genes ranked other than a cap at 100: (https://scvelo-dev.readthedocs.io/scvelo.tl.rank_velocity_genes/?highlight=rank_velocity_genes). Otherwise what could be limiting the numbers?

I would post the example here, but the data is yet to be published.

The example code in general would be to run rank_velocity_genes(), see the number of genes listed by cluster, and then create phase maps of more genes than listed.

Not applicable as this is not an error, but again, the output would be more genes with data in phase maps than the ranking of the velocity genes.

Versions ```pytb scvelo==0.2.5 scanpy==1.9.4 anndata==0.11.0.dev31+g49ca3bd loompy==3.0.7 numpy==1.24.4 scipy==1.11.2 matplotlib==3.7.1 sklearn==1.3.0 pandas==2.1.0 ```
jwalewski commented 4 months ago

I think I see why this is the case now. https://github.com/theislab/scvelo/blob/ffe2cd3c437fd385f80fed9e6abc6dc3013eff82/scvelo/tools/rank_velocity_genes.py#L329 Even in cases where the user sets the minimum likelihood to none, this line sets the minimum likelihood to 0.1. In other words, the default value is effectively 0.1.

This would be very helpful to know - perhaps it can be included in the docstring and the official documentation?