Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MBWatson
    Junior Member
    • Jul 2014
    • 5

    #1

    Question about model design in edgeR user guide case study example 4.5

    Good afternoon,
    I am analyzing RNAseq data from 2 different populations exposed to 2 experimental treatments and my experimental design is very similar to case study 4.5 in the June 2014 edgeR user guide. Im hoping someone can annotate/explain this part of the R script that deals with model design. Im unsure to what the 1,4 and 5,5 refer and the meaning of ref="mock."

    Thanks in advance for help with this admittedly beginner question.

    From the user guide:
    Code:
    > library(NBPSeq) 
    > library(edgeR) 
    > data(arab) 
    > head(arab)
    
                    mock1 mock2 mock3 hrcc1 hrcc2 hrcc3
    AT1G01010   35        77      40      46     64    60 
    AT1G01020   43        45      32      43     39    49 
    AT1G01030   16        24      26      27     35    20 
    AT1G01040   72        43      64      66     25    90 
    AT1G01050   49        78      90      67     45    60 
    AT1G01060   0         15      2       0      21    8
    
    #There are two experimental factors, treatment (hrcc vs mock) and the time that each replicate was conducted:
    
    > Treat <- factor(substring(colnames(arab),1,4)) 
    > Treat <- relevel(Treat, ref="mock") 
    > Time <- factor(substring(colnames(arab),5,5))
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    I assume it's the last 3 lines that you have questions about.

    Code:
    Treat <- factor(substring(colnames(arab),1,4))
    When reading code, read it from inside out. So "colnames(arab)" will return, '"mock1" "mock2" "mock3" "hrcc1" ...'. That's then given to substring(), which outputs characters 1 through 4. This will then return, '"mock" "mock" "mock" "hrcc" ...'. This is then made into a factor with factor().

    Code:
    Treat <- relevel(Treat, ref="mock")
    When the factor was made in the previous command, the lexicographically first level (hrcc) was made the reference level. You probably want fold-changes versus mock instead, so that's what the relevel() command does.

    Code:
    Time <- factor(substring(colnames(arab),5,5))
    As with "Treat", except now substring is just returning the 5th character, '"1" "2" "3" "1" "2" "3"'.

    Comment

    • MBWatson
      Junior Member
      • Jul 2014
      • 5

      #3
      Thank you for the response! It helped a lot.

      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
      26 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      20 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      36 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      43 views
      0 reactions
      Last Post SEQadmin2  
      Working...