Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Performance improvement. Changed dictionary lookup from...
authorpreecej <preecej@localhost>
Tue, 11 Mar 2014 21:09:58 +0000 (21:09 +0000)
committerpreecej <preecej@localhost>
Tue, 11 Mar 2014 21:09:58 +0000 (21:09 +0000)
  if item in dict.keys() :
to...
  if item in dict :

Noticeably faster.

svn path=/; revision=536

Personnel/preecej/python_singletons/map_os_2_at.py

index 1f101cf24beda03239849b245d850ba10d595f85..b7decedbf8a20bbbc660d7683d90912d0e9a443f 100755 (executable)
@@ -61,7 +61,7 @@ def ens_map(input_file, output_file) :
         cols = line.rstrip().split()
         if len(cols) == 5 :
             if int(cols[2]) >= 50 and int(cols[3]) >= 50 and int(cols[4]) == 1 :  # reciprocal identity is >= 50%, high confidence
-                if cols[0] in dict_ens_ids.keys() :
+                if cols[0] in dict_ens_ids :
                     dict_ens_ids[cols[0]].append(cols[1])
                 else :
                     dict_ens_ids[cols[0]] = [cols[1]]
@@ -104,7 +104,7 @@ def inp_map(input_file, output_file) :
         cols = line.rstrip().split()
         os_locus = cols[1].rstrip(".1")
         prj_locus = cols[2].rsplit("_",1)[0].rsplit(".",1)[0] # remove any isoform suffixes
-        if os_locus in dict_inp_ids.keys() :
+        if os_locus in dict_inp_ids :
             dict_inp_ids[os_locus].append(prj_locus)
         else :
             dict_inp_ids[os_locus] = [prj_locus]
@@ -149,7 +149,7 @@ def compare_maps(input_file, output_file) :
         prj_loci = cols[1].split(',')
 
         # build ref_dict
-        if os_locus in ref_dict.keys() :
+        if os_locus in ref_dict :
             ref_dict[os_locus][0].extend(prj_loci) # add ens projected loci in the first list slot
         else :
             ref_dict[os_locus] = [prj_loci, []]
@@ -165,7 +165,7 @@ def compare_maps(input_file, output_file) :
         prj_loci = cols[1].split(',')
 
         # continue build of ref_dict
-        if os_locus in ref_dict.keys() :
+        if os_locus in ref_dict :
             ref_dict[os_locus][1].extend(prj_loci) # put the inp projected loci in the second list slot
         else :
             ref_dict[os_locus] = [[], prj_loci] # create an empty slot for the ens projected loci, put the inp projected loci in the second list slot