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

      • kinpict.com
        Reply to 16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
        by kinpict.com
        The part about this topic feels surprisingly grounded, and the details on the page is the bit that made me slow down. I’d keep <a href="https://kinpict.com/">ai family photo generator</a> bookmarked for later.
        Today, 06:37 PM
      • SEQadmin2
        16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
        by SEQadmin2





        NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
        10-30-2026, 06:46 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 11-12-2026, 07:59 AM
      0 responses
      27 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 11-05-2026, 09:25 AM
      0 responses
      35 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 11-03-2026, 11:54 AM
      2 responses
      56 views
      0 reactions
      Last Post kinpict.com  
      Started by SEQadmin2, 10-28-2026, 09:57 AM
      0 responses
      175 views
      0 reactions
      Last Post SEQadmin2  
      Working...