Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • calzonv
    Junior Member
    • Jun 2015
    • 3

    #1

    edgeR - glm: finding DEG ignoring platform bias

    Hello,

    I would like to use glm to ignore the bias from two different protocols and obtain the real DEG.

    I have three conditions, say C1, C2 and C3.
    Protocol 1 was used to obtain three replicates of C1 and three of C2.
    Protocol 2 was used to obtain three replicates of C2 and C3.

    I am interested in finding the DEG between C1 and C3 by taking into consideration C2 (from both protocols) in order to eliminate the protocol bias. See table below.

    _________|__C1___|___C2___|___C3___|
    Protocol 1 |___X___|___X____|_________|
    Protocol 2 |_______|___X____|____X____|


    The next are my two vectors for the matrix.design:
    Protocol = p1 p1 p1 p1 p2 p1 p2 p1 p2 p2 p2 p2
    Conditions= c1 c1 c1 c2 c2 c2 c2 c2 c2 c3 c3 c3
    In R code we have:
    Protocol = factor( c( rep('p1',3), rep(c("p1","p2"),3),rep('p2',3)) )
    Conditions = factor(c(rep('c1',3),rep("c2",6),rep('c3',3)))

    data.frame(Protocol,Conditions)
    Protocol Conditions
    1 p1 c1
    2 p1 c1
    3 p1 c1
    4 p1 c2
    5 p2 c2
    6 p1 c2
    7 p2 c2
    8 p1 c2
    9 p2 c2
    10 p2 c3
    11 p2 c3
    12 p2 c3

    design <- model.matrix(~Protocol+Conditions)
    design

    (Intercept) Protocolp2 Conditionsc2 Conditionsc3
    1 1 0 0 0
    2 1 0 0 0
    3 1 0 0 0
    4 1 0 1 0
    5 1 1 1 0
    6 1 0 1 0
    7 1 1 1 0
    8 1 0 1 0
    9 1 1 1 0
    10 1 1 0 1
    11 1 1 0 1
    12 1 1 0 1
    attr(,"assign")
    [1] 0 1 2 2
    attr(,"contrasts")
    attr(,"contrasts")$Protocol
    [1] "contr.treatment"

    attr(,"contrasts")$Conditions
    [1] "contr.treatment"


    After estimating dispersion, glmFit and glmLRT I have:
    ...
    lrt <- glmLRT(fit)
    topTags(lrt)
    Coefficient: ConditionC3
    ...results here...

    My questions are:
    1 - is my design correct by using "model.matrix(~Protocol+Conditions)"? Where did ConditionsC1 go in design table?

    2 - is the coefficient "ConditionsC3" correct for this analysis? How should the contrast be in glmLRT function?

    Any comments, tips or help is greatly appreciated.

    Thank you very much,
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    1. Yes, the design is correct, ConditionsC1 is the intercept (well, ConditionsC1 and ProtocolP1 are, but since there's no ConditionC1 in another Protocol that's the same).
    2. Yes, ConditionC3 will give you changes in C3 vs. C1 while controlling for Protocol. You don't need a contrast, the ConditionC3 coefficient directly answers your question.

    Comment

    • calzonv
      Junior Member
      • Jun 2015
      • 3

      #3
      Thank you very much for your answer drpyan. Your answer helped me to understand many things.

      Another question. If I was to do a "naive" analysis to find DEG by just comparing three replicates of C1 from protocol1 and three replicates from C3 from protocol2.
      _________|__C1___|___C2___|___C3___|
      Protocol 1 |___X___|________|_________|
      Protocol 2 |_______|________|____X____|

      My design matrix would be:
      condition=factor(c("C1","C1","C1","C3","C3","C3"))
      design <- model.matrix(~0+condition)

      conditionC1 conditionC3
      protocol1 1 0
      protocol1 1 0
      protocol1 1 0
      protocol2 0 1
      protocol2 0 1
      protocol2 0 1

      after estimation of GLM parameters...
      lrt <- glmLRT(fit,contrast = c(-1,1))

      The contrast in this case need to be specified as above right?

      Thank you again,

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        If you explicitly remove the intercept then yes you'd need a contrast. Alternatively, "design <- model.matrix(~condition)" would do the same thing and not need a contrast.

        Comment

        • calzonv
          Junior Member
          • Jun 2015
          • 3

          #5
          Thank you very much drpyan. Your answers are really clear and helpful!

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