Gene ID translation
0
0
Entering edit mode
3.8 years ago
Kira • 0

Hi, I am learning how to convert gene ID to gene name, these are the code that I searched on the net:

  get_map = function(input){
  if(is.character(input)){
  if(!file.exists(input)) stop("Bad input file.")
  message("Treat input as file") 
  input = data.table::fread(input, header = F)
  } else {
  data.table::setDT(input)}
  input = input[input[[3]] == "gene", ]  
  pattern_name = ".*gene_name \"([^;]+)\";.*"
  gene_id = sub(pattern_id, "\\1", input[[9]])
  gene_name = sub(pattern_name, "\\1", input[[9]])

I'm not quite understand the use of the " * " in front of " gene_name", and the whole thing behind it 【 \"([^;]+)\";.*"】

 pattern_name = ".*gene_name \"([^;]+)\";.*"

Is there anyone could please explain to me ?

R GeneID • 769 views
ADD COMMENT
0
Entering edit mode

Hi, you can use Annotationdbi or biomart to convert gene ids to gene symbols. Check the following threads in Biostars.

Ensembl ID to ENTREZ best converter

A: converting mouse emsembl gene IDs to Gene names by bioMart and gconvert with n

ADD REPLY
0
Entering edit mode

Thank you very much = )

ADD REPLY

Login before adding your answer.

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