coerce biomaRt martTable into data frame
1
0
Entering edit mode
Georg Otto ▴ 510
@georg-otto-956
Last seen 10.3 years ago
Hi, I have a problem working with the biomaRt package: I have a list of probe IDs that are differentially expressed in an affymetrix experiment. From this I created a martTable with annotation data using: top.genes<-getGene(id=genes, array="zebrafish", mart=mart) This works fine, but now I want to create data frame out of the top.genes object, because I would like to have the results in a table. However: > as.data.frame(top.genes) Results in the following error: Error in as.data.frame.default(top.genes) : cannot coerce class "martTable" into a data.frame My question is: How can I coerce a martTable into a data frame? I understand that this might be a more general R question, but maybe somebody could give me a hint. I am running R version 2.1.0, 2005-05-12, powerpc-apple-darwin7.9.0 biomaRt 1.2.0 Thanks a lot! Georg
probe biomaRt probe biomaRt • 808 views
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 4 months ago
EMBL European Molecular Biology Laborat…
Dear Georg, try as.data.frame(top.genes at table) or cbind(top.genes at id, as.data.frame(top.genes at table)) Note that you can use the "slotNames" or "str" function to inspect an object?s internal structure. We will add an as.data.frame method to future versions biomaRt, or even get rid of the "martTable" class completely (in favor of a simple data frame), that is not fully decided yet. Best wishes Wolfgang Georg Otto wrote: > Hi, > > I have a problem working with the biomaRt package: > > I have a list of probe IDs that are differentially expressed in an > affymetrix experiment. From this I created a martTable with annotation > data using: > > top.genes<-getGene(id=genes, array="zebrafish", mart=mart) > > This works fine, but now I want to create data frame out of the > top.genes object, because I would like to have the results in a > table. However: > > >>as.data.frame(top.genes) > > > Results in the following error: > > Error in as.data.frame.default(top.genes) : > cannot coerce class "martTable" into a data.frame > > > My question is: How can I coerce a martTable into a data frame? I > understand that this might be a more general R question, but maybe > somebody could give me a hint. > > I am running > > R version 2.1.0, 2005-05-12, powerpc-apple-darwin7.9.0 > > biomaRt 1.2.0 > > Thanks a lot! > > Georg > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- Best regards Wolfgang ------------------------------------- Wolfgang Huber European Bioinformatics Institute European Molecular Biology Laboratory Cambridge CB10 1SD England Phone: +44 1223 494642 Fax: +44 1223 494486 Http: www.ebi.ac.uk/huber
ADD COMMENT

Login before adding your answer.

Traffic: 562 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