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$Status=="gene"])
>
> #Merging in-slide technical repeats
> i <- order(filt.ID)
> filt.ID<-filt.ID[i]
> quantnorm.filt<-quantnorm.filt[i,]
>
> ave.quantnorm<-matrix(0,ncol=30,nrow=length(unlist(lapply(split(quantnorm.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-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
>
>
>

	[[alternative HTML version deleted]]

