Search
Question: Construct design matrix for qPCR data using Limma package
0
4.6 years ago by
Hongda Chen20
Hongda Chen20 wrote:
Dear R-users, I am facing a problem in constructing design matrix. My data is qPCR data, analysing 92 protein markers in 92 samples (two groups). I would like to use Limma package to identify differently expressed genes between two groups. The first 38 samples were controls, and the other 54 samples were cases. So how should I construct the design matrix. I have tried the following code. Is this right? design<-matrix(rep(1,184),nrow=92,byrow=TRUE) design[39:92,1]=0 design[1:38,2]=0 colnames(design2)<-c("control","case") Could anyone help me figure out it? Thank you. Adam [[alternative HTML version deleted]]
modified 4.6 years ago • written 4.6 years ago by Hongda Chen20
0
4.6 years ago by
United States
James W. MacDonald46k wrote:
Hi Adam, That's one way of doing it. Well, except for the last line where you substitute in an apparently nonexistent design2 object. Another way would be fact <- factor(rep(c("Control","Case"), c(38,54)), levels = c("Control","Case")) design <- model.matrix(~ 0 + fact) colnames(design) <- gsub("fact", "", colnames(design)) Best, Jim On Wednesday, November 27, 2013 10:29:13 AM, Hongda Chen wrote: > Dear R-users, > > I am facing a problem in constructing design matrix. My data is qPCR data, > analysing 92 protein markers in 92 samples (two groups). I would like to > use Limma package to identify differently expressed genes between two > groups. The first 38 samples were controls, and the other 54 samples were > cases. So how should I construct the design matrix. > > I have tried the following code. Is this right? > design<-matrix(rep(1,184),nrow=92,byrow=TRUE) > design[39:92,1]=0 > design[1:38,2]=0 > colnames(design2)<-c("control","case") > > Could anyone help me figure out it? Thank you. > > Adam > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician University of Washington Environmental and Occupational Health Sciences 4225 Roosevelt Way NE, # 100 Seattle WA 98105-6099
0
4.6 years ago by
Hongda Chen20
Hongda Chen20 wrote:
Dear R-users, I am facing a problem in constructing design matrix. My data is qPCR data, analysing 92 protein markers in 92 samples (two groups). I would like to use Limma package to identify differently expressed genes between two groups. The first 38 samples were controls, and the other 54 samples were cases. So how should I construct the design matrix. I have tried the following code. Is this right? design<-matrix(rep(1,184),nrow=92,byrow=TRUE) design[39:92,1]=0 design[1:38,2]=0 colnames(design2)<-c("control","case") Could anyone help me figure out it? Thank you. Adam [[alternative HTML version deleted]]