Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • extended.wobble
    Junior Member
    • May 2011
    • 6

    #1

    EdgeR design-matrix design

    Dear List,

    we are working on an RNA-Seq experiment including 3 different cultivars of the same plant species during a drought treatment.
    The plants have been grown in two different growth chambers. When analysing the data we had to find out that the "effect" of the chambers on gene expression is actually stronger than the drought treatment effect. Hence, we want to remove this (technical) chamber effect from the analysis in order to extract only those genes that are differentially expressed in response to the drought treatment.

    Unfortunately we are a bit stuck with correctly formulating the design matrix needed to accomplish this analysis using edgeR. We created a design matrix without the chamber factor according to the manual like this:

    Code:
    genotypes <- factor( c("cultivar1", "cultivar1", "cultivar1", "cultivar1", "cultivar2", "cultivar2", "cultivar2", "cultivar2") )
    groups <- factor( c("drought", "drought", "watered", "watered", "drought", "drought", "watered", "watered") )
    design <- model.matrix(~genotypes + groups)
    
    view(design)
    	(Intercept)	genotypes	groups
    1	1		1		0
    2	1		1		0
    3	1		1		1
    4	1		1		1
    5	1		0		0
    6	1		0		0
    7	1		0		1
    8	1		0		1
    but the situation we are facing looks like this:

    Code:
    1	cultivar1 drought chamber1
    2	cultivar1 drought chamber2
    3	cultivar1 watered chamber1
    4	cultivar1 watered chamber2
    5	cultivar2 drought chamber1
    6	cultivar2 drought chamber2
    7	cultivar2 watered chamber1
    8	cultivar2 watered chamber2
    How do we correctly set up the design matrix to eliminate the chamber effect and is there a way to explicitly define the contrasts we want to extract (analogous to the contrast matrix function in limma?)

    thanks for any help
  • Gordon Smyth
    Member
    • Apr 2011
    • 91

    #2
    Just add chambers to the design matrix

    You can adjust for possible chamber effects by including the factor in the design matrix:

    design <- model.matrix(~genotypes+groups+chambers)
    y <- estimateGLMCommonDisp(y, design)
    fit <- glmFit(y,design)
    results.groups <- glmLRT(y,fit,coef=2)
    topTags(results.groups)

    This gives a list of transcripts different between watered vs drought, adjusting for cultivar and chamber differences.

    To get the watered vs drought effects for cultivar1 and cultivar2 separately, you can use

    design <- model.matrix(~genotypes+genotypes:groups+chambers)

    then

    results <- glmLRT(y,fit,coef=3)

    for cultivar1 and

    results <- glmLRT(y,fit,coef=4)

    for cultivar2.

    Best wishes
    Gordon

    PS. I answer questions much more often on the Bioconductor list than on seqanswers.

    Comment

    • extended.wobble
      Junior Member
      • May 2011
      • 6

      #3
      Thanks a lot for your help.

      Is there a documentation or manual that would have contained this information?

      cheers.

      PS: I didn't want to post the same topic twice, but started here at seqanswers.

      Comment

      • extended.wobble
        Junior Member
        • May 2011
        • 6

        #4
        Thanks again Gordon

        your advice did already make things much clearer for us. One interesting
        question we would like to answer is which genes are differentially expressed
        between the two genotypes in response to drought treatment, as these would
        be the genes that might be responsible for different levels of tolerance.

        To extract these we put together the following design matrix, assuming that
        coefficient 5 would contain these genes. Is that correct?

        Code:
        genotypes <- factor( c("cultivar1", "cultivar1", "cultivar1", "cultivar1", "cultivar2", "cultivar2", "cultivar2", "cultivar2") )
        chamber <- factor( c("K1", "K3", "K1", "K3", "K1", "K3", "K1", "K3") )
        groups <- factor( c("Drought", "Drought", "Watered", "Watered", "Drought", "Drought", "Watered", "Watered") )
        
        design <- model.matrix(~genotypes+groups+chamber+genotypes:groups)
        
         
        (Intercept) genotypesCultivar2 groupsWa chamberK3 genotypesCultivar2:groupsWa
        Dr           1            0        0         0                     0
        Dr           1            0        0         1                     0
        Wa           1            0        1         0                     0
        Wa           1            0        1         1                     0
        Dr           1            1        0         0                     0
        Dr           1            1        0         1                     0
        Wa           1            1        1         0                     1
        Wa           1            1        1         1                     1
        
         
         
        finally <- glmLRT(DGE_List, glmfit, coef=5)
        should contain the significant changes between the two cultivars
        regarding their reaction to drought, with chamber effects eliminated.

        Thanks a lot in advance for your time

        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, 10-22-2026, 11:13 AM
        0 responses
        29 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        22 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        38 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        45 views
        0 reactions
        Last Post SEQadmin2  
        Working...