pyliger icon indicating copy to clipboard operation
pyliger copied to clipboard

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

Open mumichae opened this issue 2 years ago • 3 comments

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'?

mumichae avatar Sep 06 '23 12:09 mumichae

Did you run select_genes on this object yet?

theAeon avatar Sep 06 '23 12:09 theAeon

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?

mumichae avatar Sep 07 '23 11:09 mumichae

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.

Lulu0015 avatar Sep 07 '23 17:09 Lulu0015