Using annotation to map IDs
There are many different ways to map IDs in R:
- For well characterized organisms use Bioconductor’s annotation packages
- Use UniProt ID mapping from within R
- Access NCBI’s Gene database from within R
- Use GFF3 or GTF from Ensembl (Genomes) (see Bulk training)
- Worst case scenario (and substantial effort): use the raw Ensembl (Genomes) databases (see Bulk training)
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 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.