This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ucsc ids conversion

Hello,

I have a list o gene ids from a GENECODE Long non-coding RNA gene annotation file and I want to translate them to UCSC ids. I tried BioMart but it doesn't really work I am not getting the correct format of UCSC id. Do you have another converter to suggest ? or another solution?

Thank you, Anna

ucsc genecode conversion ensamble

I tried BioMart but it doesn't really work

Show us the code even if it didn't work.

I don't really need them .I am just creating a file with long coding RNAs which I am going to use for my project ( TF and lncRNA expression networks). So I already have a file for the TFs and I have to use it as a draft to create the one for lncRNAs. Based on the info you gave me tho, I don't need to keep searching for these IDs

I am super new to this field so sorry for the "silly" question

1 answer

Here's an example script to query data from the mygene.info service:

#!/usr/bin/env python                                                                                                                                                                                                                                                                                                         

import sys
from mygene import MyGeneInfo

mg = MyGeneInfo()

ids = [
    "ENSG00000263726",
    "ENSG00000269044",
    "ENSG00000249849",
    "ENSG00000242770",
    "ENSG00000235356"
]

results = mg.querymany(ids, fields=["symbol,refseq"], species="human", verbose=False)

for res in results:
    q = res['query']
    r = 'NA'
    s = 'NA'
    if 'symbol' in res:
        s = res['symbol']
    if 'refseq' in res:
        r = res['refseq']
    sys.stdout.write('{}\t{}\t{}\n'.format(q, r, s))

To run it:

$ python ./query.py 
ENSG00000263726 NA      NA
ENSG00000269044 NA      AC024075.2
ENSG00000249849 NA      AC138819.1
ENSG00000242770 NA      CD200R1L-AS1
ENSG00000235356 NA      AL592466.1

The example list is just made up of a few randomly picked records from GENCODE's current long non-coding RNA gene annotation dataset, but as you can see, not all of them have HGNC symbols, and none in this list contain RefSeq IDs.

Still, this might be useful for your particular list of IDs, or it may give you an idea of how to query records via this tool, generally.

Thank you so much for the code!!

Log in to answer this question.