Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Julien Roux
    Member
    • Dec 2011
    • 24

    #1

    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
  • areyes
    Senior Member
    • Aug 2010
    • 165

    #2
    Hi Julien,

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

    Alejandro

    Comment

    • Julien Roux
      Member
      • Dec 2011
      • 24

      #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

      • areyes
        Senior Member
        • Aug 2010
        • 165

        #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

        • Julien Roux
          Member
          • Dec 2011
          • 24

          #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

          • areyes
            Senior Member
            • Aug 2010
            • 165

            #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

            • Julien Roux
              Member
              • Dec 2011
              • 24

              #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

              • areyes
                Senior Member
                • Aug 2010
                • 165

                #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

                • 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, Yesterday, 10:52 AM
                0 responses
                9 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-14-2026, 05:39 AM
                0 responses
                19 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-13-2026, 09:56 AM
                0 responses
                16 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-09-2026, 11:14 AM
                0 responses
                27 views
                0 reactions
                Last Post SEQadmin2  
                Working...