From 51a3f3b9af0a59edcee6e038d25abe5ca7e848f0 Mon Sep 17 00:00:00 2001 From: preecej Date: Wed, 5 Mar 2014 01:18:28 +0000 Subject: [PATCH] draft of os loc 2 at mapping mashup svn path=/; revision=531 --- .../preecej/python_singletons/map_os_2_at.py | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Personnel/preecej/python_singletons/map_os_2_at.py b/Personnel/preecej/python_singletons/map_os_2_at.py index 931db6e..c0e3d8f 100755 --- a/Personnel/preecej/python_singletons/map_os_2_at.py +++ b/Personnel/preecej/python_singletons/map_os_2_at.py @@ -4,9 +4,26 @@ path = "/home/preecej/Documents/projects/plant_reactome/plant_reactome_site/projection/rice_to_arabidopsis/" -ENS_FILE = open(path + "ensemble_plants_40_ath_to_rice_IRGSP.tab") -RAP_IRGSP_FILE = open(path + "loc_rap_mappings.txt") +dict_ens_ids = {} -for line in ENS_FILE: - print line - +ENS = open(path + "ensemble_plants_40_ath_to_rice_IRGSP.tab") +ENS.readline(); +for line in ENS : + words = line.rstrip().split() + dict_ens_ids[words[2]] = words[0] +ENS.close() + +OS_2_AT_MAP = open(path + "ensembl_ortho_os_2_at.tab",'w') + +RAP_IRGSP = open(path + "loc_rap_mappings.txt") +RAP_IRGSP.readline(); +for line in RAP_IRGSP: + if line.strip() != "" : + words = line.rstrip().split() + rap_id = words[1].upper() + if rap_id in dict_ens_ids and rap_id != "NONE" : + #print dict_ens_ids[rap_id] + "\t" + words[0] + OS_2_AT_MAP.write(words[0] + "\t" + dict_ens_ids[rap_id] + "\n") +RAP_IRGSP.close() + +OS_2_AT_MAP.close() -- 2.34.1