text: user8886: I have been following the last DESeq2 pipeline to perform an RNAseq analysis with a dataset with low rin samples in the experimental (or treated) and high rin on the control ones. 
  I read a paper in which they perform RNAseq analysis with time-course RNA degradation and conclude that including RIN value as a covariate can mitigate some of the effects of low RIN in samples.
  My question is how I should construct the design in the DESeq2 object:
  ~conditions+rin
  ~conditions*rin
  ~conditions:rin
  
  none of them... :)
  I cannot find proper resources where explain how to construct these models (I am new to the field...) and I recognise I crashed against a wall with these kinds of things. I would appreciate also some links to good resources to be able to understand which one is correct and why.
  Thank you in advance! 
  
  user4885: In the DESeq2 manual there is a section titled "How can I include a continuous covariate in the design formula?" that deals with your question.
  Basically the process is no different from using a discrete covariate.
  DESeq <- DESeqDataSetFromMatrix(countData = counts, colData = metadata, design = ~ RIN + condition)
  
  In this example condition is the experimental groups and RIN is the continuous covariate for the RNA-integrity.  
  For this to work properly there has to be a linear relationship between the RNA integrity and the gene expression values. As stated in the manual: "Continuous covariates might make sense in certain experiments, where a constant fold change might be expected for each unit of the covariate."
  Therefore, it may be better to code the RIN variable as a factor like RIN_high or RIN_low. This is more robust than using the absolute values of the variable itself.
  However, from your desription I get the impession that the RIN values are generally lower in the treatment group compared to the control group. If this is the case, using RIN as a covariate will by of limited use. DESeq2 will not be able to discriminate if a expression difference is due to a difference in RNA integrity or due to your treatment. Also, in this case coding RIN into high and low would result in an error because the RIN and treatment variable would define the same groups.  
  Generally, covariates work best when they are evenly distributed across the experimental groups.
  
original_text: 8886: <p>I have been following the last DESeq2 pipeline to perform an RNAseq analysis with a dataset with low rin samples in the experimental (or treated) and high rin on the control ones. </p>
  
  <p>I read <a href="https://ncbi.nlm.nih.gov/pmc/articles/PMC4071332" rel="nofollow noreferrer">a paper</a> in which they perform RNAseq analysis with time-course RNA degradation and conclude that including RIN value as a covariate can mitigate some of the effects of low RIN in samples.</p>
  
  <p>My question is how I should construct the design in the DESeq2 object:</p>
  
  <pre><code>~conditions+rin
  ~conditions*rin
  ~conditions:rin
  </code></pre>
  
  <p>none of them... :)</p>
  
  <p>I cannot find proper resources where explain how to construct these models (I am new to the field...) and I recognise I crashed against a wall with these kinds of things. <strong>I would appreciate also some links to good resources to be able to understand which one is correct and why</strong>.</p>
  
  <p>Thank you in advance! </p>
   4885: <p>In the DESeq2 <a href="http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#how-can-i-include-a-continuous-covariate-in-the-design-formula" rel="nofollow noreferrer">manual</a> there is a section titled "How can I include a continuous covariate in the design formula?" that deals with your question.<br>
  Basically the process is no different from using a discrete covariate.</p>
  
  <pre><code>DESeq &lt;- DESeqDataSetFromMatrix(countData = counts, colData = metadata, design = ~ RIN + condition)
  </code></pre>
  
  <p>In this example condition is the experimental groups and RIN is the continuous covariate for the RNA-integrity.  </p>
  
  <p>For this to work properly there has to be a linear relationship between the RNA integrity and the gene expression values. As stated in the manual: "Continuous covariates might make sense in certain experiments, where a constant fold change might be expected for each unit of the covariate."<br>
  Therefore, it may be better to code the RIN variable as a factor like <code>RIN_high</code> or <code>RIN_low</code>. This is more robust than using the absolute values of the variable itself.</p>
  
  <p>However, from your desription I get the impession that the RIN values are generally lower in the treatment group compared to the control group. If this is the case, using RIN as a covariate will by of limited use. DESeq2 will not be able to discriminate if a expression difference is due to a difference in RNA integrity or due to your treatment. Also, in this case coding RIN into high and low would result in an error because the RIN and treatment variable would define the same groups.  </p>
  
  <p>Generally, covariates work best when they are evenly distributed across the experimental groups.</p>
  