Closed hyjforesight closed 1 year ago
Thanks for your great questions again. I will provide my answers to your questions in the following:
Q1. Why does this function loop run dyn.pd.least_action() first by calling adj_key="X_umap_distances", and then run dyn.pd.least_action() again by calling adj_key="cosine_transition_matrix" to return it to lap?
The first lap
call runs on the umap space while the second one on the pca
space. I find using X_umap_distances
for umap LAP and cosine_transition_matrix
for pca LAP calculation give the best result. This also intuitively make sense, because you want to initialize the LAP search with the shorted path in umap or the best transition defined by the cosine_transition_matrix
in pca space.
Q2. What is the best argument for adj_key when basis="pca" for dyn.pd.least_action(), pearson_transition_matrix or cosine_transition_matrix or fp_transition_rate?
If I remember correctly cosine_transition_matrix
gives the best results in our HSC data, but I think you may also try pearson_transition_matrix
for other datasets. Really it is just depends on whether either of them (or any other novel kernels that will be developed by us or others) results in the best velocity embedding.
Q3. In my own conventional scRNA-seq data, I only have obsp as below, how can I generate X_umap_distances for running dyn.pd.least_action() on umap basis. If I cannot generate X_umap_distances, what arguments should I use for dyn.pd.least_action()?
if you run dyn.tl.neighbors(adata, basis='umap')
you will be able to generate what you want.
Hope these help!
Hello @Xiaojieqiu,
Thanks for the response.
For generating cosine_transition_matrix
, do I need to add this kwarg other_kernels_dict={'transform': 'sqrt'}
?
dyn.tl.cell_velocities(adata, basis='umap', n_neighbors = 10, method='cosine', other_kernels_dict={'transform': 'sqrt'})
Thanks!
Yes, that is required to stablize the velocity projection because sqrt to bring down the extreme velocity values.
thanks @Xiaojieqiu ! Appreciate it.
Hello @Xiaojieqiu, sorry for reopening this issue.
I calculated the cosine_potential
and pearson_potential', but I believe they do not represent the real cell potential.
ddhodge_potential' looks more close to the real cell state.
In this case, do I need to change X_umap_distances
to 'distances' for LAP in UMAP space? Which value of ddhodge
can be used for the replacement of cosine_transition_matrix
for LAP in PCA space?
adata # my own data
obsp: 'moments_con', 'distances', 'connectivities', 'pearson_transition_matrix', 'cosine_transition_matrix', 'umap_ddhodge', 'pca_ddhodge'
dyn.pd.least_action(adata, init_cells=[adata.obs_names[start[0]][0]], target_cells=[adata.obs_names[end[0]][0]], min_lap_t=min_lap_t, basis="umap",
adj_key="X_umap_distances", EM_steps=2) # do I need to change `X_umap_distances` to 'distances'?
dyn.pl.least_action(adata, basis="umap")
lap = dyn.pd.least_action(adata, init_cells=[adata.obs_names[start[0]][0]], target_cells=[adata.obs_names[end[0]][0]], min_lap_t=min_lap_t, basis="pca",
adj_key="cosine_transition_matrix", EM_steps=2) # which value of ddhodge can be used for the replacement of cosine_transition_matrix?
Thanks! Best, YJ
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days
Hello Dynamo, In the LAP tutorial, the example datasets has
adata.obsp['X_umap_distances']
andadata.obsp['cosine_transition_matrix']
.And these 2 arguments are used for LAP analysis.
I have several questions. Could you please help me? Thanks!
Q1. Why does this function loop run
dyn.pd.least_action()
first by callingadj_key="X_umap_distances"
, and then rundyn.pd.least_action()
again by callingadj_key="cosine_transition_matrix"
to return it tolap
?Q2. What is the best argument for
adj_key
whenbasis="pca"
fordyn.pd.least_action()
,pearson_transition_matrix
orcosine_transition_matrix
orfp_transition_rate
?Q3. In my own conventional scRNA-seq data, I only have
obsp
as below, how can I generateX_umap_distances
for runningdyn.pd.least_action()
on umap basis. If I cannot generateX_umap_distances
, what arguments should I use fordyn.pd.least_action()
?