Open DeepaMahm opened 5 years ago
In R this works,
library("biomaRt")
listMarts()
ensembl <- useMart("ensembl",dataset="hsapiens_gene_ensembl")
filters = listFilters(ensembl)
entrezgene = c("3098","728642")
genes <- getBM(filters="entrezgene_id", attributes=c("ensembl_gene_id","entrezgene_id"), values=entrezgene, mart=ensembl)
print(genes)
I intend to do the same in python.
Same problem here! Looks like only ENSEMBL ids (link_ensembl_gene_id
) can be used as a filter. You can work around that by defining no filters, just requesting the attributes you need and then filtering yourself.
I tried the following to filter based on entrez gene id
The following error occurs,
pybiomart.base.BiomartException: Unknown filter entrezgene, check dataset filters for a list of valid filters.
entrez gene is not available in dataset.list_filters() too .
Using
gene_id
also doesn't work. Any alternate ways?