Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Pairwise comparisons in DEXSeq

    Dear all,
    I am analyzing a RNA-seq experiment including more than 2 conditions. As discussed in this topic, I have created a global exonCountSet, including all conditions and their replicates, to estimate a pooled dispersion from all samples:


    Next, I would like to perform comparisons between specific pairs of conditions included in this exonCountSet object, but I am unsure how to do this... Is this through modified formulas (formula0 and formula1) given to the function testGeneForDEU?

    Thanks for your help
    Julien

  • #2
    Hi Julien,

    I think the easiest way is to subset your ecs object and run the pairwise comparisons separately.

    Alejandro

    Comment


    • #3
      Thanks Alejandro,
      Yes indeed, that's what I ended up doing:

      Code:
      > allExonsPairwise <- newExonCountSet(countData = counts(allExons)[, -c(1:3)], design = design(allExons)[-c(1:3),], geneIDs = geneIDs(allExons), exonIDs = exonIDs(allExons))
      > allExonsPairwise <- estimateSizeFactors(allExonsPairwise)
      > fData(allExonsPairwise)$dispBeforeSharing <- fData(allExons)$dispBeforeSharing
      > allExonsPairwise@dispFitCoefs <- allExons@dispFitCoefs
      > fData(allExonsPairwise)$dispFitted <- fData(allExons)$dispFitted
      > fData(allExonsPairwise)$dispersion <- fData(allExons)$dispersion
      > fData(allExonsPairwise)$testable <- fData(allExons)$testable
      > allExonsPairwise <- testForDEU( allExonsPairwise, nCores=4 )
      Is there a more elegant way to do this?
      Julien

      Comment


      • #4
        For the moment I think this us the only option... I will think of a way to be more flexible.

        Just one detail, I saw that you are using the dispersion values from the full object in the pairwise comparison... if your objective is to detect pairwise differences, it is better if you recalculate the dispersions just with the two conditions to test. It will increase power because at the moment you are overestimating the variance between the two conditions that you are testing by adding the variance of your other conditions.

        Alejandro

        ps. you can also subset your dataset just by doing
        Code:
        allExonsPairwise[,-c(1:3)]

        Comment


        • #5
          Thanks again Alejandro,
          If I understood correctly, you suggest to:
          - estimate the dispersions on the whole ecs using "estimateDispersions"
          - fit the coefficients of the dispersion function from these estimates using "fitDispersionFunction"
          - subset the ecs to keep only the conditions you want to compare in a pairwise manner
          - reestimate the dispersions on this ecs subset using "estimateDispersions"
          - refill fData(ecs)$dispersion with the maximum between the per-gene estimate and the modelled value (second part of "fitDispersionFunction").
          Is that correct?

          That would translate into this code if I'm correct:
          Code:
          > allExons <- estimateDispersions( allExons )
          > allExons <- fitDispersionFunction( allExons )
          > allExonsPairwise <- allExons[, -c(1:3) ]
          > allExonsPairwise <- estimateDispersions( allExonsPairwise )
          > fData(allExonsPairwise)$dispersion <- pmin(
                 pmax( 
                    fData(allExonsPairwise)$dispBeforeSharing, 
                    fData(allExonsPairwise)$dispFitted,
                    na.rm = TRUE ),
                    1e8 ) 
          > allExonsPairwise <- testForDEU( allExonsPairwise )

          Comment


          • #6
            Hi!

            I meant more like this:

            Code:
            > allExonsPairwise <- allExons[, -c(1:3) ]
            > allExonsPairwise <- estimateSizeFactors( allExonsPairWise )
            > allExonsPairwise <- estimateDispersions( allExonsPairwise )
            > allExonsPairwise <- fitDispersionFunction( allExonsPairwise )
            > allExonsPairwise <- testForDEU( allExonsPairwise )
            And I guess your object allExonsPairwise will have only two conditions right?

            Alejandro

            Comment


            • #7
              Mmmm, I'm getting confused...
              Now I understand you don't agree with Simon and what was discussed here: https://mailman.stat.ethz.ch/piperma...ch/044094.html
              (Basically, it is better to estimate the dispersions based on all pooled samples from an experiment, which can include more than the 2 conditions to compare)
              Is that correct?

              Originally posted by areyes View Post
              And I guess your object allExonsPairwise will have only two conditions right?
              Correct!

              Thanks for your quick answers!
              Julien

              Comment


              • #8
                Not necessarily disagree, but I was assuming that you are not expecting the same variability in all your conditions. If this is the case you should maybe estimate them separately, if not, your pooled variance estimation will be more reliable.

                I think you could try around and see if they vary much when adding the different conditions, to see how different is the biological variability within each of your conditions.

                Alejandro

                Comment

                Latest Articles

                Collapse

                • seqadmin
                  Strategies for Sequencing Challenging Samples
                  by seqadmin


                  Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                  03-22-2024, 06:39 AM
                • seqadmin
                  Techniques and Challenges in Conservation Genomics
                  by seqadmin



                  The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                  Avian Conservation
                  Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                  03-08-2024, 10:41 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, Yesterday, 06:37 PM
                0 responses
                10 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, Yesterday, 06:07 PM
                0 responses
                10 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 03-22-2024, 10:03 AM
                0 responses
                51 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 03-21-2024, 07:32 AM
                0 responses
                67 views
                0 likes
                Last Post seqadmin  
                Working...
                X