Using Annotations
In this exercise, you will use gene coordinates obtained from the TxDb.Hsapiens.UCSC.hg19.knownGene package. This package provides the coordinates of all known human genes. A GRanges
object with coordinates and a unique ID for genes on chromosome 20 has been loaded for you as human_genes
.
While these IDs are useful in identifying genes, they are not easy to make sense of. It may be beneficial to add the more human readable gene symbols as well. This can be achieved with the help of the org.Hs.eg.db package, which provides mappings between different sets of gene identifiers. The select()
function allows you to obtain a gene symbol, stored in the SYMBOL
column, for each ID. Once you have extracted this information, you can add it to the table of gene locations.
Este exercício faz parte do curso
ChIP-seq with Bioconductor in R
Instruções do exercício
- Obtain gene symbols from the
SYMBOL
column of org.Hs.eg.db. - Examine the structure of the returned annotations.
- Add gene symbols to
human_genes
. - Examine the result.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Obtain gene symbols
gene_symbol <- ___(org.Hs.eg.db, keys=human_genes$gene_id, columns="SYMBOL", keytype="ENTREZID")
# Examine the structure of the returned annotations
str(___)
# Add gene symbols to gene coordinates
human_genes$symbol <- ___
# Examine output
print(human_genes)