<jupyter_start><jupyter_text>Committor AnalysisThe output from the `ops_parallel_committor` script can be used to do all the normal things that we do in a committor analysis. We use the item tagged as `'individual_runs'` to create a `ShootingPointAnalysis`, and we can do ahead and do the analysis.<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import openpathsampling as paths
import pandas as pd
pd.options.display.max_rows = 10
storage = paths.Storage("./committor.nc", 'r')
%%time
runs = storage.tags['individual_runs']
spa = paths.ShootingPointAnalysis.from_individual_runs(runs)<jupyter_output>CPU times: user 13.2 s, sys: 1.37 s, total: 14.5 s
Wall time: 14.6 s<jupyter_text>We'll go ahead and load a few other useful things from storage:<jupyter_code>psi = storage.cvs['psi']
phi = storage.cvs['phi']
C_7eq = storage.volumes['C_7eq']
alpha_R = storage.volumes['alpha_R']<jupyter_output><empty_output><jupyter_text>Now let's see how many times each initial snapshot landed in each state (reporting NaN if none of the trial shots landed there):<jupyter_code>spa.to_pandas()<jupyter_output><empty_output><jupyter_text>To plot histograms in terms of certain values, we need a function that takes a snapshot and returns a float. These CVs return numpy arrays, so we have to turn those into floats.<jupyter_code>psi_float = lambda snap: float(psi(snap))<jupyter_output><empty_output><jupyter_text>Make the histogram and plot it!<jupyter_code>hist1D, bins = spa.committor_histogram(psi_float, alpha_R, bins=20)
bin_widths = [bins[i+1]-bins[i] for i in range(len(bins)-1)]
plt.bar(x=bins[:-1], height=hist1D, width=bin_widths, align='edge')
plt.xlabel("$\psi$")
plt.ylabel("$P_B(x)$");<jupyter_output><empty_output><jupyter_text>We can also make 2D histograms of this information: again, we first need a function that converts a snapshot to a 2-tuple of floats (we'll call this one `ramachandran`), then we feed that to the histogram creator.<jupyter_code>ramachandran = lambda x : (float(phi(x)), float(psi(x)))
hist2D, bins_phi, bins_psi = spa.committor_histogram(ramachandran, alpha_R, bins=20)
plt.pcolor(bins_phi, bins_psi, hist2D.T, cmap="winter")
plt.clim(0.0, 1.0)
plt.xlabel("$\phi$")
plt.ylabel("$\psi$")
plt.colorbar();<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.014486391571553995, 'mean_word_length': 6.858620689655172, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '519583', 'license': 'MIT', 'n_tokens_mistral': 856, 'n_tokens_neox': 794, 'n_words': 231, 'path': 'examples/committor_analysis.ipynb', 'repo_name': 'dwhswenson/ops_parallel_committor', 'size': '2278'}