Converting Affymetrix (*_At) Mouse Probe Id To Hugo Gene Symbol In R
1
0
Entering edit mode
11.2 years ago
gundalav ▴ 380

I have the following list of probes (from Mouse),

1460644_at
1460645_at
1460646_at
1460647_a_at
1460648_at
1460649_at
1460650_at
1460651_at
1460652_at
1460653_at
1460654_at
1460655_a_at
1460656_a_at
1460657_at
1460658_at
1460659_at
1460660_x_at
1460661_at

The longer list can be found here: http://dpaste.com/1371949/plain/

What I want to do is to convert that name with HUGO gene symbol using R. What's the way to do it?

I tried this but failed

library(biomaRt)
dat<-read.table("http://dpaste.com/1371949/plain/")
probes<-as.vector(as.matrix(dat))
mouse = useMart("ensembl", dataset = "mmusculus_gene_ensembl")
g = getGene( id = probes, type = "affy_mg_u74av2", mart = mouse)
show(g)

It prints Ensembl gene id instead (e.g.ENSMUSG00000057666)

bioconductor gene biomart r • 7.2k views
ADD COMMENT
0
Entering edit mode

Good attempt. You want getBM(), not getGene() - see the answer by Sirus.

ADD REPLY
0
Entering edit mode

Also: HUGO gene symbols are for human genes. So do you want mouse gene symbols? Or the human equivalent of mouse genes?

ADD REPLY
0
Entering edit mode

I want mouse gene symbols.

ADD REPLY
3
Entering edit mode
11.2 years ago
Sirus ▴ 820

I generally do it in this way using the biomarRt package

EnsembleToHGNC<-function(EnsembleIDs, organism="hsapiens_gene_ensembl"){

  require(biomaRt);
  ensemble<-useMart("ensembl");
  hsp<-useDataset(mart=ensemble,dataset=organism);
  ids<-getBM(filters= "ensembl_gene_id",
              attributes= c("ensembl_gene_id","hgnc_id", "hgnc_symbol","description"),
              values= EnsembleIDs, mart= hsp);
  return(ids);
}

Hope it helps :)

ADD COMMENT
0
Entering edit mode

Thanks. How can I modify your code to cater for Mouse instead of human?

ADD REPLY
2
Entering edit mode

As in your own code, use "mmusculus_gene_ensembl". And since you want mouse gene symbols - I assume that is MGI symbols? so omit "hgnc_id", "hgnc_symbol","description" in the attributes and use "mgi_id", "mgi_symbol", "mgi_description" instead.

You can get a data frame of attributes using listAttributes(hsp).

ADD REPLY
1
Entering edit mode

Thanks Neilfws, for the corrections :). Yeah, just as Neilfws said, you change the attributes with the one Neifwd mentioned in the getBM line, and just call it as follow EnsembleToHGNC(ensembleIDs,organism="mmusculus_gene_ensembl"), where ensembleID is a list of your IDs

ADD REPLY

Login before adding your answer.

Traffic: 2623 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6