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
            Exploring the Dynamics of the Tumor Microenvironment
            by seqadmin




            The complexity of cancer is clearly demonstrated in the diverse ecosystem of the tumor microenvironment (TME). The TME is made up of numerous cell types and its development begins with the changes that happen during oncogenesis. “Genomic mutations, copy number changes, epigenetic alterations, and alternative gene expression occur to varying degrees within the affected tumor cells,” explained Andrea O’Hara, Ph.D., Strategic Technical Specialist at Azenta. “As...
            07-08-2024, 03:19 PM
          • seqadmin
            Exploring Human Diversity Through Large-Scale Omics
            by seqadmin


            In 2003, researchers from the Human Genome Project (HGP) announced the most comprehensive genome to date1. Although the genome wasn’t fully completed until nearly 20 years later2, numerous large-scale projects, such as the International HapMap Project and 1000 Genomes Project, continued the HGP's work, capturing extensive variation and genomic diversity within humans. Recently, newer initiatives have significantly increased in scale and expanded beyond genomics, offering a more detailed...
            06-25-2024, 06:43 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 07-16-2024, 05:49 AM
          0 responses
          20 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 07-15-2024, 06:53 AM
          0 responses
          28 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 07-10-2024, 07:30 AM
          0 responses
          40 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 07-03-2024, 09:45 AM
          0 responses
          205 views
          0 likes
          Last Post seqadmin  
          Working...
          X