create an new AnnotatedDataFrame
1
0
Entering edit mode
@yad-ghavi-helm-2284
Last seen 10.2 years ago
Hi all, I am trying to make an AnnotatedDataFrame with the Biobase package. Here is my code: 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). 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.
Survival Yeast Biobase genefilter tkWidgets marray convert arrayMagic affyio Survival • 1.8k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 3 months ago
United States
"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_MONETAR Y=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
ADD COMMENT

Login before adding your answer.

Traffic: 688 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6