I am analyzing rna-seq data in the format of counts. There is batch effect revealed by PCA.

One method I tried called RUVseq, it estimated the variation basing on control genes, and then added it to design matrix. I don't know why simply adding a continuous variable will work.

Here is an example, the experiment setting is:

samples groups
      A      1
      B      1
      C      1
      D      2
      E      2
      F      2
      G      3
      H      3
      I      3

Then RUVseq methods could estimate the unwanted variation, for example,

B <- (-0.37670272 , 2.44136463, -0.79533912, -0.05487747,  0.25014132,  0.61824329 -0.17262350 ,-2.22390027, -1.26361438)

Then combine them together:

samples groups           B
      A      1 -0.37670272
      B      1  2.44136463
      C      1 -0.79533912
      D      2 -0.05487747
      E      2  0.25014132
      F      2  0.61824329
      G      3 -0.17262350
      H      3 -2.22390027
      I      3 -1.26361438

Make a design matrix to fit glm, an example of design is

model.matrix( ~ 0 + groups + B)

My question is why this works? The coefficient of continuous variable means how many the read counts of genes will change of one unit of B changed, right? Then why B could be used for correcting the batch effect?


Each sample is associated with some factors of interest that may affect the expression (such as "group"). In addition, there are some factors that affect the expression but are of no interest ("batch factors"). Initially, you don't know that the latter are. In your example, they assume that there is only one continuous "nuisance" factor B. It is possible to estimate the level of B for each sample using the control genes.

If you don't include B in the right-hand side of the model, the variance of response explained by B will be added to the error term, which may inflated p-values for "group" and reduce the power.

An interesting question is what happens when the batch effect is perfectly correlated with the effect of interest. E.g. suppose there are two groups. In group 1, B is equal to 5, in group 2 it's equal to -5. Then it's impossible to say whether change in expression is due to group or B. In your example, there is probably some confounding as well, but it's not 100%.

  • $\begingroup$ Thanks, the last point is very interesting. Could you suggest some references on adding continuous value to adjust batch effect in linear regression? $\endgroup$
    – ccshao
    Aug 29 '14 at 16:12
  • $\begingroup$ The manual itself: bioconductor.org/packages/devel/bioc/manuals/RUVSeq/man/… which contains more references to some papers. $\endgroup$
    – James
    Aug 29 '14 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.