[BioC] create an new AnnotatedDataFrame
Martin Morgan
mtmorgan at fhcrc.org
Wed Aug 8 18:54:36 CEST 2007
"GHAVI-HELM Yad" <yad.ghavi-helm at cea.fr> writes:
>
>
> exprsFile<-"D:/exprsData.txt"
> exprs<-read.table(exprsFile,header=TRUE,sep="",as.is=TRUE)
>
> pDataFile<-"D:/pData.txt"
> pData<-read.table(pDataFile,header=TRUE, sep="", as.is=TRUE)
>
> metaData<-"D:/mData.txt"
> mData<-read.table(metaData,header=TRUE,sep="",as.is=TRUE)
> metData<-new("AnnotatedDataFrame",data=exprs2,varMetadata=mData)
>
> At this step I have the following error:
> Error in `row.names<-.data.frame`(`*tmp*`, value = c("A", "B")) :
> length of 'row.names' incorrect
>
> It seems strangle because "A" and "B" are the colnames of exprsData
> (or the rownames of pData).
AnnotatedDataFrame coordinates a data.frame with it's metadata. From
your naming convention, I'm guessing that what your command is doing
is trying to coordinate an expression matrix with its varMetadata. I
think what you want to do is
> phenoData = new("AnnotatedDataFrame", data=pData, varMetadata=mData)
You might then use this to create an ExpressionSet (for example)
> new("ExpressionSet", exprs=exprs, phenoData=phenoData)
The read.AnnotatedDataFrame page might provide some additional hints
on reading data from files; a warning is that read.AnnotatedDataFrame
will change (hopefully for the better) in the next release of
Bioconductor.
Hope that helps,
Martin
> I tried to do :
>
> metData<-new("AnnotatedDataFrame",data=exprs2,varMetadata=mData, row.names=1)
>
> or
>
> rown=rownames(exprs)
> metData<-new("AnnotatedDataFrame",data=exprs2,varMetadata=mData, row.names=rown)
>
>
> but I steel got the same error
>
> hope anyone could help me...
>
>
>> sessionInfo()
> R version 2.5.0 (2007-04-23)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=French_France.1252;LC_CTYPE=French_France.1252;LC_MONETARY=French_France.1252;LC_NUMERIC=C;LC_TIME=French_France.1252
>
> attached base packages:
> [1] "tcltk" "splines" "tools" "stats" "graphics" "grDevices" "utils" "datasets" "methods" "base"
>
> other attached packages:
> YEAST convert marray tkWidgets DynDoc widgetTools arrayMagic genefilter survival vsn affy affyio limma
> "1.16.0" "1.10.0" "1.14.0" "1.14.0" "1.14.0" "1.12.0" "1.14.0" "1.14.1" "2.31" "2.2.0" "1.14.2" "1.4.1" "2.10.5"
> Biobase
> "1.14.1"
>
>
>
> Yad.
>
> _______________________________________________
> 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