Hi,
I want to compare the differences among 3 genotypes, namely Hom, Het and WT.
Since there are three groups, I use test = LRT
.
Code as following:
# Construct dds
dds <- DESeqDataSetFromMatrix(countData = cts_br_filter,
colData = metadata_br_filter,
design = ~ TissueArea + Genotype)
# Run DESeq2
dds <- DESeq(dds, test = "LRT", reduced = ~ TissueArea)
When I used resultsNames(dds)
, I do not understand the output: why there is no "Genotype_Hom_vs_Het"? For the TissueArea, what do those mean?
> resultsNames(dds)
[1] "Intercept" "TissueArea_corpus.callosum_vs_cerebellum"
[3] "TissueArea_hippocampus_vs_cerebellum" "TissueArea_prefrontal.cortex_vs_cerebellum"
[5] "Genotype_Het_vs_WT" "Genotype_Hom_vs_WT"
When I want to extract the results for "Hom" vs "Het", an error occurs.
res_HomHet <- results(dds, contrast = c("Genotype", "Hom", "Het"))
res_HomHet_shrunken <- lfcShrink(dds, coef = "Genotype_Hom_vs_Het", type = "apeglm")
> res_HomHet_shrunken <- lfcShrink(dds, coef = "Genotype_Hom_vs_Het", type = "apeglm")
Error in lfcShrink(dds, coef = "Genotype_Hom_vs_Het", type = "apeglm") :
coef %in% resultsNamesDDS is not TRUE
If I want to get the results for "Hom" vs "Het", what should I do?
Look forward to your reply!
Many thanks to your reply!
I have one more question:
I can use
res_HomHet <- results(dds, contrast = c("Genotype", "Hom", "Het"))
to get the result, but just cannot shrink. Is this result the real Hom vs Het? Can I use this unshrunk value for further analysis like extracting significant DEGs?Or do I need to relevel just as you did
colData(fake0)$condition <- relevel(colData(fake0)$condition, "Treat1")
to get the Treat2 vs Treat1?Note that the lfc is not part of the LRT testing. LRT os a goodness of fit test. I would use Wald here, and reserve LRT for something like timecourse experiments with many TPs. You can use contrasts to shrink if using the ashr method.
Thank you for your reply!
But according to DESeq2 tutorial, The LRT is therefore useful for testing multiple terms at once, for example testing 3 or more levels of a factor at once, or all interactions between two variables. I thought the Wald test is just like t-test can only used for two groups comparison. You think it is better to use Wald here?
Yes, but you only have three groups, wouldn't it (interpret-wise) be much more intuituve to do geno1-geno2, geno2-geno3 and geno1-geno3? The Wald test tests fold changes so you have quantitiative information. It's on you of course but LRT in my mind is when you have for example a time course across a dozen TPs and parwise would give excessively much contrasts.
Thank you for your reply!
I am not sure if it is the same as the t-test and ANOVA. Because for more than 3 groups, if using a t-test, the p-value is not correct.