find_id: find_id

Description Arguments See Also Examples

View source: R/gene_ids.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#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 Dec. 13, 2021, 10:06 p.m.