Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SysVI attributes listed in API don't appear in trained model #3251

Open
danieljrichard opened this issue Mar 14, 2025 · 2 comments
Open

SysVI attributes listed in API don't appear in trained model #3251

danieljrichard opened this issue Mar 14, 2025 · 2 comments
Labels

Comments

@danieljrichard
Copy link

Hello, I was working through this example for running SysVI:

(https://docs.scvi-tools.org/en/stable/tutorials/notebooks/scrna/sysVI.html)

And tried running get_normalized expression. However, I get this error:
AttributeError: ‘SysVI’ object has no attribute ‘get_normalized_expression’

However, the API indicates this is an attribute:
(https://docs.scvi-tools.org/en/latest/api/reference/scvi.external.SysVI.html#scvi.external.SysVI.get_normalized_expression)

Am I doing something wrong, or do I somehow need to convert this SysVI object to a scvi object?

Any help would be greatly appreciated!

SysVI.setup_anndata(
    adata=adata,
    batch_key="system",
    categorical_covariate_keys=["batch"],
)

model = SysVI(
    adata=adata)
scvi.settings.num_threads = 20
scvi.settings.dl_num_workers = 20

model.train(
    plan_kwargs={
        "kl_weight": 1,
        "z_distance_cycle_weight": 5
        # Add additional parameters, such as number of epochs
    }

normalized_out = model.get_normalized_expression(adata, transform_batch="mouse", library_size = 'latent')

)```

<!-- Put your Error output in this code block (if applicable, else delete the block): -->

```pytb
AttributeError: 'SysVI' object has no attribute 'get_normalized_expression'

Versions:

'1.2.0'

@ori-kron-wis
Copy link
Collaborator

It is not implemented yet, you are correct.
It is in the API because of RNAseqMIXIN inheritance, but the function is not working out of the box.

We will fix it.

@danieljrichard
Copy link
Author

Thanks for the update - much appreciated!
In the meantime, might there be any hints/ways to coerce the model into a scvi-like object to access those attributes, or is it more complicated than I'm imagining?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants