This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Gene ID translation

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

Thank you very much = )

0 answers

No answers yet.

Log in to answer this question.