Closed kiristern closed 7 months ago
I tried running the same tutorial via Google Colab as well and have the same dependencies issues.
Hi! This fork has resolved some of my issues, I hope it helps: https://github.com/szhorvat/scgen
I encountered this problem, too.
scgen.SCGEN.setup_anndata(train_new, batch_key="condition", labels_key="cell_type")
"~/miniconda3/envs/scgen/lib/python3.11/site-packages/scvi/data/_utils.py", line 245, in _check_if_view
raise ValueError("Please run `adata = adata.copy()`")
ValueError: Please run `adata = adata.copy()`
I finally solved it by adding ".copy()" to "train_new = train[~((train.obs["cell_type"] == "CD4T") & (train.obs["condition"] == "stimulated"))]" at the end
I resolved the issue with scgen by downgrading scvi-tools
to version 0.17 and installing scgen with pip in Google Colab:
import sys
#if branch is stable, will install via pypi, else will install from source
branch = "stable"
IN_COLAB = "google.colab" in sys.modules
!pip install --quiet scvi-tools==0.17
!pip install --quiet scgen
if IN_COLAB and branch == "stable":
!pip install --quiet scgen[tutorials]
elif IN_COLAB and branch != "stable":
!pip install --quiet --upgrade jsonschema
!pip install --quiet git+https://github.com/theislab/scgen@$branch#egg=scgen[tutorials]
@chelseabright96
Hello, I am trying to run the scgen_perturbation_prediction.ipynb tutorial but am having dependency issues, namely with
scvi-tools
.I created a new
conda
env with the latest releases:scgen 2.1.0
scvi-tools 1.0.4
When simply running the tutorial, on
import scgen
, I got:It appears as if
LossRecorder
was renamed to LossOutput. I simply changedLossRecorder
toLossOutput
but then kept getting new errors such as "Literal is deprecated, use typing instead" (again, just modifiedfrom typing import Literal
), but then more errors... i ended up just restarting and installingpip install git+https://github.com/theislab/scgen.git
development version, but now get the error:I was wondering what is the last stable versions to run the tutorial without having to manually go through all these errors? Thanks!