Entering edit mode
Natasha
▴
440
@natasha-4640
Last seen 10.3 years ago
Dear List,
I have a dataset with 3 conditions (control and 2 treatments), 2
replicates each. Initially I carried out a normal analysis in DESeq -
each treatment vs the control, but later was told it needed to be a
paired analysis.
Thus, just to be consistent I decided to use DESeq itself. However, I
am unsure how to extract my comparisons of interest.
------
Code:
>design
condition pair
1 Cont 1
2 Cont 3
3 Trt1 1
4 Trt1 3
5 Trt2 1
6 Trt2 3
>cds2 <- newCountDataSet(gct, design)
>cds2 <- estimateSizeFactors(cds2)
>sizeFactors(cds2)
Cont_1 Cont_3 Trt1_1 Trt1_3 Trt2_1 Trt2_3
0.9373964 1.1328686 1.0097990 1.0596419 0.8562104 1.0645546
.cds2 <- estimateDispersions(cds2,"pooled-CR",modelFormula=count ~
pair + condition)
>fit1 = fitNbinomGLMs(cds2, count ~ pair + condition)
>fit0 = fitNbinomGLMs(cds2, count ~ pair)
>str(fit1)
'data.frame': 4765 obs. of 6 variables:
$ (Intercept): num 10.19 9.99 6.89 6.48 4.46 ...
$ pair3 : num -0.3018 -0.3222 0.068 0.0468 0.1504 ...
$ conditionTrt1: num 0.17 0.142 -0.495 0.125 0.319 ...
$ conditionTrt2: num 0.1882 0.00112 -0.2704 -0.09412 0.10651 ...
$ deviance : num 0.0742 0.1569 0.9072 2.0612 0.3702 ...
$ converged : logi TRUE TRUE TRUE TRUE TRUE TRUE ...
- attr(*, "df.residual")= num 2
>head(fit1)
(Intercept) pair3 conditionTrt1 conditionTrt2
deviance converged
gene0 10.188336 -0.30184662 0.1698471 0.188197344 0.0741656
TRUE
gene1 9.992372 -0.32221027 0.1415406 0.001119304 0.1568869
TRUE
gene10 6.893693 0.06795915 -0.4954365 -0.270402107 0.9072335
TRUE
gene100 6.477847 0.04684995 0.1250743 -0.094116036 2.0611685
TRUE
gene1002 4.463446 0.15038277 0.3186187 0.106512332 0.3701619
TRUE
gene1003 4.090079 -0.05247162 -0.3560189 -0.054765642 1.9631768
TRUE
>pvalsGLM = nbinomGLMTest( fit1, fit0 )
>padjGLM = p.adjust(pvalsGLM, method="BH" )
---------
Based on the above how do I extract:
1) Trt1 vs Cont? - is this the 3rd column of fit1, depicted as
log2 FoldChange?
2) Trt2 vs Cont? - is this the 4th column of fit1, depicted as
log2 FoldChange?
3) What would the p-values for each comparison be? As pvalsGLM
and padjGLM gives only one set, and I don't think it will be the same
for both comparisons.
Many Thanks,
Natasha
[[alternative HTML version deleted]]