[BioC] decideTest extraction of P values

Gordon K Smyth smyth at wehi.EDU.AU
Thu Jun 8 14:42:49 CEST 2006


> Date: Wed, 7 Jun 2006 12:06:13 -0700 (PDT)
> From: Vijay A Raghavan <rva_ec at yahoo.com>
> Subject: [BioC] decideTest extraction of P values
> To: bioconductor at stat.math.ethz.ch
> Message-ID: <20060607190613.54736.qmail at web53514.mail.yahoo.com>
> Content-Type: text/plain
>
> 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 at 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]]

p.adjust(fit2$F.p.value,method="BH")

Best wishes
Gordon



More information about the Bioconductor mailing list