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.
Show us the code even if it didn't work.
which assembly ? give us some examples.
Can you explain a little why you want UCSC IDs? Note that UCSC Ids are not created anymore, UCSC defaults to Gencode IDs now. See the UCSC Genes FAQ: https://genome.ucsc.edu/FAQ/FAQgenes.html#hg19
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