Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DESeq2 multi-factor designs

    In DESeq2, you can set up a multi-factor design like:
    Code:
    design(dds) <- formula(~ celltype + treatment)
    This would give you the differences attributable to the "treatment" while accounting for the "celltype".

    However, what if you are interested in the differences in response to treatment in different cell types? Instead of looking for the effects of treatment regardless of cell type, you want the effects of treatments that are unique to a specific cell type. How would you get those?

  • #2
    Either include an interaction (~celltype*treatment) or just make a "group" factor like:
    Code:
    group <- factor(sprintf("%s_%s", celltype, treatment))
    and then use a model of ~group and use contrasts for the comparisons of interest. You'll get the same results with either method.

    Comment


    • #3
      Devon's right with a small caveat. Because of log fold change shrinkage (betaPrior=TRUE is default), the results are not exactly the same (they would be the same with betaPrior=FALSE). The interaction model only shrinks the interaction term, while the group model shrinks all the group effects. My advice is: if you are interested in testing for cell type specificity, use the interaction model, because the interaction terms allow you to easily test this. If you are only interested in comparing the treatment effect in each cell type, use the group model, and the contrasts are easy to form this way.

      Comment


      • #4
        I didn't realize that the interaction and group models would give the same results (at least with betaPrior=FALSE). That is really interesting.

        So if I have two cell types (A and B) and two treatments (Yes and No) and then I combine them for the group model, which contrast is equivalent to the interaction model? I am not sure how I could get the difference in response to treatment using the group model.

        Comment


        • #5
          The contrast is (ctA_trY + ctB_trN) - (ctA_trN + ctB_trY)

          This is from doing arithmetic on (ctA_trY - ctA_trN) - (ctB_trY - ctB_trN)

          Here's an example in base R. Note the interation term (-2.11)

          Code:
          > y <- rnorm(8)
          > ct <- c(0,0,1,1,0,0,1,1)
          > tr <- c(0,0,0,0,1,1,1,1)
          > lm(y ~ ct*tr)
          
          Call:
          lm(formula = y ~ ct * tr)
          
          Coefficients:
          (Intercept)           ct           tr        ct:tr
              -0.6356       1.1513       0.7684      -2.1120
          Now with group. here, I add + 0 to the design, but you wouldn't do this in DESeq2 with betaPrior=TRUE because we fit a term for each group in addition to an intercept.

          Code:
          > g <- factor(c(1,1,2,2,3,3,4,4))
          > lm(y ~ g + 0)
          
          Call:
          lm(formula = y ~ g + 0)
          
          Coefficients:
               g1       g2       g3       g4
          -0.6356   0.5157   0.1329  -0.8278
          
          > beta <- coef(lm(y ~ g + 0))
          > (beta[1] + beta[4]) - (beta[2] + beta[3])
                 g1
          -2.111991

          Comment


          • #6
            Thank you for that great explanation.

            The only part I don't understand is this:
            The contrast is (ctA_trY + ctB_trN) - (ctA_trN + ctB_trY)
            How would I provide that to the DESeq2 results function contrasts parameter?

            Comment


            • #7
              you would use the list style of specifying contrasts, see ?results for more details

              Code:
              results(dds, contrast=list(c("ctA_trY","ctB_trN"),c("ctA_trN","ctB_trY")))

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Essential Discoveries and Tools in Epitranscriptomics
                by seqadmin




                The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                04-22-2024, 07:01 AM
              • seqadmin
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, Yesterday, 11:49 AM
              0 responses
              15 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-24-2024, 08:47 AM
              0 responses
              16 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              61 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              60 views
              0 likes
              Last Post seqadmin  
              Working...
              X