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
                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
              18 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              22 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              17 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              49 views
              0 likes
              Last Post seqadmin  
              Working...
              X