text: user15648: I understand GSEA/GSVA can take microarray-like expression matrix such as the output of voom() or vst(). However, I have a question on how we can also use svaseq() variables, correct the output from voom() or vst(), and apply GSVA on it.
  I assume this is possible since I have read papers showing PCA after correction by SVA (such as this one and this one in their supplementary figure), but my statistical and coding knowledge does not allow me to recreate what they do. Is there a known pipeline that can do this
  Edit: to clarify, I would like to generate a normalised matrix (e.g. rlog, or out put of voom from limma, or vst from DESeq2) that is adjusted for batch effect. ComBat, for example, can provide what I need. However, since I am doing my DESeq2 DGE analysis with svaseq(), I want to adjust it with svaseq variables. I am wondering if there are pipelines that can use svaseq vairables (or any varaibles) and adjust the value in the normalised expression matrix.
  
  user15650: Use removeBatchEffects from limma. The input counts should be on log scale, so vst and rlog are ok. The covariate argument can take the surrogate matrix from svaseq.
  https://rdrr.io/bioc/limma/man/removeBatchEffect.html
  
original_text: 15648: <p>I understand GSEA/GSVA can take microarray-like expression matrix such as the output of voom() or vst(). However, I have a question on how we can also use svaseq() variables, correct the output from voom() or vst(), and apply GSVA on it.</p>
  <p>I assume this is possible since I have read papers showing PCA after correction by SVA (such as this <a href="https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0061088" rel="nofollow noreferrer">one</a> and this <a href="https://www.pnas.org/doi/10.1073/pnas.1814397115" rel="nofollow noreferrer">one</a> in their supplementary figure), but my statistical and coding knowledge does not allow me to recreate what they do. Is there a known pipeline that can do this</p>
  <p>Edit: to clarify, I would like to generate a normalised matrix (e.g. rlog, or out put of voom from limma, or vst from DESeq2) that is adjusted for batch effect. ComBat, for example, can provide what I need. However, since I am doing my DESeq2 DGE analysis with svaseq(), I want to adjust it with svaseq variables. I am wondering if there are pipelines that can use svaseq vairables (or any varaibles) and adjust the value in the normalised expression matrix.</p>
   15650: <p>Use <code>removeBatchEffects</code> from <code>limma</code>. The input counts should be on log scale, so <code>vst</code> and <code>rlog</code> are ok. The <code>covariate</code> argument can take the surrogate matrix from svaseq.</p>
  <p><a href="https://rdrr.io/bioc/limma/man/removeBatchEffect.html" rel="nofollow noreferrer">https://rdrr.io/bioc/limma/man/removeBatchEffect.html</a></p>
  