scarches icon indicating copy to clipboard operation
scarches copied to clipboard

Error when creating SCANVI model with tutorial

Open paupuigdevall opened this issue 2 years ago • 3 comments

I'm trying to reproduce the semi-supervised pipeline in here [https://scarches.readthedocs.io/en/latest/scanvi_surgery_pipeline.html], but the pipeline is failing when trying to build the model using the reference dataset:

sca.models.SCANVI.setup_anndata(source_adata, batch_key=condition_key, labels_key=cell_type_key) Traceback (most recent call last): File "", line 1, in TypeError: setup_anndata() missing 1 required positional argument: 'unlabeled_category'

I'm using python 3.9.13, packaged by conda-forge. I tried installing other versions of python and installing scarches both with PyPI and Development, but the error persists. Not sure if I'm doing something wrong. Could you please help me understand this error?

paupuigdevall avatar Jul 18 '22 20:07 paupuigdevall

Hi, @paupuigdevall i will check and let you know, probably we need to update the tutorials for new scanvi versions.

Koncopd avatar Jul 19 '22 16:07 Koncopd

Dear authors,

just another question related with the Semi-supervised surgery pipeline with SCANVI tutorial. The setup is with SCANVI but SCVI model is used. This throws an error to me:

vae = sca.models.SCVI(
    source_adata,
    n_layers=2,
    encode_covariates=True,
    deeply_inject_covariates=False,
    use_layer_norm="both",
    use_batch_norm="none",
)

ValueError: Please set up your AnnData with SCVI.setup_anndata first. It appears the AnnData object has been setup with a different model.

If I build the model with sca.models.SCANVI this error disappears. But downstream code does not work

scanvae = sca.models.SCANVI.from_scvi_model(vae, "Unknown")
TypeError: setup_anndata() got multiple values for keyword argument 'unlabeled_category'

Is this correct?

Thanks for your help and congrats on this work. Juan L.

JLTrincado avatar Aug 18 '22 09:08 JLTrincado

@Koncopd

M0hammadL avatar Aug 18 '22 10:08 M0hammadL

In the notebook we have specified the version of scvi-tools used to run it, please try with this version. https://github.com/theislab/scarches/blob/master/notebooks/scanvi_surgery_pipeline.ipynb Feel free to reopen it still doesn't work.

Koncopd avatar Aug 03 '23 08:08 Koncopd