You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

EdgeR DGE矩阵解析:时间点与性别交互效应结果疑问

差异表达分析:性别与时间点交互效应的疑问解答

我正在开展两个时间点的差异表达分析,已纳入年龄、种族作为协变量,目标是进一步探究时间点间的表达差异在男性和女性中是否存在区别。

设计矩阵构建代码

Timepoint <- factor(meta.data_sub$Group3)
Age <- as.numeric(meta.data_sub$Age)
Sex <- factor(meta.data_sub$Sex2)
Ethnicity <- factor(meta.data_sub$Ethnicity)

design <- model.matrix(~Age +Ethnicity +Sex +Timepoint:Sex) 

head(design)

设计矩阵预览

A matrix: 6 × 17 of type dbl    
(Intercept) Age EthnicityB  EthnicityC  EthnicityD  EthnicityE  EthnicityF  EthnicityH  EthnicityJ  EthnicityK  EthnicityL  EthnicityM  EthnicityN  EthnicityR  Sex2    Sex1:Timepoint1 Sex2:Timepoint1
1   1   50.5    0   0   0   0   0   0   0   0   0   0   0   0   1   0   0
2   1   39.7    0   0   0   0   0   0   0   0   0   0   1   0   1   0   0
3   1   33.5    0   0   1   0   0   0   0   0   0   0   0   0   1   0   0
4   1   51.7    0   1   0   0   0   0   0   0   0   0   0   0   1   0   0
5   1   30.5    0   0   0   0   0   0   0   0   0   0   0   0   1   0   0
6   1   37.7    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

后续分析代码

dge <- estimateDisp(dge, design = design)
fit <- glmQLFit(dge, design = design,dispersion=dge$common.dispersion, coef=16:17)
qlf <- glmQLFTest(fit, coef=16:17)

分析结果预览

tt <- topTags(qlf, n = Inf) 
head(tt)

      logFC.Sex1.Timepoint1 logFC.Sex2.Timepoint1   logCPM    F PValue  FDR

APOA1   0.35602471          0.3927851         15.964477 70.22736    5.186215e-23    1.747755e-20

疑问

    1. logFC.Sex1.Timepoint1是否代表Sex1群体中时间点0与1之间的log2表达倍数变化?
    1. 输出结果中的PValue和FDR是用于比较性别间的差异,还是时间点间的差异?

解答

针对疑问1

是的,logFC.Sex1.Timepoint1就是Sex1群体中,时间点1相对于时间点0的log2倍数变化。你的设计矩阵里,Timepoint:Sex是时间点和性别的交互项:

  • 从设计矩阵列名看,Sex2是单独的列,说明Sex的参考水平是Sex1;
  • Sex1:Timepoint1系数直接对应Sex1群体内时间点1 vs 0的表达差异;
  • Sex2:Timepoint1则对应Sex2群体内时间点1 vs 0的表达差异。

针对疑问2

输出的PValue和FDR是检验两个交互项系数是否同时不为0,本质是判断「时间点对表达的影响是否存在性别特异性」——也就是时间点间的表达差异在不同性别中是否存在显著区别。

具体来说,你指定coef=16:17做检验,原假设是「这两个系数都为0」:

  • 拒绝原假设意味着至少有一个群体存在时间点差异,或者两个群体的时间点差异有显著不同;
  • 如果要单独看某个性别内的时间点差异,需要单独针对对应系数做检验;
  • 如果要直接对比两个性别间的时间点差异,需要构建对比矩阵检验Sex1:Timepoint1 - Sex2:Timepoint1 = 0。

内容的提问来源于stack exchange,提问作者Elizabeth Mist

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 22:55:10