Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • 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

  • #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


    • #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


      • #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


        • #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
            Best Practices for Single-Cell Sequencing Analysis
            by seqadmin



            While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
            06-06-2024, 07:15 AM
          • seqadmin
            Latest Developments in Precision Medicine
            by seqadmin



            Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

            Somatic Genomics
            “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
            05-24-2024, 01:16 PM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, Yesterday, 06:54 AM
          0 responses
          10 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 06-14-2024, 07:24 AM
          0 responses
          16 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 06-13-2024, 08:58 AM
          0 responses
          16 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 06-12-2024, 02:20 PM
          0 responses
          17 views
          0 likes
          Last Post seqadmin  
          Working...
          X