准备一个注释文件,格式如下:
Gene ID Associated Gene Name EntrezGene ID
ENSG00000252303 RNU6-280P
ENSG00000281771 Y_RNA
ENSG00000281256 RP11-222G7.2
ENSG00000283272 Clostridiales-1
ENSG00000280864 RP11-654C22.2
ENSG00000280792 RP11-315F22.1
ENSG00000282878 RP11-399E6.1
ENSG00000283276 ABBA01000934.1
ENSG00000281822 RNU1-62P
ENSG00000281384 AC093802.1
ENSG00000280505 RP11-654C22.1
ENSG00000281764 RP11-399E6.2
idD = {}
for line in open("data/GRCh38.idmap"):
lineL = line.strip().split("\t")
ensm_id = lineL[0]
symbol = lineL[1]
idD[ensm_id] = symbol
#--------------------------------
for line in open("data/ensm.id"):
ensm = line.strip()
print(ensm,idD[ensm],sep=": ")
网友评论