ShobiStassen / VIA

trajectory inference
https://pyvia.readthedocs.io/en/latest/
MIT License
76 stars 20 forks source link

Pseudotime in the same cluster #30

Open wangjiawen2013 opened 1 year ago

wangjiawen2013 commented 1 year ago

Hi, Do the cells in one cluster have the same pseudotime ?

ShobiStassen commented 1 year ago

hi, no the pseudotime of a single cell will be the weighted average of the cluster level pseudotimes of each of its neighboring cells (so at the single cell level a cell may have neighbors from different clusters)

wangjiawen2013 commented 1 year ago

Do the pseudotime and lineage probability depend on the PARC cluster labels or they are independently

wangjiawen2013 commented 1 year ago

and I still confuse about the parameter "preserve_disconnected: if you suspect disconnected trajectories, set this to False". What does this sentence mean ?

ShobiStassen commented 1 year ago

Hi, yes the lineage and pseudotime are influenced by the cluster graph which aggregates the single cell edges by cluster. Once the cluster level time and probability are computed, we project back to single cell level.

If you think there should be multiple disconnected components in your data, then set preserve_disconnected = False to prevent the method from trying to reconnect them

wangjiawen2013 commented 1 year ago

I think I got it. I have checked the pseudotime and PARC cluster label. Most of the cells in the same cluster have the same pseudotime, and very few cells have different pseudotime. In this case, VIA is different from palantir. I find palantir Pseudotime is indepdent of clusters.

wangjiawen2013 commented 1 year ago

And, Does VIA use PARC clustering internally or true labels given by the users when computing pseudotime ?

ShobiStassen commented 1 year ago

You can choose to assign clusters based on your own ndarray input of shape (nsamples,) of single cell labels you provide, you just need to pass this in when initializing via labels = YOURlabels. The clustergraph does not use true_label to guide the clusters. true_label is purely for reference when plotting. The clustergraph is based on the PARC (or used defined) labels attribute of via. The pseudotime is determined at the clusterlevel before projecting it to a single-cell level. The range of values for cells within each cluster would depend on connectivity of the sc-knn graph.