Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • rubbertjes
    Member
    • Jun 2013
    • 13

    Comparing two conditions DESeq2

    I would like to compare several conditions to a reference condition using DESeq2. Currently I am using the contrast option in the "results"-function as follows:

    Code:
    dds$condition <- relevel(dds$condition, reference)
    #Do the calculation
    dds <- DESeq(dds, betaPrior=FALSE)
    res <- results(dds, contrast = c('condition',selected_condition,reference))
    However in a manual I found that they actually take a subset. http://www.ebi.ac.uk/training/sites/...d-s.anders.pdf I found
    Code:
    #First we subset the relevant columns from the full dataset:
    > dds <- ddsFull[ , colData(ddsFull)$treatment %in% c("Control","DPN") &
    + colData(ddsFull)$time == "48h" ]
    My question is: Are both approaches still valid? And, what is the benefit of one over the other?

    Thanks,

    Rob
  • blancha
    Senior Member
    • May 2013
    • 367

    #2
    I don't know if there is a difference in the results.

    I would however stick to the most recent manual, which was written in 2014, whereas the manual you link to was written in 2013.
    The Bioconductor project aims to develop and share open source software for precise and repeatable analysis of biological data. We foster an inclusive and collaborative community of developers and data scientists.


    DESeq2 has been updated many times, and the contrast option is currently the recommended method.
    I suspect the new implementation is just a more elegant way of accomplishing the same objective, but I could be wrong.

    Comment

    • Michael Love
      Senior Member
      • Jul 2013
      • 333

      #3
      "Are both approaches still valid? And, what is the benefit of one over the other?"

      Yes both approaches are valid.

      I typically recommend running DESeq() on an object with samples from all the groups. The more samples, the better the estimates of dispersion (under the model assumptions of a dispersion parameter for each gene for all samples).

      One situation where it might be useful to subset is if the groups have very different within-group variance. You can see this in a PCA plot (see vignette for how to). Consider an experiment with groups A,B,C. If groups A and B have small within-group variance, and group C has much larger within-group variance, then subsetting to only A and B for a B vs A comparison might be more powerful, than including C, which would drive up the genes' dispersion estimates.

      Comment

      • blancha
        Senior Member
        • May 2013
        • 367

        #4
        @rubbertjes, Michael's answer is obviously much better than mine.

        @Michael, that is an interesting point. I do have several analyses where the variance varies greatly from one group to another. It's always good to remember that one should take into account that the estimates of dispersion are computed from all the samples, and not just the samples from the groups being compared when using the contrast option.
        Last edited by blancha; 03-13-2015, 05:50 PM.

        Comment

        • rubbertjes
          Member
          • Jun 2013
          • 13

          #5
          Originally posted by Michael Love View Post
          "Are both approaches still valid? And, what is the benefit of one over the other?"

          Yes both approaches are valid.

          I typically recommend running DESeq() on an object with samples from all the groups. The more samples, the better the estimates of dispersion (under the model assumptions of a dispersion parameter for each gene for all samples).
          Thanks! That was something I was also thinking.

          One situation where it might be useful to subset is if the groups have very different within-group variance. You can see this in a PCA plot (see vignette for how to). Consider an experiment with groups A,B,C. If groups A and B have small within-group variance, and group C has much larger within-group variance, then subsetting to only A and B for a B vs A comparison might be more powerful, than including C, which would drive up the genes' dispersion estimates.
          There no reason for me to a priori assume this for this particular experiment. I guess this is something I should always check...
          In this case I have 6 groups in my study, where I am only comparing 2 at a time.

          Comment

          Latest Articles

          Collapse

          • seqadmin
            New Genomics Tools and Methods Shared at AGBT 2025
            by seqadmin


            This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

            The Headliner
            The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
            03-03-2025, 01:39 PM
          • seqadmin
            Investigating the Gut Microbiome Through Diet and Spatial Biology
            by seqadmin




            The human gut contains trillions of microorganisms that impact digestion, immune functions, and overall health1. Despite major breakthroughs, we’re only beginning to understand the full extent of the microbiome’s influence on health and disease. Advances in next-generation sequencing and spatial biology have opened new windows into this complex environment, yet many questions remain. This article highlights two recent studies exploring how diet influences microbial...
            02-24-2025, 06:31 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, Today, 05:03 AM
          0 responses
          16 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, Yesterday, 07:27 AM
          0 responses
          13 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, 03-18-2025, 12:50 PM
          0 responses
          15 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, 03-03-2025, 01:15 PM
          0 responses
          185 views
          0 reactions
          Last Post seqadmin  
          Working...