Question: error while using plant ensembl biomart
0
gravatar for Medhat
2.1 years ago by
Medhat8.6k
Texas
Medhat8.6k wrote:

Hi, I am trying to extract gene ontology term from plant ensembl biomart using the following code:

from pybiomart import Server
server = Server(host='http://plants.ensembl.org')
#print server.list_marts() # available marts



mart = server['plants_mart'] # connecting   plants_mart 
  #print mart.list_datasets() # print available datasets

dataset = mart['zmays_eg_gene']

print dataset.query(attributes=['go'], filters={"transcript_id": ['Zm00001d000475_T001']})

but I have this error:

pybiomart.base.BiomartException: Query ERROR: caught BioMart::Exception::Usage: WITHIN Virtual Schema : default, Dataset zmays_eg_gene NOT FOUND

even though 'zmays_eg_gene was listed in mart.list_datasets()

ADD COMMENTlink modified 2.1 years ago by Emily_Ensembl20k • written 2.1 years ago by Medhat8.6k
2
gravatar for Fabio Marroni
2.1 years ago by
Fabio Marroni2.4k
Italy
Fabio Marroni2.4k wrote:

Hi, I don't know what's going on there, but you can install the bioconductor package biomaRt and then run the following commands.

library(biomaRt)
host="plants.ensembl.org"
mysets<-listDatasets(useMart("plants_mart", host = host))
myusemart <- useDataset("zmays_eg_gene", mart = useMart("plants_mart", host = host))
resultTable <- getBM(attributes=c("ensembl_gene_id","chromosome_name","start_position","end_position","go_id","goslim_goa_accession"), mart = myusemart)

The attributes of getBM can be changed (I usually get go and goslim), and then you can just use the write.table function to save the file if you want to get rid of R and work back in python.

ADD COMMENTlink written 2.1 years ago by Fabio Marroni2.4k

Thanks a lot, worked perfectly with no complications:

library(biomaRt)
host="plants.ensembl.org"
mysets<-listDatasets(useMart("plants_mart", host = host))
myusemart <- useDataset("zmays_eg_gene", mart = useMart("plants_mart", host = host))
resultTable <- getBM(attributes=c("go_id", "ensembl_gene_id"), mart = myusemart, filters = "ensembl_gene_id", values = c("Zm00001d002426"), uniqueRows=F)

#  to get more info about available attributes and filters
listFilters(mart = myusemart, what = c("name", "description"))
listAttributes(myusemart)

Thanks

ADD REPLYlink modified 2.1 years ago • written 2.1 years ago by Medhat8.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 795 users visited in the last hour