Question: Converting Affymetrix (*_At) Mouse Probe Id To Hugo Gene Symbol In R
0
gravatar for gundalav
5.7 years ago by
gundalav270
La La Land
gundalav270 wrote:

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)

gene R bioconductor biomart • 4.8k views
ADD COMMENTlink modified 5.7 years ago by Sirus770 • written 5.7 years ago by gundalav270

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

ADD REPLYlink written 5.7 years ago by Neilfws48k

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

ADD REPLYlink written 5.7 years ago by Neilfws48k

I want mouse gene symbols.

ADD REPLYlink written 5.7 years ago by gundalav270
3
gravatar for Sirus
5.7 years ago by
Sirus770
Boston/USA
Sirus770 wrote:

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 COMMENTlink written 5.7 years ago by Sirus770

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

ADD REPLYlink written 5.7 years ago by gundalav270
2

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 REPLYlink written 5.7 years ago by Neilfws48k
1

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 REPLYlink written 5.7 years ago by Sirus770
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 2.3.0
Traffic: 697 users visited in the last hour