How To Set Up Model Matrix In Edger Glmrt
1
0
Entering edit mode
11.3 years ago

I have a question regarding how to set up model matrix for my data frame in edgeR.

The complete steps from reading counts table after mapping till setting up model matrix is given here http://rpubs.com/upendra_35/7800

So basically in the dataframe i have two genotypes, two treatments and 7 tissues and if i am interested in looking for all those differentially expressed genes for each of the individual tissue, which of the two model matrix should i use?

design <- model.matrix(~gt * trt)

design <- model.matrix(~group)

Thanks Upendra

model matrix edger • 5.2k views
ADD COMMENT
0
Entering edit mode

Hello Upendra

I have a similar question about setting up the model matrix in edgeR for performing anova-like analysis. Since I am new to computing in general, I don't entirely understand the codes.

Experimental setup: I have two mammalian cell lines (Lets say) A, B. RNA-Seq analysis was done on these two cell lines at different concentrations of serum: 10%, 5% and 0%. Only cell line A was present in all three conditions (10,5,0) but cell line B is present in only 10% and 5%.

I want to do an anova analysis across the two cell lines in all conditions. Could you please verify the way I have setup the model matrix? My code is below.

##Creating the DGE List

> group<-c(rep("P_10",2), rep("P_05",2), rep("P_00",2), rep("H_10",2), rep("H_05",2))
> cds<-DGEList(counts, group=group)

# Calculating Normalization factors
> cds<-calcNormFactors(cds)

#MDS Plot
> plotMDS(cds,main='MDS plot for count data', labels=colnames(cds$counts))
> cds<-estimateCommonDisp(cds)
> cds<-estimateTagwiseDisp(cds,prior.df = 10)

#model matrix code
> design<-model.matrix(~0+group, data=cds$samples)

#Anova like analysis code
> cds<-estimateGLMCommonDisp(cds,design)
> cds<-estimateGLMTrendedDisp(cds,design)
Loading required package: splines

> cds<-estimateGLMTagwiseDisp(cds,design)
> fit2<-glmFit(cds,design)
> lrt.anova_like<-glmLRT(fit2,coef=2:5)

Thank You

ADD REPLY
0
Entering edit mode
11.3 years ago

I will answer myself. This should be the set-up for design matrix

design <- model.matrix(~gt+tis * trt)
ADD COMMENT

Login before adding your answer.

Traffic: 2321 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6