Learn R Programming

dnapath (version 0.6.4)

symbol_to_entrez: Obtain entrezgene IDs for gene symbols

Description

Uses biomaRt biomartdnapath to map entrezgene IDs to gene symbols for a given species. The output of this function can be used in rename_genes.

Usage

symbol_to_entrez(x, species, dir_save = tempdir(), verbose = TRUE)

Arguments

x

A vector of gene symbols.

species

The species to obtain entrezgene IDs for. For example: "Homo sapiens", "m musculus", "C. elegans", or "S cerevisiae". "Human" and "mouse" can also be used and will be converted to the correct species name.

dir_save

The directory to store annotation reference. Future calls to this function will use the stored annotations. This speeds up the operation and allows for reproducibility in the event that the biomaRt database is updated. Set to NULL to disable. By default, it uses a temporary directory to store files during the R session.

verbose

Set to FALSE to avoid messages.

Value

A data frame with two columns: the first contains the original gene symbols, and the second contains a corresponding entrezgene ID.

Details

If entrezgene IDs are used in a dnapath_list or dnapath object, or a pathway list, then get_genes can be used to extract them and used for the x argument here.

References

biomartdnapath

See Also

entrez_to_symbol, get_genes

Examples

Run this code
# NOT RUN {
# Convert a set of gene symbols to entrezgene IDs.
# Note that not all may have mapping (such as "MSX" in this example).
gene_mat <- symbol_to_entrez(c("SOX2", "SEMA3E", "COL11A1", "UBB", "MSX"),
                               species = "human")
# }

Run the code above in your browser using DataLab