Closed eijynagai closed 1 year ago
Hi there @eijynagai ,
It looks like 'highly_variable' is not a column in adata.var. Seems strange because you do have that parameter in the adata with dimension of (329, 1442). I noticed you ran the model with path as input, could you double check if this adata is the same as the one you did with sc.pp.highly_variable_genes(adata). Or you could directly take adata object as input and see if the error persists.
Bests, Mingze
Hi @eijynagai,
I also noticed you have around 1400 genes in adata, which is less than default 2k highly variable genes, please try reducing the parameter config.n_top_genes to say 1400 or 1300 and see if the problem is solved. Let me know if this doesn't work as well. :)
Bests, Mingze
Hi @michaelgmz,
Thanks very much for the lightning-speed response! Indeed, I forgot to point to the correct object with "highly_variable" in it after including it! Apologies for the newbie issue.
However, after that, I got another error.
adata = utv.run_model("results/velocity_integrated2.h5ad", label="seurat_clusters", config_file="config.py")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_1863459/673538557.py in <module>
----> 1 adata = utv.run_model("results/velocity_integrated2.h5ad", label="seurat_clusters", config_file="config.py")
~/miniconda3/envs/unitvelo/lib/python3.7/site-packages/unitvelo/main.py in run_model(adata, label, config_file, normalize)
26
27 from .utils import init_config_summary, init_adata_and_logs
---> 28 config, _ = init_config_summary(config=config_file)
29 adata, data_path = init_adata_and_logs(adata, config, normalize=normalize)
30
~/miniconda3/envs/unitvelo/lib/python3.7/site-packages/unitvelo/utils.py in init_config_summary(config)
535 config = Configuration()
536
--> 537 if config.FIT_OPTION == '1':
538 config.DENSITY = 'SVD' if config.GENE_PRIOR == None else 'Raw'
539 config.REORDER_CELL = 'Soft_Reorder'
AttributeError: 'str' object has no attribute 'FIT_OPTION'
I tried modifying to 1 or 2 both config.py I indicate and the one in the conda package, but it doesn't work. Do you know what could it be? Thank you again.
Hi @eijynagai,
The input of parameter 'config_file' should be the class within that file, not .py file itself.
Try the following code and see if it works, velo = utv.config.Configuration() velo.R2_ADJUST = True velo.FIT_OPTION = '1' adata = utv.run_model("results/velocity_integrated2.h5ad", label="seurat_clusters", config_file=velo)
Bests.
Hi @michaelgmz,
It's now running swiftly, problem solved! Thanks very much for your support!
Best regards,
Hello dev team! Thank you so much for developing such an amazing tool!
I'm trying to run unitvelo and got an error about "highly_variable". I checked the adata.var and there are highly variable genes there. Could you help figure out how to solve this issue?
What I did a step before is to integrate adata obtained from Seurat convertion with loom files with unspliced and spliced:
These are the variables in the adata
And I added the highly variable through the command:
sc.pp.highly_variable_genes(adata)
When I run the UniTVelo command, I get the following error
I appreciate your support in advance.