-
Notifications
You must be signed in to change notification settings - Fork 8
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
script_diffusion_umap problem #8
Comments
is this a problem of the version of scipy? |
Hi! Thank you for raising this issue. We did find a small problem with the code here. The adata_w.X is a spare matrix, not a numpy array, so the right way is:
We will update this part of the code after we finish the revision. |
thank for your quick reply, I will try it. |
Hi chengfengke, In case you still have this issue, you can look at the fork I have created to reproduce the results of the paper: https://github.com/JeanRadig/scDiffusion.git. Under Jean_Instructions you will find two notebooks that should be able to yield the plotting you are trying to get. Hope this helps :) |
excuse me,i would like to know why I got ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[8], line 6
3 adata_w.var_names = gene_names
5 autoencoder = load_VAE()
----> 6 cell_w = autoencoder(torch.tensor(adata_w.X).cuda(),return_latent=True).detach().cpu().numpy()
8 # concat this cell_w with cell_gen and send them to the autoencoder
9 cell_gen_all = autoencoder(torch.tensor(np.concatenate((cell_gen,cell_w),axis=0)).cuda(),return_decoded=True).cpu().detach().numpy()
File ~/anaconda3/envs/scDiffusion/lib/python3.9/site-packages/scipy/sparse/_base.py:404, in _spbase.len(self)
403 def len(self):
--> 404 raise TypeError("sparse array length is ambiguous; use getnnz()"
405 " or shape[0]")
TypeError: sparse array length is ambiguous; use getnnz() or shape[0] when I executing
if not generated all type of cells, use the real cell to balance the batchnorm in the scimilarity
adata_w = adata.copy()[::5]
adata_w.var_names = gene_names
autoencoder = load_VAE()
cell_w = autoencoder(torch.tensor(adata_w.X).cuda(),return_latent=True).detach().cpu().numpy()
concat this cell_w with cell_gen and send them to the autoencoder
cell_gen_all = autoencoder(torch.tensor(np.concatenate((cell_gen,cell_w),axis=0)).cuda(),return_decoded=True).cpu().detach().numpy()
cell_w.shape
this part of code, and I got different output with your previous results,cell_gen.shape=(600, 18996),not (12000,18996)
The text was updated successfully, but these errors were encountered: