Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
EdgeR or GLM model design question younko Bioinformatics 10 08-31-2014 11:22 PM
Missing genotypes, in case control study using Plink c_ro87 Bioinformatics 0 05-28-2014 05:24 AM
Comprehensive Samtools user guide? wdemos Bioinformatics 5 08-21-2012 11:49 AM
EdgeR design-matrix design extended.wobble RNA Sequencing 3 07-11-2011 06:58 AM
AMOS & BAMBUS program experience sharing and general user guide. Patrick Bioinformatics 8 07-08-2010 02:28 PM

Thread Tools
Old 10-07-2014, 10:14 AM   #1
Junior Member
Location: USA

Join Date: Jul 2014
Posts: 5
Default 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:
> 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))
MBWatson is offline   Reply With Quote
Old 10-07-2014, 10:29 AM   #2
Devon Ryan
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480

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

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().

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.

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"'.
dpryan is offline   Reply With Quote
Old 10-08-2014, 10:25 AM   #3
Junior Member
Location: USA

Join Date: Jul 2014
Posts: 5

Thank you for the response! It helped a lot.
MBWatson is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 06:33 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO