find_id: find_id

View source: R/gene_ids.R

find_idR Documentation

find_id

Description

find gene ids from annotation data

Arguments

symbol

a string for a gene symbol or alias to match

annotation

a list of gene symbols named by ids such as those provided by bioconductor AnnotationDbi packages

n

number of ids to list (maximum). Defaults to first. Set to Inf to display all.

See Also

find_symbol

Examples

#load data to identify genes from IDs
if(!require("org.Hs.eg.db")){
  install.packages("BiocManager")
  BiocManager::install("org.Hs.eg.db")
  library("org.Hs.eg.db")
}
annotation <- as.list(org.Hs.egSYMBOL)
gene <- "7157"
# Entrez ID from human symbol
find_symbol(gene, annotation)

#Ensembl ID from human symbol
annotation <-  as.list(org.Hs.egSYMBOL)
names(annotation) <- as.list(org.Hs.egENSEMBL)
gene <- "ENSG00000141510"
find_symbol(gene, annotation)

#Full gene name from Ensembl ID
annotation <- as.list(org.Hs.egGENENAME)
names(annotation) <- as.list(org.Hs.egENSEMBL)
find_symbol("ENSG00000171428", annotation)

#load data to identify genes from IDs
if(!require("org.Mm.eg.db")){
  install.packages("BiocManager")
  BiocManager::install("org.Mm.eg.db")
  library("org.Mm.eg.db")
}
annotation <- as.list(org.Mm.egSYMBOL)
gene <- "12494"
# Entrez ID from mouse symbol
find_symbol(gene, annotation)

#Ensembl ID from mouse symbol
annotation <- as.list(org.Mm.egSYMBOL)
names(annotation) <- as.list(org.Mm.egENSEMBL)
gene <- "ENSMUSG00000029084"
find_symbol(gene, annotation)

#load data to identify genes from IDs
if(!require("org.Hs.eg.db")){
  install.packages("BiocManager")
  BiocManager::install("org.Hs.eg.db")
  library("org.Hs.eg.db")
}
annotation <- as.list(org.Hs.egSYMBOL)
gene <- "TP53"
# Entrez ID from human symbol
find_id(gene, annotation)

#Ensembl ID from human symbol
annotation <- as.list(org.Hs.egSYMBOL)
names(annotation) <- as.list(org.Hs.egENSEMBL)
gene <- "TP53"
find_id(gene, annotation)

#load data to identify genes from IDs
if(!require("org.Mm.eg.db")){
  install.packages("BiocManager")
  BiocManager::install("org.Mm.eg.db")
  library("org.Mm.eg.db")
}
annotation <- as.list(org.Mm.egSYMBOL)
gene <- "Cd38"
# Entrez ID from mouse symbol
find_id(gene, annotation)

#Ensembl ID from mouse symbol
annotation <- as.list(org.Mm.egSYMBOL)
names(annotation) <- as.list(org.Mm.egENSEMBL)
gene <- "Cd38"
find_id(gene, annotation)

#load data to identify genes from IDs
if(!require("org.At.tair.db")){
  install.packages("BiocManager")
  BiocManager::install("org.At.tair.db")
  library("org.At.tair.db")
}
annotation <- as.list(org.At.tairSYMBOL)
gene <- "SCR"
find_id(gene, annotation)

genes <- c("WOX5", "WUS")
sapply(genes, find_id, annotation)


TomKellyGenetics/tktools documentation built on July 6, 2024, 5:44 a.m.