def __init__(self,mat_id = "dist_mat_402" , code_map = {}): self.data = load_sim_mat(mat_id) self.data = self.data / self.data.diagonal() if code_map: self.cm = code_map else: self.cm = get_inv_codes_from_file(pdb_src)
#F = pylab.gcf() #DefaultSize = F.get_size_inches() #F.set_size_inches( (DefaultSize[0]*2, DefaultSize[1]*2) ) pylab.savefig(os.path.join(path , title+".png")) pylab.hold(False) def sequential_items(self): return [(key,self[key]) for key in self.original_keys] def get_freq_dist(matrix , step=0.05): return CustomFreqDist([math.floor(i/step) * step for i in matrix.flatten()]) if __name__ == "__main__": mat_ids = load_hydro_var().keys() for mat_id in mat_ids: mat_id = "%s_dist_mat" %mat_id print mat_id #mat_id = "WILM950103_dist_mat" sim_mat = load_sim_mat(mat_id) dist_mat = sim_mat / sim_mat.diagonal() fd = get_freq_dist(dist_mat,step = 0.02) fd.save_fig(title = mat_id) #fd.tabulate([0.0,0.25,0.5,0.75,1.0]) #pylab.savefig(os.path.join("/home/xiaohan/Desktop/distribution" , "together.png"))