There's more...

The approach we used in this recipe works well for Ensembl core databases, but there are other non-Ensembl core databases that we might want to search; for that, there is biomaRt. biomaRt allows us to define connections to other databases we may know of. Many of these databases expose an API we can use to query them. To do this, load the biomaRt library and use the useMart() function to define a connection to the appropriate host and dataset. Then, use the getBM() function with the connection and the columns and gene IDs to query with. You'll get the search results for InterPro back if your query is interpro. The following example does a search for two Arabidopsis genes at plants.ensembl.org:

library(biomaRt)
biomart_athal <- useMart(biomart = "plants_mart", host = "plants.ensembl.org", dataset = "athaliana_eg_gene")
getBM( c("tair_locus", "interpro"), filters=c("tair_locus"), values = c("AT5G40950", "AT2G40510"), mart = biomart_athal)

This returns the following output:

##   tair_locus  interpro
## 1  AT2G40510 IPR000892
## 2  AT2G40510 IPR038551
## 3  AT5G40950 IPR001684
## 4  AT5G40950 IPR018261
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.248.90