01

05

09

差异分析是否需要比较矩阵

• 表达矩阵
• 分组矩阵
• 差异比较矩阵

大家仔细观察下面的两个代码

首先是不需要差异比较矩阵的

```    library(CLL)
data(sCLLex)
library(limma)
design=model.matrix(~factor(sCLLex\$Disease))
fit=lmFit(sCLLex,design)
fit=eBayes(fit)
options(digits = 4)
logFC AveExpr      t   P.Value adj.P.Val     B
39400_at  1.0285   5.621  5.836 8.341e-06   0.03344 3.234
36131_at -0.9888   9.954 -5.772 9.668e-06   0.03344 3.117
33791_at -1.8302   6.951 -5.736 1.049e-05   0.03344 3.052
1303_at   1.3836   4.463  5.732 1.060e-05   0.03344 3.044
36122_at -0.7801   7.260 -5.141 4.206e-05   0.10619 1.935
36939_at -2.5472   6.915 -5.038 5.362e-05   0.11283 1.737
41398_at  0.5187   7.602  4.879 7.824e-05   0.11520 1.428
32599_at  0.8544   5.746  4.859 8.207e-05   0.11520 1.389
36129_at  0.9161   8.209  4.859 8.212e-05   0.11520 1.389
37636_at -1.6868   5.697 -4.804 9.355e-05   0.11811 1.282
```

然后是需要差异比较矩阵的

```    library(CLL)
data(sCLLex)
library(limma)
design=model.matrix(~0+factor(sCLLex\$Disease))
colnames(design)=c('progres','stable')
fit=lmFit(sCLLex,design)
cont.matrix=makeContrasts('progres-stable',levels = design)
fit2=contrasts.fit(fit,cont.matrix)
fit2=eBayes(fit2)
options(digits = 4)

logFC AveExpr      t   P.Value adj.P.Val     B
39400_at -1.0285   5.621 -5.836 8.341e-06   0.03344 3.234
36131_at  0.9888   9.954  5.772 9.668e-06   0.03344 3.117
33791_at  1.8302   6.951  5.736 1.049e-05   0.03344 3.052
1303_at  -1.3836   4.463 -5.732 1.060e-05   0.03344 3.044
36122_at  0.7801   7.260  5.141 4.206e-05   0.10619 1.935
36939_at  2.5472   6.915  5.038 5.362e-05   0.11283 1.737
41398_at -0.5187   7.602 -4.879 7.824e-05   0.11520 1.428
32599_at -0.8544   5.746 -4.859 8.207e-05   0.11520 1.389
36129_at -0.9161   8.209 -4.859 8.212e-05   0.11520 1.389
37636_at  1.6868   5.697  4.804 9.355e-05   0.11811 1.282```

design=model.matrix(~factor(sCLLex\$Disease))

design=model.matrix(~0+factor(sCLLex\$Disease))

用limma包对芯片数据做差异分析

rownames(exprSet)=exprSet[,1]

exprSet=exprSet[,-1]