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
                  Current Approaches to Protein Sequencing
                  by seqadmin


                  Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                  04-04-2024, 04:25 PM
                • 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

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, 04-11-2024, 12:08 PM
                0 responses
                27 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 10:19 PM
                0 responses
                30 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 09:21 AM
                0 responses
                26 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-04-2024, 09:00 AM
                0 responses
                52 views
                0 likes
                Last Post seqadmin  
                Working...
                X