how to set design for this DOE in DESeq2
1
1
Entering edit mode
@aiminatwork-12324
Last seen 4.8 years ago

I have a data set from the following Design of Experiment(DOE)

sample                   batch                   condition
FRT19A_se             se                         FRT19A_Control_2
Hinfp_A_G_se        se                         Hinfp_A_G_point_mutant
Hinfp_M2_11_se     se                          Hinfp_M2_11_Deletion_mutant
W1118_se               se                          W1118_Control_1
FRT19A_pe            pe                          FRT19A_Control_2
Hinfp_A_G_pe        pe                          Hinfp_A_G_point_mutant
Hinfp_M2_11_pe    pe                          Hinfp_M2_11_Deletion_mutant
W1118_pe              pe                          W1118_Control_1

We want to perform the following comparisons:

FRT19A vs Hinfp_A_G
FRT19A vs Hinfp_M2_11
W1118 vs Hinfp_A_G
W1118 vs Hinfp_M2_11
FRT19A vs W1118

Note: I have 4 samples, each has a replicate in batch(SE), another replicate in batch(PE)

My question is:

is this doable in DESeq2?

I did setting like

ddsFullCountTable<-DESeqDataSetFromMatrix(
  countData=dataCount,
  colData=DOE,
  design= ~batach + condition + batach:condition)
dds <-DESeq(ddsFullCountTable)

I got

estimating size factors
estimating dispersions
Error in checkForExperimentalReplicates(object, modelMatrix) : 

  The design matrix has the same number of samples and coefficients to fit,
  so estimation of dispersion is not possible. Treating samples
  as replicates was deprecated in v1.20 and no longer supported since v1.22.

I think this does make sense, because, statistically, For this DOE, parameters are not estimable

Then I tried:

ddsFullCountTable<-DESeqDataSetFromMatrix(
  countData=rawdata.tli.after.filter.by.cpm,
  colData=DOE.2,
  design= ~batch+condition)
re.se.pe.DOE.2 <- results(dds.DOE.2)

Then DESeq2 did get results !

However, I do not understand How DESeq2 calculate p value for this DOE?

Does anyone can help me on this?

Thank you,

Aimin

deseq2 • 972 views
ADD COMMENT
0
Entering edit mode

I had some typo, it should be:

> ddsFullCountTable<-DESeqDataSetFromMatrix(
+   countData=rawdata.tli.after.filter.by.cpm,
+   colData=DOE.2,
+   design= ~batch + condition + batch:condition)
> dds <-DESeq(ddsFullCountTable)
estimating size factors
estimating dispersions
Error in checkForExperimentalReplicates(object, modelMatrix) : 

  The design matrix has the same number of samples and coefficients to fit,
  so estimation of dispersion is not possible. Treating samples
  as replicates was deprecated in v1.20 and no longer supported since v1.22.

ADD REPLY
0
Entering edit mode
@mikelove
Last seen 2 hours ago
United States

Remove the interaction of batch and condition. Just use ~batch + condition as we have in the vignette.

ADD COMMENT
0
Entering edit mode

Thank you, Yes, I did this way, I am just interested in how DESeq2 calculate statistics for p-values for this design, it seems in this design, the error between batches is confounding with residual error, and I did observed strong batch effect.

Aimin

ADD REPLY
0
Entering edit mode

One way is, DESeq2 treats batch:residual as residual like the following way

design= ~batch + condition + batch:residual+residual

Am I right?

Thank you

ADD REPLY
0
Entering edit mode

DESeq2's approach to correction for batches (without using SVA or RUV) assumes that there isn't an intersection with batch effects and condition effects, but that they are linear and additive on the log counts.

ADD REPLY
0
Entering edit mode

Thank you, if so, how can I get the the log counts after adjusting batch effects? I got the the following modelMatrix

> modelMatrix
               Intercept group_se_rep1_vs_pe_rep1 condition_Hinfp_A_G_point_mutant_vs_FRT19A_Control_2
FRT19A_se              1                        1                                                    0
Hinfp_A_G_se           1                        1                                                    1
Hinfp_M2_11_se         1                        1                                                    0
W1118_se               1                        1                                                    0
FRT19A_pe              1                        0                                                    0
Hinfp_A_G_pe           1                        0                                                    1
Hinfp_M2_11_pe         1                        0                                                    0
W1118_pe               1                        0                                                    0
               condition_Hinfp_M2_11_Deletion_mutant_vs_FRT19A_Control_2
FRT19A_se                                                              0
Hinfp_A_G_se                                                           0
Hinfp_M2_11_se                                                         1
W1118_se                                                               0
FRT19A_pe                                                              0
Hinfp_A_G_pe                                                           0
Hinfp_M2_11_pe                                                         1
W1118_pe                                                               0
               condition_W1118_Control_1_vs_FRT19A_Control_2
FRT19A_se                                                  0
Hinfp_A_G_se                                               0
Hinfp_M2_11_se                                             0
W1118_se                                                   1
FRT19A_pe                                                  0
Hinfp_A_G_pe                                               0
Hinfp_M2_11_pe                                             0
W1118_pe                                                   1
attr(,"assign")
[1] 0 1 2 2 2
attr(,"contrasts")
attr(,"contrasts")$group
[1] "contr.treatment"

attr(,"contrasts")$condition
[1] "contr.treatment"
ADD REPLY
0
Entering edit mode

This has been asked before on the support site some times. Basically DESeq2 doesn’t offer any functionality to remove batch effects from counts or log counts.

ADD REPLY

Login before adding your answer.

Traffic: 938 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6