How to subset anndata based on variable
Hello, I want to subset anndata on basis of highly variable gene (stored in .var), but i am not able to understand how to do it.
I tried using adata.var["highly_variable"] == 'True' which gave me an error, while adata.var['highly_variable] returns all the values (boolean) under "highly_variable".
Any help is highly appreciated. Thank you!
• 7,727 views
•
link
0 answers
No answers yet.
Log in to answer this question.
try only
subset = adata[:, adata.var["highly_variable"]]Thank you!