cluster

This module provides the ProcessProtein class, which collects and processes Gibbs sampler data.

class cluster.ProcessProtein(niter, prot, cutoff, gskip=100, burnin=10000, taus=None, bars=None)[source]

ProcessProtein is the class that collects and processes Gibbs sampler data. This class collects results for all residues in the basicrta-{cutoff} directory and can write out a \(\tau\) vs resid numpy array or plot \(\tau\) vs resid. If a structure is provided, \(\tau\) will be written as b-factors for visualization.

Parameters:
  • niter (int) – Number of iterations used in the Gibbs samplers

  • prot (str, optional) – Name of protein in tm_dict.txt, used to draw TM bars in \(tau\) vs resid plot.

  • cutoff (float) – Cutoff used in contact analysis.

  • gskip (int) – Gibbs skip parameter for decorrelated samples; only save every gskip samples from full Gibbs sampler chain; default from https://pubs.acs.org/doi/10.1021/acs.jctc.4c01522 When the sampled Markov chain is loaded, then the output is already saved at every Gibbs.g samples. We calculate a new gskip value to get close to the desired gskip value.

  • burnin (int) – Burn-in parameter, drop first burnin samples as equilibration; default from https://pubs.acs.org/doi/10.1021/acs.jctc.4c01522

b_color_structure(structure)[source]

Add \(\tau\) to b-factors in the specified structure. Saves structure with b-factors to tau_bcolored.pdb.

get_taus(nproc=1)[source]

Get \(\tau\) and 95% confidence interval bounds for the slowest process for each residue.

Returns:

Returns a tuple of the form (\(\tau\), [CI lower bound, CI upper bound])

Return type:

tuple

plot_protein(**kwargs)[source]

Plot \(\tau\) vs resid. kwargs are passed to the plot_protein() method of util.py. These can be used to change the labeling cutoff, y-limit of the plot, scale the figure, and set major and minor ticks.

reprocess(nproc=1)[source]

Rerun processing and clustering on Gibbs data.

Parameters:

nproc (int) – Number of processes to use in clustering results for all residues.

write_data(fname='tausout')[source]

Write \(\tau\) values with 95% confidence interval to a numpy file with the format [sel1 resid, \(\tau\), CI lower bound, CI upper bound].

Parameters:

fname (str, optional) – Filename to save data to.

cluster.get_parser()[source]
cluster.main()[source]