| Title: | Reimplementation of the 'biomaRt' Package Using Modern Ensembl APIs |
|---|---|
| Description: | This package aims to offer a drop-in replacement to biomaRt using the same interface but the more modern and better maintained APIs provided by Ensembl. It provides an easy solution for compatibility with minimal changes for existing projects and packages. New projects may prefer to use another approach which is not constrained by the need for backward compatibility with biomaRt. |
| Authors: | Hugo Gruson [aut, cre] (ORCID: <https://orcid.org/0000-0002-4094-1476>), German Network for Bioinformatics Infrastructure - de.NBI [fnd] |
| Maintainer: | Hugo Gruson <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.6 |
| Built: | 2026-10-12 15:53:26 UTC |
| Source: | https://github.com/BiocStaging/remart |
Retrieve gene/transcript annotations from Ensembl
getBM( attributes, filters = "", values = "", ..., version = NULL, species = NULL )getBM( attributes, filters = "", values = "", ..., version = NULL, species = NULL )
attributes |
Attributes you want to retrieve. A possible list of
attributes can be retrieved using the function |
filters |
Filters (one or more) that should be used in the query. A
possible list of filters can be retrieved using the function |
values |
Values of the filter, e.g. vector of affy IDs. If multiple filters are specified then the argument should be a list of vectors of which the position of each vector corresponds to the position of the filters in the filters argument. |
... |
Ignored. Used to catch no longer necessary parameters such as
|
version |
Ensembl version to use for the query. If |
species |
Ensembl name (e.g. |
Only a subset of the attributes and filters supported by the biomaRt
package are currently implemented, as this data has to be retrieved
through the Ensembl REST lookup/id endpoint rather than a generic
BioMart query engine.
Supported filters (only one can be used at a time): ensembl_gene_id,
ensembl_transcript_id, external_gene_name.
Supported attributes: ensembl_gene_id, ensembl_transcript_id,
ensembl_peptide_id, external_gene_name, description,
chromosome_name, start_position, end_position, strand,
gene_biotype, transcript_biotype, version.
A data frame containing the requested gene or transcript annotations, with one column for each requested attribute. The number of rows does not necessarily match the number of requested identifiers, as some attributes can have multiple values for a single identifier (e.g. a gene with multiple transcripts).
attribs <- c("ensembl_gene_id", "external_gene_name", "chromosome_name") getBM( attributes = attribs, filters = "ensembl_gene_id", values = c("ENSG00000157764", "ENSG00000004939") ) # It is also possible to a gene symbol, but a species must be specified, as # gene symbols are not unique across species. getBM( attributes = attribs, filters = "external_gene_name", values = c("APOE", "MAPT"), species = "human" ) # Query a specific Ensembl release (e.g. 114) instead of the latest one. getBM( attributes = attribs, filters = "ensembl_gene_id", values = "ENSG00000157764", version = 114 ) # Archived releases can also be specified by their release name. getBM( attributes = attribs, filters = "external_gene_name", values = "APOE", species = "human", version = "may2025" )attribs <- c("ensembl_gene_id", "external_gene_name", "chromosome_name") getBM( attributes = attribs, filters = "ensembl_gene_id", values = c("ENSG00000157764", "ENSG00000004939") ) # It is also possible to a gene symbol, but a species must be specified, as # gene symbols are not unique across species. getBM( attributes = attribs, filters = "external_gene_name", values = c("APOE", "MAPT"), species = "human" ) # Query a specific Ensembl release (e.g. 114) instead of the latest one. getBM( attributes = attribs, filters = "ensembl_gene_id", values = "ENSG00000157764", version = 114 ) # Archived releases can also be specified by their release name. getBM( attributes = attribs, filters = "external_gene_name", values = "APOE", species = "human", version = "may2025" )
Retries gene annotation information from Ensembl.
getGene(id, type = "ensembl_gene_id", ..., version = NULL, species = NULL)getGene(id, type = "ensembl_gene_id", ..., version = NULL, species = NULL)
id |
vector of gene identifiers one wants to annotate |
type |
type of identifier, possible values can be obtained by the listFilters function. Examples are entrezgene_id, hgnc_symbol (for hugo gene symbol), ensembl_gene_id, unigene, agilentprobe, affy_hg_u133_plus_2, refseq_dna, etc. |
... |
Ignored. Used to catch no longer necessary parameters such as
|
version |
Ensembl version to use for the query. If |
species |
Ensembl name (e.g. |
A data frame containing the following gene annotations for the requested IDs:
ensembl_gene_id
hgnc_symbol
description
chromosome_name
band (not available from Ensembl REST API, will be filled with NA)
strand
start_position
end_position
getGene( "ENSG00000157764", type = "ensembl_gene_id" ) ids <- c( "ENSG00000003987", "ENSG00000004939" ) getGene( id = ids, type = "ensembl_gene_id", version = "may2025" )getGene( "ENSG00000157764", type = "ensembl_gene_id" ) ids <- c( "ENSG00000003987", "ENSG00000004939" ) getGene( id = ids, type = "ensembl_gene_id", version = "may2025" )
Retrieve orthologous gene annotations across two species
getLDS( attributes, filters = "", values = "", attributesL, filtersL = "", valuesL = "", ..., version = NULL, species = NULL, speciesL = NULL )getLDS( attributes, filters = "", values = "", attributesL, filtersL = "", valuesL = "", ..., version = NULL, species = NULL, speciesL = NULL )
attributes |
Attributes you want to retrieve of primary dataset. A
possible list of attributes can be retrieved using the function
|
filters |
Filters that should be used in the query. These filters will
be applied to primary dataset. A possible list of filters can be retrieved
using the function |
values |
Values of the filter, e.g. list of affy IDs |
attributesL |
Attributes of linked dataset that needs to be retrieved |
filtersL |
Filters to be applied to the linked dataset |
valuesL |
Values for the linked dataset filters |
... |
Ignored. Used to catch no longer necessary parameters such as
|
version |
Ensembl version to use for the query. If |
species |
Ensembl name (e.g. |
speciesL |
Ensembl name (e.g. |
This function relies on the Ensembl REST homology/id endpoint, and
therefore only supports retrieving orthologues, and not the more general
cross-database attribute linking biomaRt::getLDS() could perform.
Supported filters/attributes (for both filters/attributes and
filtersL/attributesL): ensembl_gene_id, ensembl_peptide_id,
external_gene_name, description, chromosome_name,
start_position, end_position, strand, gene_biotype.
Only "ensembl_gene_id" and "external_gene_name" are supported for filter.
A data frame containing source-species and target-species ortholog annotations.
getLDS( attributes = c("ensembl_gene_id", "external_gene_name"), filters = "ensembl_gene_id", values = "ENSG00000157764", attributesL = c("ensembl_gene_id", "external_gene_name"), speciesL = "mouse" ) # It is also possible to a gene symbol, but a species must be specified, as # gene symbols are not unique across species. getLDS( attributes = c("ensembl_gene_id", "external_gene_name"), filters = "external_gene_name", values = "APOE", species = "human", attributesL = c("ensembl_gene_id", "external_gene_name"), speciesL = "mouse" ) # Query a specific Ensembl release for the source and target genes. getLDS( attributes = c("ensembl_gene_id", "external_gene_name"), filters = "ensembl_gene_id", values = "ENSG00000157764", attributesL = c("ensembl_gene_id", "external_gene_name"), speciesL = "mouse", version = 114 )getLDS( attributes = c("ensembl_gene_id", "external_gene_name"), filters = "ensembl_gene_id", values = "ENSG00000157764", attributesL = c("ensembl_gene_id", "external_gene_name"), speciesL = "mouse" ) # It is also possible to a gene symbol, but a species must be specified, as # gene symbols are not unique across species. getLDS( attributes = c("ensembl_gene_id", "external_gene_name"), filters = "external_gene_name", values = "APOE", species = "human", attributesL = c("ensembl_gene_id", "external_gene_name"), speciesL = "mouse" ) # Query a specific Ensembl release for the source and target genes. getLDS( attributes = c("ensembl_gene_id", "external_gene_name"), filters = "ensembl_gene_id", values = "ENSG00000157764", attributesL = c("ensembl_gene_id", "external_gene_name"), speciesL = "mouse", version = 114 )
Get Sequences from Ensembl
getSequence( chromosome, start, end, id, type, seqType, upstream, downstream, ..., version = NULL )getSequence( chromosome, start, end, id, type, seqType, upstream, downstream, ..., version = NULL )
chromosome |
Chromosome name |
start |
start position of sequence on chromosome |
end |
end position of sequence on chromosome |
id |
An identifier or vector of identifiers. |
type |
The type of identifier used. Supported types are hugo, ensembl,
embl, entrezgene, refseq, ensemblTrans and unigene. Alternatively one can
also use a filter to specify the type. Possible filters are given by the
|
seqType |
Type of sequence that you want to retrieve. Allowed seqTypes are given in the details section. |
upstream |
To add the upstream sequence of a specified number of basepairs to the output. |
downstream |
To add the downstream sequence of a specified number of basepairs to the output. |
... |
Ignored. Used to catch no longer necessary parameters such as
|
version |
Ensembl version to use for the query. If |
A data frame containing the requested sequences and their associated metadata.
getSequence( seqType = "gene_exon_intron", type = "ensembl_gene_id", id = "ENSG00000001497" ) ids <- c( "ENSG00000003987", "ENSG00000004939" ) getSequence( seqType = "gene_exon_intron", type = "ensembl_gene_id", id = ids ) # Retrieve sequences from a specific Ensembl release. getSequence( seqType = "cdna", type = "ensembl_gene_id", id = "ENSG00000001497", version = 114 )getSequence( seqType = "gene_exon_intron", type = "ensembl_gene_id", id = "ENSG00000001497" ) ids <- c( "ENSG00000003987", "ENSG00000004939" ) getSequence( seqType = "gene_exon_intron", type = "ensembl_gene_id", id = ids ) # Retrieve sequences from a specific Ensembl release. getSequence( seqType = "cdna", type = "ensembl_gene_id", id = "ENSG00000001497", version = 114 )
List supported attributes
listAttributes(...)listAttributes(...)
... |
Ignored. Used to catch no longer necessary parameters from the biomaRt functions. |
A character vector of supported attributes to be used in getBM()
and getLDS().
listAttributes()listAttributes()