Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How tkey is used in tl.velocity_graph / best practice for time-course data #367

Closed
junhaobearxiong opened this issue Feb 23, 2021 · 1 comment

Comments

@junhaobearxiong
Copy link

Hi!

I have a question on how the tkey argument is used in scvelo.tl.velocity_graph. Based on the documentation, my impression of the use case is when one has time-course data, where each cell is associated with a time point (e.g. day 1, 3, 5). Intuitively, the information of time can be used to "prune" unlikely transition when constructing the velocity graph, e.g. when the cells are very far apart or reverse in time, which should create a more informative velocity graph.

However, my understanding seems to be different from what the code is doing (here). The key line is neighs_idx = np.unique(np.concatenate([neighs_idx, t1_idx])) , where for each cell, the neighbors are defined to be both its iterative neighbors (as identified by get_iterative_indices) and a sample of the cells at the subsequent time point. I'm wondering if it'd make more sense to define its neighbors as the intersection between the iterative neighbors and cells at the subsequent time point, rather than the union? Perhaps something like neighs_idx = np.intersect1d(neighs_idx, t1_idx), where t1_idx = np.where(self.t0 == t1)[0]?

In general, I'm also wondering if there are any best practices for scvelo regarding time-course data?

Thanks!

@junhaobearxiong
Copy link
Author

junhaobearxiong commented Feb 23, 2021

A follow up question on the plotting function for velocity graph (scvelo.pl.velocity_graph). I noticed here that in the default setting, the plotting function doesn't plot the transition matrix based on adata.uns['velocity_graph'], but instead run transition_matrix. I'm wondering how is this different from running scvelo.tl.velocity_graph?

Suppose one has already ran scvelo.tl.velocity_graph, should one specify which_graph='velocity_graph' when running scvelo.pl.velocity_graph?

Thanks!

@theislab theislab locked and limited conversation to collaborators Sep 1, 2021
@WeilerP WeilerP closed this as completed Sep 1, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants