Question: How To Set Up Model Matrix In Edger Glmrt
gravatar for upendrakumar.devisetty
5.5 years ago by
United States
upendrakumar.devisetty350 wrote:

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

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 • 3.1k views
ADD COMMENTlink modified 4.8 years ago by ygowtha20 • written 5.5 years ago by upendrakumar.devisetty350

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

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

ADD REPLYlink written 5.5 years ago by upendrakumar.devisetty350
gravatar for ygowtha
4.8 years ago by
United States
ygowtha20 wrote:

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 COMMENTlink written 4.8 years ago by ygowtha20
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1613 users visited in the last hour