DE using t-test overest var producing many non DE genes

Hello,

I’m getting a lot of non-DE genes after I do “t-test overest var” between clusters. Same happens with wilcoxon. I did this on an anndata object that I scaled after mnn_correct and clustering.

## Scale raw mtx 
b = sc.AnnData(X = corr_data.raw.X, var = corr_data.raw.var, 
               obs = corr_data.obs)
# If False, omit zero-centering variables, which allows to handle 
# sparse input efficiently.
sc.pp.scale(b, max_value = 10, zero_center = False)
bdata = corr_data.copy()
del bdata.raw
bdata.raw = b

In Seurat there’s parameters that allow a parameter to exclude genes that don’t meet extra criteria, so to get rid of these streaks that occur across the heatmap. I haven’t tried this function yet but is this the function I should use to try doing the same? https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.filter_rank_genes_groups.html

This is discussed here: Why max_out_group_fraction in sc.tl.filter_rank_genes_groups set to 0.5

This is me mostly talking out loud I guess (apologies) but would like to get someone’s thoughts on this. Also, I previously had an error message saying:

/Users/cahanlab/anaconda3/envs/pyEnv2/lib/python3.6/site-packages/scanpy/tools/_rank_genes_groups.py:252: RuntimeWarning: invalid value encountered in log2
  rankings_gene_logfoldchanges.append(np.log2(foldchanges[global_indices]))

I set zero_center = False and that went away. Not sure of the ramifications of this but I do have a sparse matrix and it said it would speed it up so I thought it wouldn’t be that bad. Can someone elaborate on this?