Question: Aclaration of batch effect adjust in DE analysis
0
7 months ago by
IRAIA.MAIALEN0 wrote:

Hi everyone! I have a problem understanding the protocol of edgeR, where a batch effect is adjusted in differential expression analysis (4.2.8).

I have also a batch effect in my samples and I have constructed the design matrix like this:

> design
conditionControl conditionMorphine batch2
C_P1_54                1                 0      0
C_P1_55                1                 0      1
M_P1_60                0                 1      0
M_P1_61                0                 1      1
attr(,"assign")
[1] 1 1 2
attr(,"contrasts")
attr(,"contrasts")$condition [1] "contr.treatment" attr(,"contrasts")$batch
[1] "contr.treatment"


Is this correct?

Moreover, I have followed the example of edgeR protocol from the top to the final step, but I don't understand how the batche effect is taken into account in the final contrast. It says "First we check whether there was a genuine need to adjust for the experimental times. We do this by testing for differential expression between the three times. There is considerable differential expression, justifying our decision to adjust for the batch effect:" And then "Now conduct QL F-tests for the pathogen effect and show the top genes. By default, the test is for the last coefficient in the design matrix, which in this case is the treatment effect:" So am I correct thinking that in the second test the batch effect is taken into account even if we don't add it to the commandd? The fact that we have been including it during all the analysis makes that the values are already adjusted? Or am I missing something important?

rnaseq edger batch effect • 208 views
modified 7 months ago by James W. MacDonald50k • written 7 months ago by IRAIA.MAIALEN0
1
7 months ago by
United States
James W. MacDonald50k wrote:

Yes it's correct, assuming that you have two batches and one sample of each condition in each batch.

The batch effect isn't taken into account in the final contrast. It was taken into account when you fit the model. You can see if the batch effect is necessary in two ways. First, you could plot a MDS or PCA plot of your samples and see if there appears to be a batch effect. Secondly, you could test for significance of your third coefficient (the batch effect), and if you get lots (for some definition of 'lots') of genes that are significant, then you can say it is probably necessary.