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:
getSequence <- function (chromosome, start, end, id, type, seqType, upstream, downstream, mart, verbose = FALSE) { martCheck(mart, c("ensembl", "ENSEMBL_MART_ENSEMBL")) if (missing(seqType) || !seqType %in% c("cdna", "peptide", "3utr", "5utr", "gene_exon", "transcript_exon", "transcript_exon_intron", "gene_exon_intron", "coding", "coding_transcript_flank", "coding_gene_flank", "transcript_flank", "gene_flank"))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
sequence = getBM(c(seqType, type), filters = c("chromosome_name", "start", "end"), values = list(chromosome, start, end), mart = mart, checkFilters = FALSE, verbose = verbose)So let's try to figure this out. From an earlier post we have pretty much everything we need.
> genedat <- getBM(annot, filt, id, oldmouse) > genedat mgi_symbol efg_agilent_sureprint_g3_ge_8x60k 1 Ccr8 A_55_P2136348 description 1 chemokine (C-C motif) receptor 8 [Source:MGI Symbol;Acc:MGI:1201402] chromosome_name band strand start_position end_position ensembl_gene_id 1 9 F4 1 120001251 120004024 ENSMUSG00000042262Attempt #1
> getBM(c("gene_exon", "ensembl_gene_id"), c("chromosome_name","start","end"), genedat[,c(4,7,8)], oldmouse) Error in getBM(c("gene_exon", "ensembl_gene_id"), c("chromosome_name", : If using multiple filters, the 'value' has to be a list. For example, a valid list for 'value' could be: list(affyid=c('1939_at','1000_at'), chromosome= '16') Here we select on Affymetrix identifier and chromosome, only results that pass both filters will be returnedOK, whatever. We'll use a list.
> getBM(c("gene_exon", "ensembl_gene_id"), c("chromosome_name","start","end"), as.list(genedat[,c(4,7,8)]), oldmouse) gene_exon 1 GTCTTCCTGCCTCGATGGATTACACGATGGAGCCCAACGTCACGATGACCGACTACTACCCTGATTTCTTCACCGCCCCCTGTGACGCAGAGTTCCTCCTCAGGGGCAGCATGCTGTATCTGGCCATCTTGTACTGCGTCTTGTTTGTGCTGGGCCTTCTGGGGAACAGCCTGGTCATCTTAGTCCTCGTGGGCTGCAAGAAACTGAGGAGCATCACAGATATCTACCTCCTGAACCTGGCCGCATCCGACCTGCTCTTTGTCCTCTCTATTCCTTTTCAGACCCACAACCTGCTGGACCAGTGGGTGTTTGGGACTGCGATGTGTAAGGTGGTCTCTGGCCTTTATTACATTGGTTTTTTCAGCAGTATGTTCTTCATCACCCTAATGAGTGTGGACAGGTATCTGGCTATTGTCCACGCTGTCTATGCCATCAAGGTGAGGACGGCCAGCGTGGGCACAGCCCTGAGTCTGACAGTGTGGCTGGCTGCTGTCACAGCCACCATCCCCTTGATGGTTTTTTACCAAGTGGCCTCTGAAGACGGCATGCTACAATGTTTCCAGTTTTATGAAGAGCAGTCTTTGAGGTGGAAGCTCTTTACCCACTTTGAAATCAACGCCTTGGGTCTGCTGCTCCCCTTTGCCATCCTCCTGTTCTGCTATGTCAGGATCCTGCAGCAGCTGCGGGGCTGCCTGAACCACAACAGGACCAGAGCCATCAAGCTGGTGCTCACCGTAGTCATTGTGTCTTTACTCTTCTGGGTCCCATTCAACGTGGCCCTTTTCCTCACGTCCCTGCACGACCTGCACATCTTGGATGGATGTGCCACGAGGCAGAGGCTGGCTCTGGCCATCCATGTCACAGAGGTCATCTCTTTTACCCACTGCTGCGTGAACCCCGTCATCTACGCGTTCATAGGAGAGAAGTTTAAGAAACACCTCATGGATGTGTTTCAAAAGAGCTGCAGCCACATCTTCCTCTACTTAGGGAGACAAATGCCCGTGGGGGCGTTGGAAAGGCAGCTGTCCTCGAACCAGCGATCTTCCCATTCTTCCACCCTGGATGACATCTTGTAAGGGGAGTGTGCAGGGCAGGCAGAC 2 TGGCAGAGGAGTGGGCAGCTCTGAAACCTCAGAAGAAAGGCTCGCTCAGATAATTG ensembl_gene_id 1 ENSMUSG00000042262 2 ENSMUSG00000042262So 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.