Question: Microarray contrast matrix design
1
gravatar for c12i34
6.3 years ago by
c12i3420
United Kingdom
c12i3420 wrote:

Hi I am trying to create an appropriate design matrix to determine gene that are differentially expressed between cancer and normal sample. Below table is the information file for my dataset.

Sample Subtype Cancer
A Normal Normal
B Normal Normal
C Normal Normal
D stage 1 Cancer
E stage 1 Cancer
F stage 2 Cancer
G stage 2 Cancer
H stage 2 Cancer
I NA Biopsy

At the moment I create a design matrix using these command:

f=factor(information$cancer)
design=model.matrix(~f)
fit=lmFit(exp_sample,design)
fit=eBayes(fit)

However I am not sure how to construct my contrast matrix for 2 levels (compare cancer and normal) only? Also do i need to discard those biopsy data or not? It would be great if you guys can give me some advice! Many thanks

microaray R • 2.8k views
ADD COMMENTlink modified 6.3 years ago by Manvendra Singh2.1k • written 6.3 years ago by c12i3420
0
gravatar for Manvendra Singh
6.3 years ago by
Manvendra Singh2.1k
Berlin, Germany
Manvendra Singh2.1k wrote:

you have dataframe where first three coloumns are Normal and then next two coloumns are"stage1_cancer" and next three coloumns are "stage3_cancer" carrying their respective expression values. (here we discard biopsy) you should then do it like following :

 

groups<-as.factor(c(rep("Normal",3),rep("stage1_Cancer",2), rep("stage2_Cancer",3)))
design<-model.matrix(~0+groups)
colnames(design)=levels(groups)
fit<-lmFit(dataframe, design)
cont.matrix.stage2<-makeContrasts(stage2_Cancer-Normal,
levels=design)
cont.matrix.stage1<-makeContrasts(stage1_Cancer-Normal,
levels=design)
fit.stage2<-contrasts.fit(fit, cont.matrix.stage2)
fit.stage1<-contrasts.fit(fit, cont.matrix.stage1)
ebfit.stage2<-eBayes(fit.stage2)
ebfit.stage1<-eBayes(fit.stage1)
topTable.stage2(ebfit.stage2, number=Inf, p=0.05, adjust.method="none", coef=1)
topTable.stage1(ebfit.stage1, number=Inf, p=0.05, adjust.method="none", coef=1)

 

ADD COMMENTlink written 6.3 years ago by Manvendra Singh2.1k
Please log in to add an answer.

Help
Access

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