粳稻參考基因組日本晴主要常用的有兩個版本魄宏,分別為The Rice Annotation Project (RAP)(https://rapdb.dna.affrc.go.jp/index.html)和Rice Genome Annotation Project (RGAP7,MSU)(http://rice.plantbiology.msu.edu/index.shtml)掌逛。分別由兩個團隊進行維護立镶,因此其注釋基因數(shù)量和基因登錄號也不相同壁袄。
RAP格式為“Os-Chr-g-number”,MSU格式為“LOC_Os-Chr-g-number”媚媒。
日常分析數(shù)據(jù)過程中會遇到兩種格式ID相互轉(zhuǎn)換的問題嗜逻。PlantGSEA(http://structuralbiology.cau.edu.cn/PlantGSEA/)提供了非常方便的在線ID轉(zhuǎn)換工具。本文也提供一個腳本來供研究者在無法登陸PlantGSEA網(wǎng)站時方便地完成ID轉(zhuǎn)換缭召。
STEP1:下載文件
ID對應(yīng)文件下載自RAP網(wǎng)站栈顷,請點擊以下鏈接下載:
https://rapdb.dna.affrc.go.jp/download/archive/RAP-MSU_2018-03-29.txt.gz
如果你對Python腳本使用有一些熟悉,那么嵌巷,請使用以下示例腳本完成轉(zhuǎn)換萄凤,如果你有更好的方法或者對腳本有意見,請留言交流搪哪。
腳本示例:MSU to RAP
relation={}
for i in open("RAP-MSU_2018-03-29.txt"):
rap=str(i.split()[0])
msu=str(i.split()[1])
if msu!="None":
if "," in msu:
for a in msu.split(","):
relation[a[0:-2]] = rap
else:
relation[msu[0:-2]] = rap
for j in open("your-id-list-one-gene-per-line.txt"):
id=j.strip()
if id in relation.keys():
print(id,relation[id],sep="\t")
else:
print(id,"None",sep="\t")
腳本示例:RAP to MSU
relation={}
for i in open("RAP-MSU_2018-03-29.txt"):
rap=str(i.split()[0])
msu=str(i.split()[1])
if rap!="None":
relation[rap]=msu
for j in open("your-id-list-one-gene-per-line.txt"):
id=j.strip()
if id in relation.keys():
if "," in relation[id]:
s=relation[id].split(",")
for a in s:
print(id,a,sep="\t")
else:
print(id,relation[id],sep="\t")
else:
print(id,"None",sep="\t")
STEP2:配置環(huán)境
如果你未看明白以上說的是啥靡努,你還想根據(jù)我的方法完成ID轉(zhuǎn)換,請按照以下步驟完成環(huán)境配置:
正確安裝Python3并配置好環(huán)境變量。Python3下載地址為:
https://www.python.org/downloads/
以上示例腳本及示例文件下載鏈接:https://github.com/yuhang5783/MSU_RAP_ID_Converter
STEP3:轉(zhuǎn)換
下載好示例腳本及文件后惑朦,將你想要轉(zhuǎn)換的ID列表(單列)粘貼至your-id-list-one-gene-per-line.txt文件中神年,接著使用cmd+R調(diào)出WIN命令行,輕松完成轉(zhuǎn)換行嗤。
# 轉(zhuǎn)換到你的工作目錄
cd C:\YourPATH\MSU-RAP
# 或者你想轉(zhuǎn)換到其它分區(qū)
cd D:
cd D:\YourPATH\MSU-RAP
# 運行你想轉(zhuǎn)換的類型已日、
# MSU轉(zhuǎn)換到RAP,運行以下命令即可
python msu2rap-converter.py > result.xls
# RAP轉(zhuǎn)換到MSU栅屏,運行以下命令即可
python rap2msu-converter.py > result.xls