Using annotation to map IDs
There are many different ways to map IDs in R:
- For well characterized organisms you can use Bioconductor’s annotation packages
- You can use BioMart mapping from within R
- You can use UniProt ID mapping from within R
- You can also access NCBI’s Gene database from within R
Using Bioconductor annotation packages
Demo script for this lesson
Bioconductor provides an extensive list of annotation packages. Check the video to see how to use these packages in R to retrieve info for a list of genes.
Using BioMart in R
- R script for using BioMart in R for vertebrates and for non-vertebrates
- File with counts of mouse genes
- File with counts of Sorghum genes
BioMart in R is accessible via the biomaRt package and works exactly the same as BioMart online. You can use it to fetch annotation for all annotated organisms except bacteria.
Using UniProt ID mapping in R
- R script for fetching gene symbols based on UniProt IDs of bacterial genes
- File with UniProt IDs of Bacillus subtilis genes
Mapping IDs for bacterial genes is notoriously difficult because you cannot use BioMart for this. Although bacteria are part of Ensembl Genomes, their annotation is not accessible via BioMart. If you have UniProt IDs for your bacterial genes of interest you can use UniProt’s ID mapping tool.
Accessing NCBI’s Gene database from within R
- R script for fetching gene symbols based on locus tags of bacterial genes
- File with locus tags of E. coli genes
If you start from locus tags, that are used in Ensembl Genomes for identifying bacterial genes, instead of UniProt IDs it becomes even more complicated because the UniProt mapping tool doesn’t support these locus tags. They are supported by NCBI’s Gene database so you can use this database to map them to gene symbols.