[R] decideTests extraction of p-values

From: Vijay A Raghavan <rva_ec_at_yahoo.com>
Date: Thu 08 Jun 2006 - 04:47:14 EST


Hello all,  

 Here is the code that I am using for finding differentially expressed genes.  

 #Normalization  

 library(affy)
 library(Biobase)
 library(limma)
 library(gcrma)
 
     pd<-read.phenoData("file.txt",header=TRUE,row.names=1,as.is=TRUE,sep="\t")
     Data <- ReadAffy(filenames=pData(pd)$FileName,phenoData=pd)
     print(Data)
    
     eset <- gcrma(Data)
     write.exprs(eset, file="decide-test.6-6-06.txt")
 

 #Linear Model     

     pData(eset)
     targets<-pData(eset)
     model.matrix(~ -1 +factor(targets$Target,levels=unique(targets$Target)))
     design <- model.matrix(~ -1 +
     factor(targets$Target,levels=unique(targets$Target)))
     unique(targets$Target)
     colnames(design) <- unique(targets$Target)
     ncol(design)
     numParameters <- ncol(design)
     colnames(design)
     parameterNames <- colnames(design)
     design
     fit <- lmFit(eset,design=design)
     names(fit)
        
     contrastNames <-c(paste(parameterNames[2],parameterNames[1],sep="-"),
     paste(parameterNames[3],parameterNames[1],sep="-"),
     paste(parameterNames[4],parameterNames[1],sep="-"),
     paste(parameterNames[5],parameterNames[1],sep="-"),
     paste(parameterNames[6],parameterNames[1],sep="-"),
     paste(parameterNames[7],parameterNames[1],sep="-"))
 
     contrastsMatrix <- matrix(c(

-1,1,0,0,0,0,0,
-1,0,1,0,0,0,0,
-1,0,0,1,0,0,0,
-1,0,0,0,1,0,0,
-1,0,0,0,0,1,0,
-1,0,0,0,0,0,1),nrow=ncol(design))
rownames(contrastsMatrix) <- parameterNames colnames(contrastsMatrix) <- contrastNames contrastsMatrix fit2 <- contrasts.fit(fit,contrasts=contrastsMatrix) names(fit2)

 #ebayes  

     fit2 <- eBayes(fit2)
     names(fit2)
     numGenes <- nrow(eset@exprs)
 

 #decideTest  

 results <- decideTests(fit2,method="nestedF",p=0.05);  write.fit(fit2, results, "data.txt", adjust="BH");    

 Is there any way for getting the adjusted p-values from the decideTests method ?  

 Thanks,  

 Vijay  

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 08 05:07:10 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 08 Jun 2006 - 06:10:55 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.