Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • TheSeqGeek
    Member
    • Feb 2014
    • 40

    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.
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #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

    • Michael Love
      Senior Member
      • Jul 2013
      • 333

      #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

      • TheSeqGeek
        Member
        • Feb 2014
        • 40

        #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

        • Michael Love
          Senior Member
          • Jul 2013
          • 333

          #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

          • lbragg
            Member
            • Sep 2009
            • 14

            #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

            • Michael Love
              Senior Member
              • Jul 2013
              • 333

              #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
                Pathogen Surveillance with Advanced Genomic Tools
                by seqadmin




                The COVID-19 pandemic highlighted the need for proactive pathogen surveillance systems. As ongoing threats like avian influenza and newly emerging infections continue to pose risks, researchers are working to improve how quickly and accurately pathogens can be identified and tracked. In a recent SEQanswers webinar, two experts discussed how next-generation sequencing (NGS) and machine learning are shaping efforts to monitor viral variation and trace the origins of infectious...
                03-24-2025, 11:48 AM
              • seqadmin
                New Genomics Tools and Methods Shared at AGBT 2025
                by seqadmin


                This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

                The Headliner
                The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
                03-03-2025, 01:39 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 03-20-2025, 05:03 AM
              0 responses
              49 views
              0 reactions
              Last Post seqadmin  
              Started by seqadmin, 03-19-2025, 07:27 AM
              0 responses
              57 views
              0 reactions
              Last Post seqadmin  
              Started by seqadmin, 03-18-2025, 12:50 PM
              0 responses
              50 views
              0 reactions
              Last Post seqadmin  
              Started by seqadmin, 03-03-2025, 01:15 PM
              0 responses
              201 views
              0 reactions
              Last Post seqadmin  
              Working...