Using a BioMart other than Ensembl
Steffen Durinck, Wolfgang Huber, Mike Smith
Source:vignettes/accessing_other_marts.Rmd
accessing_other_marts.Rmd
Introduction
In recent years a wealth of biological data has become available in public data repositories. Easy access to these valuable data resources and firm integration with data analysis is needed for comprehensive bioinformatics data analysis. The biomaRt package, provides an interface to a growing collection of databases implementing the BioMart software suite. The package enables retrieval of large amounts of data in a uniform way without the need to know the underlying database schemas or write complex SQL queries. Examples of BioMart databases are Ensembl, Uniprot and HapMap. These major databases give biomaRt users direct access to a diverse set of data and enable a wide range of powerful online queries from R.
Using a BioMart other than Ensembl
There are a small number of non-Ensembl databases that offer a BioMart interface to their data. The biomaRt package can be used to access these in a very similar fashion to Ensembl. The majority of biomaRt functions will work in the same manner, but the construction of the initial Mart object requires slightly more setup. In this section we demonstrate the setting requires to query Wormbase ParaSite and Phytozome. First we need to load biomaRt.
Wormbase
To demonstrate the use of the biomaRt
package with non-Ensembl databases the next query is performed using the
Wormbase ParaSite BioMart. In this example, we use the
listMarts()
function to find the name of the available
marts, given the URL of Wormbase. We use this to connect to Wormbase
BioMart using the useMart()
function.1
listMarts(host = "parasite.wormbase.org")
## biomart version
## 1 parasite_mart WBPS 19 Mart
wormbase <- useMart(
biomart = "parasite_mart",
host = "https://parasite.wormbase.org",
port = 443
)
We can then use functions described earlier in this vignette to find and select the gene dataset, and print the first 6 available attributes and filters. Then we use a list of gene names as filter and retrieve associated transcript IDs and the transcript biotype.
listDatasets(wormbase)
## dataset description version
## 1 wbps_gene All Species (WBPS19) 19
wormbase <- useDataset(mart = wormbase, dataset = "wbps_gene")
head(listFilters(wormbase))
## name description
## 1 species_id_1010 Genome
## 2 nematode_clade_1010 Nematode Clade
## 3 chromosome_name Chromosome name
## 4 start Start
## 5 end End
## 6 strand Strand
head(listAttributes(wormbase))
## name description page
## 1 species_id_key Internal Name feature_page
## 2 production_name_1010 Genome project feature_page
## 3 display_name_1010 Genome name feature_page
## 4 taxonomy_id_1010 Taxonomy ID feature_page
## 5 assembly_accession_1010 Assembly accession feature_page
## 6 nematode_clade_1010 Nematode clade feature_page
getBM(
attributes = c(
"external_gene_id",
"wbps_transcript_id",
"transcript_biotype"
),
filters = "gene_name",
values = c("unc-26", "his-33"),
mart = wormbase
)
## external_gene_id wbps_transcript_id transcript_biotype
## 1 his-33 F17E9.13.1 protein_coding
## 2 unc-26 JC8.10a.1 protein_coding
## 3 unc-26 JC8.10b.1 protein_coding
## 4 unc-26 JC8.10c.1 protein_coding
## 5 unc-26 JC8.10d.1 protein_coding
Phytozome
Version 12
The Phytozome 12 BioMart was retired in August 2021 and can not longer be accessed.
Version 13
Version 13 of Phytozome can be found at https://phytozome-next.jgi.doe.gov/ and if you wish to query that version the URL used to create the Mart object must reflect that.
phytozome_v13 <- useMart(
biomart = "phytozome_mart",
dataset = "phytozome",
host = "https://phytozome-next.jgi.doe.gov"
)
Once this is set up the usual biomaRt functions can be used to interrogate the database options and run queries.
getBM(
attributes = c("organism_name", "gene_name1"),
filters = "gene_name_filter",
values = "82092",
mart = phytozome_v13
)
## organism_name gene_name1
## 1 Smoellendorffii_v1.0 82092
Session Info
## R version 4.5.1 (2025-06-13)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.3 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
##
## locale:
## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 LC_COLLATE=C.UTF-8
## [5] LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 LC_PAPER=C.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
##
## time zone: UTC
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] biomaRt_2.65.7 BiocStyle_2.36.0
##
## loaded via a namespace (and not attached):
## [1] KEGGREST_1.48.1 xfun_0.53 bslib_0.9.0 httr2_1.2.1
## [5] Biobase_2.68.0 vctrs_0.6.5 tools_4.5.1 generics_0.1.4
## [9] stats4_4.5.1 curl_7.0.0 tibble_3.3.0 AnnotationDbi_1.70.0
## [13] RSQLite_2.4.3 blob_1.2.4 pkgconfig_2.0.3 dbplyr_2.5.0
## [17] desc_1.4.3 S4Vectors_0.46.0 GenomeInfoDbData_1.2.14 lifecycle_1.0.4
## [21] compiler_4.5.1 stringr_1.5.1 textshaping_1.0.3 Biostrings_2.76.0
## [25] progress_1.2.3 GenomeInfoDb_1.44.2 htmltools_0.5.8.1 sass_0.4.10
## [29] yaml_2.3.10 pillar_1.11.0 pkgdown_2.1.3 crayon_1.5.3
## [33] jquerylib_0.1.4 cachem_1.1.0 tidyselect_1.2.1 digest_0.6.37
## [37] stringi_1.8.7 purrr_1.1.0 dplyr_1.1.4 bookdown_0.44
## [41] fastmap_1.2.0 cli_3.6.5 magrittr_2.0.3 withr_3.0.2
## [45] prettyunits_1.2.0 filelock_1.0.3 UCSC.utils_1.4.0 rappdirs_0.3.3
## [49] bit64_4.6.0-1 rmarkdown_2.29 XVector_0.48.0 httr_1.4.7
## [53] bit_4.6.0 ragg_1.5.0 png_0.1-8 hms_1.1.3
## [57] memoise_2.0.1 evaluate_1.0.5 knitr_1.50 IRanges_2.42.0
## [61] BiocFileCache_2.16.2 rlang_1.1.6 glue_1.8.0 DBI_1.2.3
## [65] xml2_1.4.0 BiocManager_1.30.26 BiocGenerics_0.54.0 jsonlite_2.0.0
## [69] R6_2.6.1 systemfonts_1.2.3 fs_1.6.6
warnings()