Answers.Body: <p>You can just remove the first component from the dataset by setting the first eigenvalue to 0 in the diagonal matrix and then multiplying the SVD matrices. </p>
  
  <p>I am not sure which R code you are using to estimate the components (I have a comparison of PCA code in R on <a href="https://github.com/aedin/ODSC_2018/tree/master/PCA_vignette" rel="nofollow noreferrer">https://github.com/aedin/ODSC_2018/tree/master/PCA_vignette</a>)  </p>
  
  <p>In ade4 R package, there is a function <code>reconst()</code> which reconstructs data from a selection of components: <a href="https://rdrr.io/rforge/ade4/man/reconst.html" rel="nofollow noreferrer">https://rdrr.io/rforge/ade4/man/reconst.html</a></p>
  
  <p>Happy to provide code to do this in other PCA versions if needed
  Aedin Culhane</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-22T17:55:57.070Z
Answers.Text: Thank you for your suggestion. I am more of a molecular biologist so I don't quite know how to do it. I understand vaguely the concept but not the actually steps. Or is it what ade4 does to remove the first component?
Answers.UserDisplayName: Kent
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-08T21:26:00.047Z
Answers.LastActivityDate: 2020-02-03T05:11:26.483Z
Answers.LastEditDate: 2020-02-03T05:11:26.483Z
Answers.UserDisplayName: Aedin
Body: <p>I have been working on RNA-Seq data from two different cohorts, and they show very strong batch effect (~35% variance explained by 1st component in PCA). Since I am trying to do a class discovery from a data set with the subtype of only some samples are known, the only methods I have been using are ComBat and pSVA from SVA package. I would like to compare them with more methods to make the clustering result more trust-worthy.</p>
  
  <p>I found that some papers used sva package, but not citing the paper on pSVA, meaning perhaps there are some other ways to use sva for this type of data that I am not aware of. Is there a method to construct a null model and a full model for sva only by knowing the batch the samples are from?</p>
  
  <p>Any other suggestion of batch effect correction tools for a data set with no known phenotype/subtype are also welcome.</p>
  
Tags: <rna-seq><clustering><batch-effects><combat><sva>
Title: sva for RNA-Seq data without known phenotype
ThreadText: # sva for RNA-Seq data without known phenotype
  
  (Asked by: username_0 on 2019-01-03)
  
  I have been working on RNA-Seq data from two different cohorts, and they show very strong batch effect (~35% variance explained by 1st component in PCA). Since I am trying to do a class discovery from a data set with the subtype of only some samples are known, the only methods I have been using are ComBat and pSVA from SVA package. I would like to compare them with more methods to make the clustering result more trust-worthy.
  
  I found that some papers used sva package, but not citing the paper on pSVA, meaning perhaps there are some other ways to use sva for this type of data that I am not aware of. Is there a method to construct a null model and a full model for sva only by knowing the batch the samples are from?
  
  Any other suggestion of batch effect correction tools for a data set with no known phenotype/subtype are also welcome.
  
  **Tags:** rna-seq, clustering, batch-effects, combat, sva
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-08. Score: 1
  
  You can just remove the first component from the dataset by setting the first eigenvalue to 0 in the diagonal matrix and then multiplying the SVD matrices.
  
  I am not sure which R code you are using to estimate the components (I have a comparison of PCA code in R on <https://github.com/username_1/ODSC_2018/tree/master/PCA_vignette>)
  
  In ade4 R package, there is a function `reconst()` which reconstructs data from a selection of components: <https://rdrr.io/rforge/ade4/man/reconst.html>
  
  Happy to provide code to do this in other PCA versions if needed
  username_1 Culhane
  
  > **Comments:**
  > **username_0**: Thank you for your suggestion. I am more of a molecular biologist so I don't quite know how to do it. I understand vaguely the concept but not the actually steps. Or is it what ade4 does to remove the first component?  
  
  ---
  
  