Entering edit mode
17 months ago
ES
•
0
Hi,
I am using scanpy for scRNA-seq analysis. Please could someone help with how to subset an AnnData object to remove samples with a number of cells below a threshold? Could I use an extension of the value_counts() function?
e.g. adata.obs['Sample'].value_counts() < 500
Thank you!
You can filter your cells and genes count with
sc.pp.filter_cells(adata, min_genes=200)
andsc.pp.filter_genes(adata, min_cells=3)
, respectively.Thank you for your reply, I do use the filters you mentioned. But what I'd like to do is remove a whole sample based on the total number of cells in that sample, rather than just filtering genes and cells (not from a specific sample).