mode_frequencies = defaultdict(list) modes_p_v = defaultdict(list) ENERGY_LABEL = "$\Delta$ U" RMSD_LABEL = "RMSD" nmd_file_name = {"CC":"normalized_modes.1.nmd", "IC":"normalized_modes_cc.1.nmd"} v1s = [] v2s = [] for (p1,v1),(p2,v2) in pair_parameter_values(experiment_details["check"], experiment_details["parameter_values"]): v1s.append(v1) v2s.append(v2) folder_name = "%s_%s_%s_%s_%s"%(experiment_details["prefix"], experiment_details["parameter_abbv"][p1], parameter_value_to_string(v1), experiment_details["parameter_abbv"][p2], parameter_value_to_string(v2)) if experiment_details["prefix"] == "CC": raw_data, data_len = load_cc_data(os.path.join(workspace, folder_name, options.folder), full_pele_energy = False, skip_first = 15) if experiment_details["prefix"] == "IC": raw_data, data_len = load_ic_data(os.path.join(workspace, folder_name, options.folder), skip_first = 15)
step_granularity = 100 max_samples = 1000 if options.data is None: acceptances = {} rmsf = {} rmsd = {} rmsf_ref = numpy.loadtxt(options.rmsf_ref)[:-1] for dataset in datasets: acceptances[dataset["prefix"]] = {} rmsf[dataset["prefix"]] = {} rmsd[dataset["prefix"]] = {} for T, v1, v2 in dataset["parameters"]: folder_name = "%s_%s_%s_%s_%s" % ( dataset["prefix"], "dispFact", parameter_value_to_string(v1), "rmsg", parameter_value_to_string(v2)) main_folder = "%s_%d" % (dataset["prefix"], T) data_folder = os.path.join(dataset["source_folder"], main_folder, dataset["workspace"], folder_name, "info") print data_folder if dataset["prefix"] == "CC": raw_data, min_len = load_data( data_folder, "perturb_energy_before.log", "final_energy.log", # Energy of the whole step "initial_cc.log", "after_minimization_cc.log",
cutoff_keys = [] for (p1, v1), (p2, v2) in pair_parameter_values( experiment_details["check"], experiment_details["parameter_values"]): for sim_type in ["CC", "IC", "IC_FULL"]: if p1 == "prot": prot_keys.append(v1) cutoff_keys.append(v2) key = (v1, v2) else: prot_keys.append(v2) cutoff_keys.append(v1) key = (v2, v1) folder_name = "%s_%s_%s_%s_%s" % ( prefixes[sim_type], experiment_details["parameter_abbv"][p1], parameter_value_to_string(v1), experiment_details["parameter_abbv"][p2], parameter_value_to_string(v2)) rev_folder_name = "%s_%s_%s_%s_%s" % ( prefixes[sim_type], experiment_details["parameter_abbv"][p2], parameter_value_to_string(v2), experiment_details["parameter_abbv"][p1], parameter_value_to_string(v1)) nmd_file_path = os.path.join(workspace_folder[sim_type], folder_name, "info", nmd_file_name[sim_type]) rev_nmd_file_path = os.path.join(workspace_folder[sim_type], rev_folder_name, "info", nmd_file_name[sim_type])
for p1_key in p1_keys: #Choose all elements with p1 key p1_indices = df[plot_using[0]] == p1_key for p2_key in p2_keys: p2_indices = df[plot_using[1]] == p2_key subdf = df.loc[p1_indices].loc[p2_indices] x, y = subdf.T.loc[average_by[0]].mean(), subdf.T.loc[ average_by[1]].mean() x_err, y_err = subdf.T.loc[average_by[0]].std(), subdf.T.loc[ average_by[1]].std() xs.append(x) ys.append(y) xs_std.append(x_err) ys_std.append(y_err) labels.append("%s %s" % (parameter_value_to_string(p1_key), parameter_value_to_string(p2_key))) plt.scatter(xs, ys, marker='o', c=colors[i], label=plt_labels[folder]) # plt.errorbar(xs, ys, xerr=xs_std, yerr=ys_std, linestyle="None", c = colors[i]) for label, x, y in zip(labels, xs, ys): plt.annotate(label, xy=(x, y), xytext=(5, 5), textcoords='offset points', ha='right', va='bottom', size=6) plt.xlabel(RMSD_LABEL) plt.ylabel(ENERGY_LABEL) lgd = plt.legend() #(loc='upper center', ncol=4) plt.show()