Entering edit mode
4.4 years ago
halo22
▴
300
Hello All,
I am trying to make a group-wise comparison between 4 groups using DESeq2. After writing the contrast for the group comparisons, I see that log2foldchange and the lfcSE are different for each comparison but values for stat and p-value are the same for each comparison. Eg: Group1_vs_Group2 has the same P-values and stat as Group1_vs_Group3. I don't think this is correct. I'd really appreciate it if you could look at it and let me know if I am making a mistake with model building for any other thing.
Thanks
library(DESeq2)
Pheno <- read.csv('xxxxxxx.csv', header=T,sep=",")
Data <- read.csv('yyyyyyy.csv', header=T,row.names=1)
Pheno$Position <- as.character(Pheno$Position)
Data <- Data[,Pheno$Position]
dds <- DESeqDataSetFromMatrix(countData = Data,
colData = Pheno,
design = ~ Groups)
#design(dds) = ~ Groups
dds = DESeq(dds, test = "LRT", reduced = ~ 1)
group1_group2 <- results(dds, contrast=c("Groups", "Group1", "Group2"))
group1_group2 <- group1_group2[!is.na(group1_group2$pvalue),]
group1_group2 <- group1_group2[order(group1_group2$pvalue), decreasing = T]
group1_group3 <- results(dds, contrast=c("Groups", "Group1", "Group3"))
group1_group3 <- group1_group3[!is.na(group1_group3$pvalue),]
group1_group3 <- group1_group3[order(group1_group3$pvalue), decreasing = T]
I think it's because you used the LRT test so the p-value is computed on including the groups vs. omitting them. Try with Wald test and see if you get the same p-value again.
Thanks, @Asaf. I went through the vignette and found that 'LRT' would give a P-value if there is any difference between groups. Wald is exactly what I was looking for.