theislab / single-cell-tutorial

Single cell current best practices tutorial case study for the paper:Luecken and Theis, "Current best practices in single-cell RNA-seq analysis: a tutorial"
1.42k stars 465 forks source link

sc.tl.rank_genes_groups , p value question #114

Open ruiqiizhou opened 10 months ago

ruiqiizhou commented 10 months ago

When I use function sc.tl.rank_genes_groups(adata, 'Cell Type', method='wilcoxon', pts = True,tie_correct = True) , 'Cell Type' only contains 2 groups, I want to check adjusted p values, then I use pd.DataFrame(adata.uns['rank_genes_groups']['pvals_adj']). It gave me 2 different columns adjusted p values. I am not sure how can I interpret these two different p values. I just wanna use p value to check interested genes differential expression in two groups. In which group is this gene expressed more significantly? Which value I should trust?

LuckyMD commented 10 months ago

Hi @ruiqiizhou,

Are the p-values in both different? If you have 2 cell types and you use a general sc.tl.rank_genes_groups call, then it test cell type A vs cell type B, and cell type B vs cell type A. It's set up this way as it always tests A vs rest, B vs rest, etc. That should result in p-values for both sides of the test. They should thus be the same. If not, maybe this question is best asked on the scanpy github at scverse.