Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • DESeq2 (Mutant/WT + Two Conditions)

    1. ) I would like to know whether the level of gene expression is caused by the mutation or by the condition or perhaps there is some mixture. I have three replicates for each experiment.

    Condition1 = Exponential Phase
    |
    |---------> Mutant
    |---------------------WT

    Condition2 = Stationary Phase
    |
    |---------> Mutant
    |---------------------WT



    WT has three replicates in the Exponential phase AND three replicates in the Stationary phase

    Mutant has three replicates in the Exponential phase and three replicates in the Stationary phase.


    2. ) I already looked over DESeq2 vignette/manual so please don't refer me to that. I would like to know how to setup the factors and levels to make this comparison possible and meaningful to interpret.

    Help is greatly appreciated. I know there a few other people who would like to know how to do this.
    Last edited by TheSeqGeek; 04-17-2014, 01:10 PM.

  • #2
    Your design is simply:
    Code:
    design <- ~genotype*phase
    Depending on how you construct the DESeqDataSet, you would also need to associate your samples to these factors in either the "coldata" (rows are samples and the columns would be "genotype" and "phase") of the 3rd and 4th columns of sampleTable if you're using DESeqDataSetFromHTSeqCount.

    Comment


    • #3
      Yes, Devon has the correct design for you, which is equivalent to

      Code:
      ~ genotype + phase + genotype:phase
      I would like to know whether the level of gene expression is caused by the mutation or by the condition or perhaps there is some mixture.
      In (generalized) linear modeling, this is referred to as an interaction.

      If you run DESeq() with the design that Devon provided, you can use the example code below in order to build a results table, where the p-values and adjusted p-values specifies tests of whether the coefficient is zero, and the coefficients available for testing are genotype, phase, and genotype X phase. If there is an effect of the combination which is not explained by simply multiplying the genotype and phase effect, then the interaction term will have a low p-value and adjusted p-value.

      you can follow the example in ?results, which is in the 1.4 release version of DESeq2:

      Code:
      # two conditions, two groups, with interaction term
      dds <- makeExampleDESeqDataSet(n=100,m=12)
      dds$group <- factor(rep(rep(c("X","Y"),each=3),2))
      
      design(dds) <- ~ group + condition + group:condition
      dds <- DESeq(dds)
      
      resultsNames(dds)
      results(dds, contrast=c("condition","B","A"))
      results(dds, contrast=c("group","Y","X"))
      # extract the interaction term simply with name
      results(dds, name="groupY.conditionB")

      Comment


      • #4
        I got this far

        Code:
        library(DESeq2)
        
        #import the data
        directory<-"/Users/Kumka/Documents/R/analysis/"
        sampleFiles <- list.files(path="/Users/Name/Documents/R/fnr_analysis/",pattern="*.txt")
        sampleFiles
        
        
        #Give names to experimental conditions
        sampleGroup <- factor(rep(rep(c("Mutant","WT"),each=3),2))
        sampleCondition <- factor(rep(rep(c("Exponential","Stationary"),each=6),1))
        sampleTable<-data.frame(sampleName=sampleFiles, fileName=sampleFiles, group=sampleGroup, condition=sampleCondition)
        sampleTable
        
        
        ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~group*condition)
        dds<-DESeq(ddsHTSeq)
        res<-results(dds)
        I'm not quite sure how to interpret the log2FC though.... Any thoughts help on this? It's not comparing mutant/wt in one condition but on both is it not?
        Here is the code
        Code:
        resultsNames(dds)
        group.results <- results(dds, contrast=c("group","WT","Mutant"))
        group.results <- group.results[order(group.results$padj),]
        head(group.results)
        write.csv(group.results, "WT_vs_Mutant_results.csv")
        The code
        Code:
        results(ddd)
        Is the same as the interaction term same as in the code
        Code:
        results(ddd, name = "groupY.conditonB")
        Last edited by TheSeqGeek; 04-22-2014, 10:36 AM.

        Comment


        • #5
          When you run a 2x2 analysis with an interaction term, the main effects comparisons, e.g.,

          results(dds, contrast=c("group","WT","Mutant"))

          generates a results table of log2 WT vs Mutant fold change for the base level of phase.

          The log2 WT vs Mutant fold change for the other level of the phase is:

          log2 WT vs Mutant + interaction

          If the interaction term for a gene is 0, then the WT / Mutant effect is the same for both phases.

          Comment


          • #6
            Originally posted by Michael Love View Post
            When you run a 2x2 analysis with an interaction term, the main effects comparisons, e.g.,

            results(dds, contrast=c("group","WT","Mutant"))

            generates a results table of log2 WT vs Mutant fold change for the base level of phase.

            The log2 WT vs Mutant fold change for the other level of the phase is:

            log2 WT vs Mutant + interaction

            If the interaction term for a gene is 0, then the WT / Mutant effect is the same for both phases.
            I am using DESeq2 for a similar study design (treatment and time, each with two levels), and need a little help with the above explanation.

            Does this code
            Code:
            results(ddd, name = "groupY.conditonB")
            give the log2 WT vs Mutant + interaction results?

            Also, in this example, how would you get the DE genes between the two levels of phase for the mutant type?

            Thanks!

            Comment


            • #7
              hi lbragg,

              name = "groupY.conditonB" gives just the interaction effect.

              If you want to add the condition B vs A and the interaction effect, you can either provide a numeric contrast (where the numbers correspond to elements of resultsNames(dds)):

              Code:
              results(dds, contrast=c(0,0,1,1))
              or if you are using v1.4, you can provide a list to 'contrast':

              Code:
              results(dds, contrast=list(c("condition_B_vs_A","groupY.conditionB"),character()))
              See the ?results help for the 'contrast' argument for more details.

              Either of these gives the same results table, which is the condition effect for group Y. See here for a primer on how interactions work in linear models: http://en.wikipedia.org/wiki/Interaction_(statistics)

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Recent Innovations in Spatial Biology
                by seqadmin


                Spatial biology is an exciting field that encompasses a wide range of techniques and technologies aimed at mapping the organization and interactions of various biomolecules in their native environments. As this area of research progresses, new tools and methodologies are being introduced, accompanied by efforts to establish benchmarking standards and drive technological innovation.

                3D Genomics
                While spatial biology often involves studying proteins and RNAs in their...
                01-01-2025, 07:30 PM
              • seqadmin
                Advancing Precision Medicine for Rare Diseases in Children
                by seqadmin




                Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
                12-16-2024, 07:57 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 01-09-2025, 04:04 PM
              0 responses
              431 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 01-09-2025, 09:42 AM
              0 responses
              440 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 01-08-2025, 03:17 PM
              0 responses
              452 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 01-03-2025, 11:18 AM
              1 response
              50 views
              1 like
              Last Post Tonia
              by Tonia
               
              Working...
              X