Closed kevin-de-granta closed 3 years ago
hey @kevin-de-granta thanks for using dynamo and pointing out the bug. I have fixed this in my latest commit, can you please pull the changes and re-install the package to see whether it works now? I am tested the code via the following snippet which may be helpful:
import dynamo as dyn
adata = dyn.sample_data.pancreatic_endocrinogenesis()
dyn.pp.recipe_monocle(adata, num_dim=30)
dyn.pl.biplot(adata)
dyn.pl.variance_explained(adata)
dyn.pl.loading(adata)
dyn.tl.reduceDimension(adata)
dyn.tl.reduceDimension(adata, n_pca_components=30, enforce=True)
dyn.pl.umap(adata, color='clusters')
dyn.tl.dynamics(adata, model="stochastic", cores=2)
dyn.tl.hdbscan(adata, basis='umap') # note you can pass different arguments from hdbscan to this function
dyn.pl.umap(adata, color='hdbscan')
please also note that dynamo implemented louvain and leiden clustering too, so you can use:
dyn.tl.louvain(adata) # louvain and leiden clustering are pretty flexible, for example, you can pass `adj_mat_key = "pearson_transition_matrix"` to those functions to use the transition graph calculated from RNA velocity to do the cell clustering
dyn.tl.leiden(adata)
dyn.pl.umap(adata, color=['louvain', 'leiden'])
Let me know whether this helps
There was an error when we were trying to invoke function dyn.tl.hdbscan(),
The error seems due to inconsistance between function-calling and implementation of prepare_dim_reduction(). In dynamo/tools/clustering.py, four values are expected during calling,
if X_data is None: _, n_components, has_basis, basis = prepare_dim_reduction( adata, genes=genes, layer=layer, basis=basis, dims=dims, n_pca_components=n_pca_components, n_components=n_components, )
, while within the implementation(dynamo/tools/utils_reduceDimension.py, prepare_dim_reduction()), only three values are returned,
return X_data, n_components, basis
So, could you please consider improving it if necessary, or offer us some advice regarding how to better use it?
It is deeply appreciated.