Retrieving a subset from normalized microarray data for differential test in R package, Limma
2
0
Entering edit mode
Arthur SHEN ▴ 10
@arthur-shen-4578
Last seen 10.2 years ago
Dear Sir/Madam, I would like to find out the correct way for extracting asubset of data from the normalized data, and use it for the subsequentdifferential test in Limma. Below is the script that I used for doing the cross- arraynormalization, averaging of in-slide technical repeats, differential test andmultiple testing corrections in package Limma: #Cross-array normalization library(limma) quantnorm_r<-normalizeBetweenArrays(normdata,method="Rquantile") #Filtering out all the control genes quantnorm.filt<-quantnorm_r[quantnorm_r$genes$Status=="gene",] filt.ID<-(as.character(quantnorm_r$genes$ID)[quantnorm_r$genes$Status= ="gene"]) #Merging in-slide technical repeats i <- orderfilt.ID) filt.ID<-filt.ID[i] quantnorm.filt<-quantnorm.filt[i,] ave.quantnorm<-matrix(0,ncol=30,nrow=length(unlist(lapply(split(quantn orm.filt$M[,1],filt.ID),mean)))) for (j in 1:30) { ave.quantnorm[,j]<-unlist(lapply(split(quantnorm.filt$M[,j],filt.ID),m ean)) } ave.gene.IDs<-names(lapply(split(quantnorm.filt$M[,1],filt.ID),mean)) length(ave.gene.IDs) #Linear Model Fits (common reference approach) targets<-readTargets("Targetsnew.txt") design<-modelMatrix(targets,ref="reference") fit<-lmFit(ave.quantnorm,design) contrast.matrix<-makeContrasts(RWC80-RWC100,RWC60-RWC100,RWC40-RWC100, RWC20-RWC100,RWC5-RWC100,levels=design) contrast.matrix fit2<-contrasts.fit(fit,contrast.matrix) fit2<-eBayes(fit2) results<-decideTests(fit2) diffex<-apply(abs(results),1,sum) diffex<-diffex>0 #Preparing diff exp data for clustering analysis cluster.data<-ave.quantnorm[diffex,] cluster.names<-ave.gene.IDs[diffex] rownames(cluster.data)<-cluster.names After the merging of the technical repeats, I tried to retrievethe data of the interested 781 genes from the full set normalized data. Ithought of exporting the full set of normalized data (ave.quantnorm), manuallyremoving the unwanted genes, then read it back into R, but I was worried thatby doing so, I might lose the important original information contained in thisobject. I then tried creating the list of 781 genes into a vector, or a matrix,then tried extracting the subset data by using command: ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs=781list_matrix]or ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs=781list_vector], but these failed. I would like to find out the correct wayof doing this. Thank you very much Arthur ### UNIVERSITY OF CAPE TOWN This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:16}}
Clustering limma Clustering limma • 1.1k views
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 10 weeks ago
United States
Please read the posting guide http://www.bioconductor.org/help/mailing-list/posting-guide/ and see further below On Mon, Apr 4, 2011 at 9:48 AM, Arthur SHEN <arthur.shen at="" uct.ac.za=""> wrote: > Dear Sir/Madam, > I would like to find out the correct way for extracting asubset of data > from the normalized data, and > use it for the subsequentdifferential test in Limma. > Below is the script that I used for doing the cross- arraynormalization, > averaging of in-slide technical > repeats, differential test andmultiple testing corrections in package > Limma: > #Cross-array normalization > library(limma) > quantnorm_r<-normalizeBetweenArrays(normdata,method="Rquantile") > > #Filtering out all the control genes > quantnorm.filt<-quantnorm_r[quantnorm_r$genes$Status=="gene",] > filt.ID<-(as.character(quantnorm_r$genes$ID)[quantnorm_r$genes$Statu s=="gene"]) > > #Merging in-slide technical repeats > i <- orderfilt.ID) > filt.ID<-filt.ID[i] > quantnorm.filt<-quantnorm.filt[i,] > ave.quantnorm<-matrix(0,ncol=30,nrow=length(unlist(lapply(split(quan tnorm.filt$M[,1],filt.ID),mean)))) > for (j in 1:30) > { > ave.quantnorm[,j]<-unlist(lapply(split(quantnorm.filt$M[,j],filt.ID) ,mean)) > } > ave.gene.IDs<-names(lapply(split(quantnorm.filt$M[,1],filt.ID),mean)) > length(ave.gene.IDs) > > #Linear Model Fits (common reference approach) > targets<-readTargets("Targetsnew.txt") > design<-modelMatrix(targets,ref="reference") > fit<-lmFit(ave.quantnorm,design) > contrast.matrix<-makeContrasts(RWC80-RWC100,RWC60-RWC100,RWC40-RWC10 0,RWC20-RWC100,RWC5-RWC100,levels=design) > contrast.matrix > fit2<-contrasts.fit(fit,contrast.matrix) > fit2<-eBayes(fit2) > results<-decideTests(fit2) > diffex<-apply(abs(results),1,sum) > diffex<-diffex>0 > > #Preparing diff exp data for clustering analysis > cluster.data<-ave.quantnorm[diffex,] > cluster.names<-ave.gene.IDs[diffex] > rownames(cluster.data)<-cluster.names > > After the merging of the technical repeats, I tried to retrievethe data > of the interested 781 genes > from the full set normalized data. Ithought of exporting the full set of > normalized data (ave.quantnorm), > manuallyremoving the unwanted genes, then read it back into R, but I was > worried thatby doing so, > I might lose the important original information contained in thisobject. > I then tried creating the list of > 781 genes into a vector, or a matrix,then tried extracting the subset > data by using command: > > ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs=781list_matrix]or > ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs=781list_vector], > > but these failed. I would like to find out the correct wayof doing this. > What do you mean by "failed" here? It appears that ave.quantnorm is a matrix where rows correspond to genes. You would subset a matrix X using X[G, ] where G is some index into the rows of X. It seems you failed to put a comma in your request. > Thank you very much > > Arthur > > > > > > ### > UNIVERSITY OF CAPE TOWN > > This e-mail is subject to the UCT ICT policies and e-mai...{{dropped:16}} > > _______________________________________________ > 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 >
ADD COMMENT
0
Entering edit mode
Amos Folarin ▴ 80
@amos-folarin-4200
Last seen 10.2 years ago
Think you want something like this; "=" is an assignment operator. ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs==781list_matrix, ] or ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs %in% 781list_vector , ] Amos Folarin ---------- Forwarded message ---------- > From: "Arthur SHEN" <arthur.shen@uct.ac.za> > To: <bioconductor@r-project.org> > Date: Mon, 04 Apr 2011 15:48:17 +0200 > Subject: [BioC] Retrieving a subset from normalized microarray data for > differential test in R package, Limma > Dear Sir/Madam, > I would like to find out the correct way for extracting asubset of data > from the normalized data, and > use it for the subsequentdifferential test in Limma. > Below is the script that I used for doing the cross- arraynormalization, > averaging of in-slide technical > repeats, differential test andmultiple testing corrections in package > Limma: > #Cross-array normalization > library(limma) > quantnorm_r<- > normalizeBetweenArrays(normdata,method="Rquantile") > > #Filtering out all the control genes > quantnorm.filt<-quantnorm_r[quantnorm_r$genes$Status=="gene",] > > filt.ID<-(as.character(quantnorm_r$genes$ID)[quantnorm_r$genes$Statu s=="gene"]) > > #Merging in-slide technical repeats > i <- orderfilt.ID) > filt.ID<-filt.ID[i] > quantnorm.filt<-quantnorm.filt[i,] > > ave.quantnorm<-matrix(0,ncol=30,nrow=length(unlist(lapply(split(quan tnorm.filt$M[,1],filt.ID),mean)))) > for (j in 1:30) > { > ave.quantnorm[,j]<-unlist(lapply(split(quantnorm.filt$M[,j],filt.ID) ,mean)) > } > ave.gene.IDs<-names(lapply(split(quantnorm.filt$M[,1],filt.ID),mean)) > length(ave.gene.IDs) > > #Linear Model Fits (common reference approach) > targets<-readTargets("Targetsnew.txt") > design<-modelMatrix(targets,ref="reference") > fit<-lmFit(ave.quantnorm,design) > > contrast.matrix<-makeContrasts(RWC80-RWC100,RWC60-RWC100,RWC40-RWC10 0,RWC20-RWC100,RWC5-RWC100,levels=design) > contrast.matrix > fit2<-contrasts.fit(fit,contrast.matrix) > fit2<-eBayes(fit2) > results<-decideTests(fit2) > diffex<-apply(abs(results),1,sum) > diffex<-diffex>0 > > #Preparing diff exp data for clustering analysis > cluster.data<-ave.quantnorm[diffex,] > cluster.names<-ave.gene.IDs[diffex] > rownames(cluster.data)<-cluster.names > > After the merging of the technical repeats, I tried to retrievethe data > of the interested 781 genes > from the full set normalized data. Ithought of exporting the full set of > normalized data (ave.quantnorm), > manuallyremoving the unwanted genes, then read it back into R, but I was > worried thatby doing so, > I might lose the important original information contained in thisobject. > I then tried creating the list of > 781 genes into a vector, or a matrix,then tried extracting the subset > data by using command: > > ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs=781list_matrix]or > ave.quantnorm.781<-ave.quantnorm[ave.gene.IDs=781list_vector], > > but these failed. I would like to find out the correct wayof doing this. > > Thank you very much > > Arthur > > > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 517 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