when I select a subset of cells using ad_sub=ad[ad.obs['louvain']=='subcluster_of_interest',:], and then re-apply preprocessing routines, this will use only the genes of ad.X (variable over the entire dataset), but not those that are variable only within the subcluster and might be informative for its substructure even if the variance doesn't pass the cutoff when evaluated over the entire dataset. basically, the set of variable genes can only shrink by subsetting..
when I select a subset of cells using
ad_sub=ad[ad.obs['louvain']=='subcluster_of_interest',:]
, and then re-apply preprocessing routines, this will use only the genes ofad.X
(variable over the entire dataset), but not those that are variable only within the subcluster and might be informative for its substructure even if the variance doesn't pass the cutoff when evaluated over the entire dataset. basically, the set of variable genes can only shrink by subsetting..I'd propose to either use
to "reset" the
.X
matrix (maybe there's a better way?) or to makesc.pp.highly_variable_genes
work onad.raw.X