Unconfigured Ad

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

    #1

    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

          • SEQadmin2
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM
          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 10-22-2026, 11:13 AM
          0 responses
          26 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          20 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          36 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          43 views
          0 reactions
          Last Post SEQadmin2  
          Working...