Hi, I'm trying to use biomaRt on a privius database of mouse, but I receive an error message where it's explain that I can use the function of biomaRt on this database. How can I fix this problem?
this is the code that I try to use:
library("biomaRt") oldmouse = useMart(biomart="ENSEMBL_MART_ENSEMBL", host="may2012.archive.ensembl.org", path="/biomart/martservice") listMarts(oldmouse) listDatasets(oldmouse) oldmouse = useMart(biomart="ENSEMBL_MART_ENSEMBL", host="may2012.archive.ensembl.org", path="/biomart/martservice",dataset ="mmusculus_gene_ensembl") listFilters(oldmouse) browseVignettes("biomaRt") gene=getGene(id="A_51_P100052", type="with_efg_agilent_sureprint_g3_ge_8x60k", mart = oldmouse) show(gene)
and this is the error message:
> gene=getGene(id="A_51_P100052", type="with_efg_agilent_sureprint_g3_ge_8x60k", mart = oldmouse) Error in martCheck(mart, "ensembl") : This function only works when used with the ensembl BioMart.
Thanks.
This is the beauty of using Open Source tools - you can figure this stuff out for yourself. It's also the downside, because you often have to figure this stuff out for yourself.
Since Steffen indicated that getGene() is on the chopping block, let's assume the same for getSequence(). Also please note that IIRC, EVERYTHING in biomaRt ends up getting processed through getBM(), and all these helper functions just do the busy work for you. So let's look at getSequence. Here's the top part:
So we need the chromosome, start, end, and some other stuff. If you look at ?getSequence, you will see that the id is some sort of identifier, type tells getSequence what sort of ID it is, and seqType is what you want to get. And if you look at the rest of getSequence(), it is always some variation on
So let's try to figure this out. From an earlier post we have pretty much everything we need.
Attempt #1
OK, whatever. We'll use a list.
So there's the idea, and it's up to you to extend to whatever you want to get. If you are planning to do much with these sequences, then you would be better off using more sophisticated infrastructure than simple lists or data.frames.
This will take some effort on your part, and lots of reading. A good place to start is by perusing the workflows.