R_Conversion from ENTREZ ID to OFFICIAL GENE SYMBOL
2
0
Entering edit mode
10.5 years ago
kim ▴ 70

I'm having an issue how to convert data. Actually, I have data file which contains tons of gene sets and genes as follows.

GO.1        GO.2  ...
811           811
1520         3638
3685         3685
8943         5719
10197
...

Here, each column (gene set) contains a list of genes which are annotated on corresponding gene set. The number means ENTREZ ID of specific annotated gene. I'm trying to convert ENTREZ ID to Official gene symbol and then make output file from it. What am I supposed to do for it?

I know there are various ways to convert like this.

library(annotate)
library(org.Hs.eg.db)
lookUp('811','org.Hs.eg','SYMBOL')
$`811`
[1] "CALR"

But, I don't have any idea to read text file and convert data and then write it.

R • 8.9k views
ADD COMMENT
0
Entering edit mode

If reading, converting and writing data is the problem, then you need to learn the basic R skills to do this. Perhaps start with the documentation for R data import/export.

ADD REPLY
1
Entering edit mode
10.5 years ago
raunakms ★ 1.1k

You could simply use the biomaRt Rpackage. There is a user guide available which details out how to use it. It is pretty easy and more comprehensive when you have to convert one id type to the other. Additionally it always queries the latest version of the BioMart library so it is always up-to-date.

ADD COMMENT
0
Entering edit mode
10.5 years ago
Ido Tamir 5.2k

I missed that you know how to translate. You want R IO basics and this is not really the place but:

tab <- read.table("inputfile", sep="\t", as.is=TRUE, header=TRUE, comment="", fill=TRUE)
//hope that its really tab formatted
ids1 <- tab[,1]
ids2 <- tab[,2]

... now the conversion ...

write.table(tab, "outfile", col.names=TRUE, row.names=FALSE, sep="\t", quote=FALSE)

But you should read up on R.

like: https://www.datacamp.com/courses/introduction-to-r

http://tryr.codeschool.com or a nice dead tree

ADD COMMENT

Login before adding your answer.

Traffic: 1725 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