Revision | e716cbc21b8d2c7c5e49f401ddb166b65043fe43 (tree) |
---|---|
Zeit | 2010-10-20 21:49:55 |
Autor | lorenzo |
Commiter | lorenzo |
I added a new filter on the tag IDs (useful when dealing with compartimentized
interactions).
@@ -105,6 +105,27 @@ | ||
105 | 105 | |
106 | 106 | return (all_times,tags_abc) |
107 | 107 | |
108 | + | |
109 | +def p_tab_tac_sel(info,selection): | |
110 | + tag_list=s.unique1d(s.ravel(info[:,1:3])) | |
111 | + all_times=s.zeros(0).astype("int64") | |
112 | + tags_abc=s.zeros((0,4)).astype("int64") | |
113 | + | |
114 | + for i in xrange(len(tag_list)): | |
115 | + tag_id=tag_list[i] | |
116 | + | |
117 | + if (tag_id in selection): | |
118 | + | |
119 | + tags_info=single_tag_contact_times(info, tag_id) | |
120 | + | |
121 | + delta_t=tags_info[2] | |
122 | + abc=tags_info[3] | |
123 | + all_times=s.hstack((all_times, delta_t)) | |
124 | + tags_abc=s.vstack((tags_abc, abc)) | |
125 | + | |
126 | + return (all_times,tags_abc) | |
127 | + | |
128 | + | |
108 | 129 | |
109 | 130 | |
110 | 131 | def p_tab_tac_filtered(info): |
@@ -168,8 +189,8 @@ | ||
168 | 189 | |
169 | 190 | #Now I am adding an extra feature (i.e. I am cutting a slice of the data) |
170 | 191 | |
171 | -t_ini=1275283490 | |
172 | -t_fin=1275456290 | |
192 | +t_ini= 1257417888 # 1275283490 | |
193 | +t_fin= 1258104328 # 1275456290 | |
173 | 194 | |
174 | 195 | sel=s.where((info[:,0]>=t_ini) & (info[:,0]<=t_fin) ) |
175 | 196 |
@@ -184,11 +205,18 @@ | ||
184 | 205 | ############################################################################################# |
185 | 206 | # Now iterate on all tags |
186 | 207 | |
187 | -results=p_tab_tac(info) | |
208 | +# results=p_tab_tac(info) | |
188 | 209 | |
189 | 210 | #results=p_tab_tac_filtered(info) |
190 | 211 | |
191 | 212 | |
213 | +sel_p = s.arange(1400,1500) | |
214 | + | |
215 | +sel_else = s.arange(1200,1300) | |
216 | + | |
217 | +results=p_tab_tac_sel(info, sel_else) | |
218 | + | |
219 | + | |
192 | 220 | n.savetxt("delta_tab_tac.dat",results[0] , fmt='%d') |
193 | 221 | |
194 | 222 | n.savetxt("tags_ab_ac.dat",results[1] , fmt='%d') |