[BioC] read.phenoData vs read.AnnotatedDataFrame
Martin Morgan
mtmorgan at fhcrc.org
Thu Jul 26 01:49:06 CEST 2007
Hi Alice --
"Johnstone, Alice" <Alice.Johnstone at esr.cri.nz> writes:
> Using R2.5.0 and Bioconductor I have been following code to analysis
> Affymetrix expression data: 2 treatments vs control. The original code
> was run last year and used the read.phenoData command, however with the
> newer version I get the error message
> Warning messages:
> read.phenoData is deprecated, use read.AnnotatedDataFrame instead
> The phenoData class is deprecated, use AnnotatedDataFrame (with
> ExpressionSet) instead
>
> I use the read.AnnotatedDataFrame command, but when it comes to the end
> of the analysis the comparison of the treatment to the controls gets
> mixed up compared to what you get using the original read.phenoData ie
> it looks like the 3 groups get labelled wrong and so the comparisons are
> different (but they can still be matched up).
> My questions are,
> 1) do you need to set up your target file differently when using
> read.AnnotatedDataFrame - what is the standard format?
I can't quite tell where things are going wrong for you, so it would
help if you can narrow down where the problem occurs. I think
read.AnnotatedDataFrame should be comparable to read.phenoData. Does
> pData(pd)
look right? What about
> pData(Data)
and
> pData(eset.rma)
? It's not important but pData(pd)$Target is the same as
pd$Target. Since the analysis is on eset.rma, it probably makes sense
to use the pData from there to construct your design matrix
> targs<-factor(eset.rma$Target)
> design<-model.matrix(~0+targs)
> colnames(design)<-levels(targs)
Does design look right?
> I have three columns sample, filename and target.
> 2) do you need to use a different model matrix to what I have?
> 3) do you use a different command for making the contrasts?
Depends on the question! If you're performing the same analysis as
last year, then the model matrix and contrasts have to be the same!
> I have included my code below if that is of any assistance.
> Many Thanks!
> Alice
>
>
>
> ##Read data
> pd<-read.AnnotatedDataFrame("targets.txt",header=T,row.name="sample")
> Data<-ReadAffy(filenames=pData(pd)$FileName,phenoData=pd)
> ##normalisation
> eset.rma<-rma(Data)
> ##analysis
> targs<-factor(pData(pd)$Target)
> design<-model.matrix(~0+targs)
> colnames(design)<-levels(targs)
> fit<-lmFit(eset.rma,design)
> cont.wt<-makeContrasts("treatment1-control","treatment2-control",levels=
> design)
> fit2<-contrasts.fit(fit,cont.wt)
> fit2.eb<-eBayes(fit2)
> testconts<-classifyTestsF(fit2.eb,p.value=0.01)
> topTable(fit2.eb,coef=2,n=300)
> topTable(fit2.eb,coef=1,n=300)
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
--
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org
More information about the Bioconductor
mailing list