Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent FoldChanges in FindMarkers for different tests #8788

Open
morallawwithin opened this issue Apr 18, 2024 · 1 comment
Open

Inconsistent FoldChanges in FindMarkers for different tests #8788

morallawwithin opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@morallawwithin
Copy link

I noticed that there are differences in FC when using different types of tests for DE. The magnitude of these changes is somehow related to the number of feature that each test reports back. I could reproduce this bug with the ifnb dataset, but on my own data these difference are even higher (sometimes up to 1).

library(Seurat)
library(SeuratData)
library(DESeq2)
InstallData("ifnb")
ifnb <- LoadData("ifnb")
ifnb <- NormalizeData(ifnb)
ifnb$celltype.stim <- paste(ifnb$seurat_annotations, ifnb$stim, sep = "_")
Idents(ifnb) <- "celltype.stim"
mono.Wilcox <- FindMarkers(ifnb, ident.1 = "CD14 Mono_STIM", ident.2 = "CD14 Mono_CTRL")
mono.DESeq <- FindMarkers(ifnb, ident.1 = "CD14 Mono_STIM", ident.2 = "CD14 Mono_CTRL", test.use = "DESeq2")

Notice the difference between

head(mono.DESeq, n = 3)
       p_val avg_log2FC pct.1 pct.2 p_val_adj
CCL8       0   9.225442 0.918 0.017         0
CXCL11     0   8.789423 0.932 0.012         0
CXCL10     0   8.335510 0.984 0.035         0

and

head(mono.Wilcox, n = 3)
       p_val avg_log2FC pct.1 pct.2 p_val_adj
CCL8       0   9.134191 0.918 0.017         0
CXCL11     0   8.624208 0.932 0.012         0
CXCL10     0   8.036564 0.984 0.035         0

while

nrow(mono.DESeq)
[1] 7347
nrow(mono.Wilcox)
[1] 6956

From the documentation it is clear that test.use only influences the p_val and the features that get returnd.

@morallawwithin morallawwithin added the bug Something isn't working label Apr 18, 2024
@mhkowalski
Copy link
Contributor

Hi,

Thanks for reaching out and for you providing a reproducible example. What version of Seurat are you using? When I run with most recent versions, I don't see a discrepancy.

> head(mono.Wilcox)
        p_val avg_log2FC pct.1 pct.2 p_val_adj
IFIT1       0   7.319139 0.985 0.033         0
CXCL10      0   8.036564 0.984 0.035         0
RSAD2       0   6.741673 0.988 0.045         0
TNFSF10     0   6.991279 0.989 0.047         0
IFIT3       0   6.883785 0.992 0.056         0
IFIT2       0   7.179929 0.961 0.039         0
> head(mono.DESeq)
        p_val avg_log2FC pct.1 pct.2 p_val_adj
IFIT1       0   7.319139 0.985 0.033         0
CXCL10      0   8.036564 0.984 0.035         0
RSAD2       0   6.741673 0.988 0.045         0
TNFSF10     0   6.991279 0.989 0.047         0
IFIT3       0   6.883785 0.992 0.056         0
IFIT2       0   7.179929 0.961 0.039         0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants