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

AttributeError: 'Liger' object has no attribute 'var_genes' #13

Open
mumichae opened this issue Sep 6, 2023 · 3 comments
Open

AttributeError: 'Liger' object has no attribute 'var_genes' #13

mumichae opened this issue Sep 6, 2023 · 3 comments

Comments

@mumichae
Copy link

mumichae commented Sep 6, 2023

I'm getting the following error when trying to run the scale_not_center function

Traceback (most recent call last):
File "/tmp/viash-run-pyliger-hnRbbi.py", line 45, in
pyliger.scale_not_center(lobj)
File "/usr/local/lib/python3.10/site-packages/pyliger/preprocessing/_scale.py", line 47, in scale_not_center
var_gene_idx = adata.var.index.isin(liger_object.var_genes)
AttributeError: 'Liger' object has no attribute 'var_genes'. Did you mean: 'num_var_genes'?

@theAeon
Copy link
Member

theAeon commented Sep 6, 2023

Did you run select_genes on this object yet?

@mumichae
Copy link
Author

mumichae commented Sep 7, 2023

No I hadn't, since I'm already working on a HVG subset that I want to be consistent across methods. Is there a way to run select_genes without recomputing HVGs?

@Lulu0015
Copy link
Collaborator

Lulu0015 commented Sep 7, 2023

I think the issue is because we save a copy of HVGs during select_genes which will be used as a reference during the scale_not_center step. Can you try assigning your list of HVG to the Liger object attribute 'var_genes' to see if it fixes the issue? You may do things like liger_object.var_genes = YOU_LIST_HVG before running scale_not_center.

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

No branches or pull requests

3 participants