Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miaom
    Member
    • Oct 2012
    • 12

    #1

    edgeR: how to calculate group average/means ?

    I am trying edgeR now to find deferentially expressed genes.
    I have run
    d <- DGEList(counts=data,group=g,lib.size=libSizes)
    d <- calcNormFactors(d)
    d <- estimateCommonDisp(d)
    d <- estimateTagwiseDisp(d)
    d <- exactTest(d)
    # d.final <- topTags(de.com,n = length(data[,1]))
    and got some results like

    logFC logCPM PValue
    A1bg 1.168034660 -3.842894 0.4137326
    A1cf 0.000000000 -Inf 1.0000000
    A1i3 0.000000000 -Inf 1.0000000
    A2m -0.003703085 4.419204 0.9421192
    A3galt2 0.437990409 2.861665 0.2611483

    But I'd like to know the average/mean of the gene expressions in each condition/groups?
    It seems logFC it is different from "log2(rowMeans(GrpB)/ rowMeans(GrpA))" calculating from cpm() counts.

    How should I do the calculation ?

    Thanks!
  • xrao
    Member
    • Mar 2014
    • 10

    #2
    Have you found the answer? I am also curious. Thank you!

    Comment

    • Schelarina
      Member
      • Apr 2014
      • 18

      #3
      Do you need CPM per each sample after TMM normalization?
      you could do something like this
      cpm <- cpm(d, log=TRUE, lib.sizes=lib.sizes, normalized.lib.sizes = TRUE, prior.count=0.25)
      if your cpm values are negative then you can set the prior.count to a different value

      Comment

      • xrao
        Member
        • Mar 2014
        • 10

        #4
        Thank you! But we meant mean values for each group/condition.

        Comment

        • ckruse6
          Junior Member
          • Aug 2018
          • 1

          #5
          Manual Calc option

          So, I know it isn't ideal, but let's take the actual values of log(CPM) and log(FC) that you have from edgeR. Keep in mind this will only work if your replicates of experimental and control were equal, but you could tweak it as needed. Might be worth double checking that logCPM is using base 2 which I believe is default.

          Using "A" to be the average expression of your experimental condition and "B" to be your control as you've run it.

          FC=A/B, so
          2^log(FC) will get you (A/B)
          CPM=(A+B)/2, so
          2^log(CPM)=(A+B)/2

          Basic algebra solves for B,
          B=2(2^log(CPM))/(1+2^(log(FC)))

          and then
          A= 2(2^log(CPM)) - B

          Using the values of a typical EdgeR, this is minimal R work to generate the columns you wanted.

          Hope this helps!

          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-15-2026, 10:52 AM
          0 responses
          14 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          21 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-13-2026, 09:56 AM
          0 responses
          19 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-09-2026, 11:14 AM
          0 responses
          27 views
          0 reactions
          Last Post SEQadmin2  
          Working...