Closed Rajarshi1001 closed 2 years ago
I found this problem both, after trying to change the version of scvi-tools, you may try ` RegressionModel.setup_anndata(adata_ref, batch_key='Sample',
labels_key='Subset',
# multiplicative technical effects (platform, 3' vs 5', donor effect)
categorical_covariate_keys=['Method']
)
` instead of scvi.data.setup_anndata, it do also work anyway ,but I'm not sure whether they lead to the same result.
Waiting for your comment, thank you!
It turns out to the same result.
Yes, please use cell2location.models.RegressionModel.setup_anndata(adata_ref, ...)
for reference signature estimation and cell2location.models.Cell2location.setup_anndata(adata_vis, ...)
for cell2location application to spatial adata_vis
.
These changes follow recent improvements to scvi-tools.
We will update the tutorials soon.
i have tried this method but can't solve this problem new error:
AttributeError Traceback (most recent call last)
Input In [10], in <cell line: 10>()
1 # prepare anndata for the regression model
2 cell2location.models.RegressionModel.setup_anndata(adata=adata_ref,
3 # 10X reaction / sample / batch
4 batch_key='Sample',
(...)
8 categorical_covariate_keys=['Method']
9 )
---> 10 scvi.data.view_anndata_setup(adata_ref)
AttributeError: module 'scvi.data' has no attribute 'view_anndata_setup'
Help would be appreciated
In scvi-tools versions after 0.16.0, the anndata setup settings can be viewed after the model is created: cell2location.models.RegressionModel.view_anndata_setup(model)
.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Minimal code sample (that we can run without your data, using public data)
In the new version of cell2location, I got this issue while running the cell2location tutorial for the Mouse Brain data. The tutorial shows that AnnData was setup using 'scvi-tools' version 0.13.0 but the existing scvi version found was 0.16.0 so there is some issue with the attribute __setup_anndata and view_anndata_setup__.