Closed bitcometz closed 2 years ago
Hello, please delete the cell with the current installation commands and replace with the first cell shown here
Thanks !!! there are some codes need to be changed.
## for installation
!pip install --quiet scvi-colab
from scvi_colab import install
install()
## change the matplotlib version
!python -m pip uninstall matplotlib
!pip install matplotlib==3.1.3
!pip install bbknn
# adata = scvi.data.spleen_lymph_cite_seq(run_setup_anndata=False)
# replace by the following code
adata = scvi.data.spleen_lymph_cite_seq() # default is True. Will set it up for you
adata.obs_names_make_unique()
# scvi.data.setup_anndata(adata, layer="counts", batch_key='batch')
scvi.model.SCVI.setup_anndata(adata, layer="counts", batch_key="batch")
# scvi.data.view_anndata_setup(adata)
model.view_anndata_setup(adata)
but I still got some errors:
sc.pl.umap( adata, color=["Ly6d", "Xcr1", "Foxp3"]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[<ipython-input-79-00f769552dfd>](https://localhost:8080/#) in <module>()
----> 1 sc.pl.umap(adata, color=["Ly6d", "Xcr1", "Foxp3"], layer="scvi_expr")
5 frames
[/usr/local/lib/python3.7/dist-packages/matplotlib/colorbar.py](https://localhost:8080/#) in __init__(self, ax, mappable, **kw)
1181 kw['alpha'] = mappable.get_alpha()
1182
-> 1183 ColorbarBase.__init__(self, ax, **kw)
1184
1185 def on_mappable_changed(self, mappable):
TypeError: __init__() got an unexpected keyword argument 'location'
scandata.obs[["labels_for_scanvi"]].value_counts()
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-93-77982d7b5115>](https://localhost:8080/#) in <module>()
----> 1 scandata.obs[["labels_for_scanvi"]].value_counts()
2 frames
[/usr/local/lib/python3.7/dist-packages/pandas/core/indexing.py](https://localhost:8080/#) in _validate_read_indexer(self, key, indexer, axis)
1372 if use_interval_msg:
1373 key = list(key)
-> 1374 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
1375
1376 not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique())
KeyError: "None of [Index(['labels_for_scanvi'], dtype='object')] are in the [columns]"
Best
We confirmed that indeed it works now, I would remove any extra pip installs that you added.
Hello, I try to run the toturial with the following URL: https://colab.research.google.com/drive/1V4BD3SAGDwLzvMUn90FMOHYVNG_iP4Ee?usp=sharing
But I met some errors:
Could you help with this problem ?
Thanks !!!