How to subset anndata based on variable
0
0
Entering edit mode
19 months ago
Emily ▴ 70

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!

python scRNA AnnData scanpy pandas • 4.2k views
ADD COMMENT
1
Entering edit mode

try only subset = adata[:, adata.var["highly_variable"]]

ADD REPLY
0
Entering edit mode

Thank you!

ADD REPLY

Login before adding your answer.

Traffic: 2577 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6