<p><code>AnnotationDBi</code> uses <code>AnnotationDb</code> objects which is the virtual base class for all annotation packages. It contain a database connection and is meant to be the parent for a set of classes in the Bioconductor annotation packages. Examples of classes derived from the <code>AnnotationDb</code> object include (but are not limited to): <code>ChipDb</code>, <code>OrgDb</code>, <code>GODb</code>, <code>OrthologyDb</code> and <code>ReactomeDb</code>. The database from one of these classes is used to extract annotations. <code>org.Mm.eg.db</code> belongs to <code>OrgDb</code> class.</p>
<p><a href="https://bioconductor.org/packages/release/data/annotation/html/Mus.musculus.html" rel="nofollow noreferrer"><code>Mus.musculus</code></a>  represents a collection of annotation packages that can be used as a single object. It combines different information about same organisms (Mus musculus) into one place. It also uses <code>org.Mm.eg.db</code> as a dependency. So, both uses same database to extract <code>Gene symbols</code>. That is the reason they are producing same results. There is helpful <a href="https://bioconductor.org/packages/release/bioc/manuals/AnnotationDbi/man/AnnotationDbi.pdf" rel="nofollow noreferrer">documentation</a> available on Bioconductor.</p>

CC BY-SA 4.0
2022-08-18T20:26:46.260Z
2022-08-18T20:26:46.260Z
Nitesh Shriwash
<p>I am interested in the differences between AnnotationDbi/org.Mm.eg.db and biomaRt/Mus.musculus. They yield the same results as seen in the code below.</p>
<pre class="lang-r prettyprint-override"><code>library(edgeR)
library(biomaRt)
library(Mus.musculus)
library(AnnotationDbi)
library(org.Mm.eg.db)

url &lt;- &quot;https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE63310&amp;format=file&quot;
utils::download.file(url, destfile=&quot;GSE63310_RAW.tar&quot;, mode=&quot;wb&quot;) 
utils::untar(&quot;GSE63310_RAW.tar&quot;, exdir = &quot;.&quot;)
files &lt;- c(&quot;GSM1545535_10_6_5_11.txt&quot;, &quot;GSM1545536_9_6_5_11.txt&quot;, &quot;GSM1545538_purep53.txt&quot;,
           &quot;GSM1545539_JMS8-2.txt&quot;, &quot;GSM1545540_JMS8-3.txt&quot;, &quot;GSM1545541_JMS8-4.txt&quot;,
           &quot;GSM1545542_JMS8-5.txt&quot;, &quot;GSM1545544_JMS9-P7c.txt&quot;, &quot;GSM1545545_JMS9-P8c.txt&quot;)
for(i in paste(files, &quot;.gz&quot;, sep=&quot;&quot;))
  R.utils::gunzip(i, overwrite=TRUE)

files &lt;- c(&quot;GSM1545535_10_6_5_11.txt&quot;, &quot;GSM1545536_9_6_5_11.txt&quot;, 
           &quot;GSM1545538_purep53.txt&quot;, &quot;GSM1545539_JMS8-2.txt&quot;, 
           &quot;GSM1545540_JMS8-3.txt&quot;, &quot;GSM1545541_JMS8-4.txt&quot;, 
           &quot;GSM1545542_JMS8-5.txt&quot;, &quot;GSM1545544_JMS9-P7c.txt&quot;, 
           &quot;GSM1545545_JMS9-P8c.txt&quot;)

x &lt;- readDGE(files, columns=c(1,3))
geneid &lt;- rownames(x$counts)

genes &lt;- AnnotationDbi::select(org.Mm.eg.db, keys=geneid, columns=&quot;SYMBOL&quot;, keytype=&quot;ENTREZID&quot;)
dim(genes)
genes2 &lt;- biomaRt::select(Mus.musculus, keys = geneid, columns = c(&quot;SYMBOL&quot;), keytype = &quot;ENTREZID&quot;)
dim(genes2)

</code></pre>
<p><strong>Do they use different databases? Is one preferred or recommended over the other?</strong></p>

<r><differential-expression><edger>
What is the difference between AnnotationDbi/org.Mm.eg.db and biomaRt/Mus.musculus for converting to gene symbols?
# What is the difference between AnnotationDbi/org.Mm.eg.db and biomaRt/Mus.musculus for converting to gene symbols?

(Asked by: username_0 on 2022-05-10)

I am interested in the differences between AnnotationDbi/org.Mm.eg.db and biomaRt/Mus.musculus. They yield the same results as seen in the code below.
library(edgeR)
library(biomaRt)
library(Mus.musculus)
library(AnnotationDbi)
library(org.Mm.eg.db)

url <- "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE63310&format=file"
utils::download.file(url, destfile="GSE63310_RAW.tar", mode="wb") 
utils::untar("GSE63310_RAW.tar", exdir = ".")
files <- c("GSM1545535_10_6_5_11.txt", "GSM1545536_9_6_5_11.txt", "GSM1545538_purep53.txt",
           "GSM1545539_JMS8-2.txt", "GSM1545540_JMS8-3.txt", "GSM1545541_JMS8-4.txt",
           "GSM1545542_JMS8-5.txt", "GSM1545544_JMS9-P7c.txt", "GSM1545545_JMS9-P8c.txt")
for(i in paste(files, ".gz", sep=""))
  R.utils::gunzip(i, overwrite=TRUE)

files <- c("GSM1545535_10_6_5_11.txt", "GSM1545536_9_6_5_11.txt", 
           "GSM1545538_purep53.txt", "GSM1545539_JMS8-2.txt", 
           "GSM1545540_JMS8-3.txt", "GSM1545541_JMS8-4.txt", 
           "GSM1545542_JMS8-5.txt", "GSM1545544_JMS9-P7c.txt", 
           "GSM1545545_JMS9-P8c.txt")

x <- readDGE(files, columns=c(1,3))
geneid <- rownames(x$counts)

genes <- AnnotationDbi::select(org.Mm.eg.db, keys=geneid, columns="SYMBOL", keytype="ENTREZID")
dim(genes)
genes2 <- biomaRt::select(Mus.musculus, keys = geneid, columns = c("SYMBOL"), keytype = "ENTREZID")
dim(genes2)


Do they use different databases? Is one preferred or recommended over the other?

**Tags:** r, differential-expression, edger

---

## 1 answers

### Answer by username_1 on 2022-08-18. Score: 2 | Accepted answer

`AnnotationDBi` uses `AnnotationDb` objects which is the virtual base class for all annotation packages. It contain a database connection and is meant to be the parent for a set of classes in the Bioconductor annotation packages. Examples of classes derived from the `AnnotationDb` object include (but are not limited to): `ChipDb`, `OrgDb`, `GODb`, `OrthologyDb` and `ReactomeDb`. The database from one of these classes is used to extract annotations. `org.Mm.eg.db` belongs to `OrgDb` class.

[`Mus.musculus`](https://bioconductor.org/packages/release/data/annotation/html/Mus.musculus.html) represents a collection of annotation packages that can be used as a single object. It combines different information about same organisms (Mus musculus) into one place. It also uses `org.Mm.eg.db` as a dependency. So, both uses same database to extract `Gene symbols`. That is the reason they are producing same results. There is helpful [documentation](https://bioconductor.org/packages/release/bioc/manuals/AnnotationDbi/man/AnnotationDbi.pdf) available on Bioconductor.


---

