Question: genes in rhesus genome (ref. TxDb.Mmulatta.UCSC.rheMac8.refGene)
0
gravatar for Brian Smith
11 months ago by
Brian Smith120
United States
Brian Smith120 wrote:

Hi,

I was trying to do some comparative analysis between the rhesus and human genes. I seem to get no genes that are common to both species! What am I doing wrong? My code, screen output :

 

=============

library("TxDb.Hsapiens.UCSC.hg38.knownGene")
library("org.Hs.eg.db")

library("TxDb.Mmulatta.UCSC.rheMac8.refGene")
library("org.Mmu.eg.db")


txdb_hg38 <- TxDb.Hsapiens.UCSC.hg38.knownGene
txdb_rh8 <- TxDb.Mmulatta.UCSC.rheMac8.refGene

## All rhesus entrez ids

grgenes <- genes(txdb_rh8)
allrefs <- grgenes$gene_id 
monkey_entrez <- sort(mapIds(org.Mmu.eg.db, keys=allrefs, column="ENTREZID", keytype="REFSEQ", multiVals="filter"))


# homo sapiens entrez ids
grgenes <- genes(txdb_hg38)
human_entrez <- unique(grgenes$gene_id)

> length(monkey_entrez)
[1] 6371
> length(human_entrez)
[1] 24183
> length(intersect(monkey_entrez,human_entrez))
[1] 0
> head(monkey_entrez)
NM_001098400 NM_001105170 NM_001104552 NM_001105171 NM_001105172 NM_001105173 
 "100049578"  "100125558"  "100125559"  "100125560"  "100125562"  "100125563" 
> head(human_entrez)
[1] "1"         "10"        "100"       "1000"      "100009613" "100009676"

 

===========

 

Also, how can I get mapIds to return all matches (and not just 1:1)? I tried all the options for multiVals, but they all return the same number of entrez genes.

org.hs.eg.db org.mmu.eg.db • 180 views
ADD COMMENTlink modified 11 months ago by James W. MacDonald49k • written 11 months ago by Brian Smith120
Answer: genes in rhesus genome (ref. TxDb.Mmulatta.UCSC.rheMac8.refGene)
1
gravatar for James W. MacDonald
11 months ago by
United States
James W. MacDonald49k wrote:

You seem to think that Gene IDs are species agnostic. They are not. A given Gene ID is for a gene found in a particular species.

If you want to map between species, you can use the biomaRt package, particularly the getLDS function.
 

ADD COMMENTlink written 11 months ago by James W. MacDonald49k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 310 users visited in the last hour