Answers.Body: <p>I don't know if this question has been solved already, but what they try to do is equalize the depth of sequencing for each cell. Therefore, they scale for the total number of reads. If you regress out (via linear or negative binomial regression) the differences in the number of reads per cell, you end up with cells that have been sequenced with the same depth. </p>
  
  <p>In my opinion they use the ribosomal genes in the same way. They are considered to be a kind of housekeeping genes, which you can use to equalize the sequencing depth.</p>
  
  <p>And yes, the log in this context is log2, used to get fold-change values instead of counts.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-20T07:52:05.410Z
Answers.LastActivityDate: 2018-04-20T07:52:05.410Z
Answers.UserDisplayName: DCZ
Body: <p>I am trying to build the preprocessing pipeline presented in <a href="https://www.biorxiv.org/content/early/2017/12/20/237446" rel="noreferrer">The Tabula Muris Consortium et al. (pp)</a>.</p>
  
  <p>It is a pipeline to preprocess single-cell sequencing data. There is one step that is not clear:</p>
  
  <blockquote>
    <p>Counts were log-normalized (log(1 + counts per N)), then scaled by linear regression against the number of reads (or UMIs), the percent of reads mapping to Rn45s, and the percent of reads to ribosomal genes.</p>
  </blockquote>
  
  <p>I understand the first part (I assume that log in this context is log2), but I need help on understanding how to <em>scale by linear regression against the number of reads, the percent of reads mapping to Rn45s, and the percent of reads to ribosomal genes.</em></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-27T22:34:41.363Z
Comments.Text: Have you contacted the paper authors? They would be able to give you a better answer, and your comments/questions would help them improve the paper when it is properly published.
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-27T22:52:04.563Z
Comments.Text: @gringer You are right, I posted here because I thought there was some standard procedure.
Comments.UserDisplayName: gc5
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-28T09:57:59.053Z
Comments.Text: The linear regression is straight-forward enough, but regressing against only three values (if I'm interpreting that correctly) is a recipe for disaster (it sounds vastly worse than even ERCC spike-ins...and those aren't exactly ideal).
Comments.UserDisplayName: Devon Ryan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-28T15:00:49.863Z
Comments.Text: @DevonRyan ignoring by now the small number of regression values, how do you scale using the linear regression? I am unable to see how the linear regression is used in this case. Can you elaborate more (maybe with an answer)?
Comments.UserDisplayName: gc5
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-26T21:18:56.493Z
Comments.Text: Did you figure how did they preprocess the tabula muris data?
Comments.UserDisplayName: yuqi_yuqi
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-28T15:20:44.727Z
Comments.Text: @yuqi_yuqi see https://bioinformatics.stackexchange.com/a/3225/1771
Comments.UserDisplayName: gc5
Tags: <reads><single-cell><scrnaseq><linear-regression><data-preprocessing>
Title: Scaling by linear regression against the number of reads
ThreadText: # Scaling by linear regression against the number of reads
  
  (Asked by: username_0 on 2017-12-27)
  
  I am trying to build the preprocessing pipeline presented in [The Tabula Muris Consortium et al. (pp)](https://www.biorxiv.org/content/early/2017/12/20/237446).
  
  It is a pipeline to preprocess single-cell sequencing data. There is one step that is not clear:
  
  > Counts were log-normalized (log(1 + counts per N)), then scaled by linear regression against the number of reads (or UMIs), the percent of reads mapping to Rn45s, and the percent of reads to ribosomal genes.
  
  I understand the first part (I assume that log in this context is log2), but I need help on understanding how to *scale by linear regression against the number of reads, the percent of reads mapping to Rn45s, and the percent of reads to ribosomal genes.*
  
  **Tags:** reads, single-cell, scrnaseq, linear-regression, data-preprocessing
  
  > **Comments:**
  > **username_1**: Have you contacted the paper authors? They would be able to give you a better answer, and your comments/questions would help them improve the paper when it is properly published.  
  > **username_0**: @username_1 You are right, I posted here because I thought there was some standard procedure.  
  > **username_2**: The linear regression is straight-forward enough, but regressing against only three values (if I'm interpreting that correctly) is a recipe for disaster (it sounds vastly worse than even ERCC spike-ins...and those aren't exactly ideal).  
  > **username_0**: @username_2 ignoring by now the small number of regression values, how do you scale using the linear regression? I am unable to see how the linear regression is used in this case. Can you elaborate more (maybe with an answer)?  
  > **username_3**: Did you figure how did they preprocess the tabula muris data?  
  > **username_0**: @username_3 see https://bioinformatics.stackexchange.com/a/3225/1771  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2018-04-20. Score: 3 | Accepted answer
  
  I don't know if this question has been solved already, but what they try to do is equalize the depth of sequencing for each cell. Therefore, they scale for the total number of reads. If you regress out (via linear or negative binomial regression) the differences in the number of reads per cell, you end up with cells that have been sequenced with the same depth.
  
  In my opinion they use the ribosomal genes in the same way. They are considered to be a kind of housekeeping genes, which you can use to equalize the sequencing depth.
  
  And yes, the log in this context is log2, used to get fold-change values instead of counts.
  
  
  ---
  
  