scverse / scvi-tutorials

Notebooks used in scvi-tools tutorials
https://docs.scvi-tools.org/en/stable/tutorials/index.html
BSD 3-Clause "New" or "Revised" License
44 stars 25 forks source link

DestVI tutorial is not running #357

Open ori-kron-wis opened 1 week ago

ori-kron-wis commented 1 week ago

There is several logic issues with the current destVI version tutorial that need to be taken care of.

There is something wrong there towards end of tutorial, every step starting destvi_utils.explore_gamma_space is not working


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[28], line 1
----> 1 destvi_utils.explore_gamma_space(st_model,sc_model,ct_list=ct_list,ct_thresholds=ct_thresholds)

File /usr/local/lib/python3.12/site-packages/destvi_utils/_destvi_utils.py:295, in explore_gamma_space(st_model, sc_model, st_adata, ct_thresholds, output_file, ct_list, key_proportions, key_spatial)
    291 sc_adata_slice = sc_adata[
    292     sc_adata.obs[sc_model.registry_["setup_args"]["labels_key"]] == name_ct
    293 ].copy()
    294 is_sparse = issparse(sc_adata_slice.X)
--> 295 normalized_counts = sc_adata_slice.X.A if is_sparse else sc_adata_slice.X
    296 indices_ct = np.where(
    297     sc_adata.obs[sc_model.registry_["setup_args"]["labels_key"]] == name_ct
    298 )[0]
    300 sc_latent = sc_model.get_latent_representation(indices=indices_ct)

AttributeError: 'csr_matrix' object has no attribute 'A'
[Paste the error output produced by the above code here]

Versions:

1.2

ori-kron-wis commented 5 days ago

We will wait for DestVI-v2 as @canergen suggested and will update tutorial then