figuresΒΆ
Auxiliary functions for creating reweighting figures.
FunctionsΒΆ
|
Create a Figure plotting the fraction of effective frames vs the chisquare value, resulting |
|
Create a multiplot Figure showcasing the differences between uniform and reweighted |
|
Create a Figure with probability distribution plots for calculated structural metrics, using |
Module ContentsΒΆ
- ensemblify.reweighting.figures.create_effective_frames_fit_fig(stats, thetas, choices=None, title_text=None, colors=None)ΒΆ
Create a Figure plotting the fraction of effective frames vs the chisquare value, resulting from applying BME using different theta values.
The fraction of effective frames of an ensemble after reweighting is plotted agaisnt the chisquare value of the fitting of the data calculated from the reweighted ensemble to the experimental data. Each data point results from the application of the Bayesian Maximum Entropy (BME) algorithm to the calculated+experimental data using different values for the theta parameter.
- Parameters:
stats (
np.ndarray) βAn array where each row corresponds to a different theta value with columns (chi2_before,chi2_after,phi) where:
- chi2_before:
The value for the chisquare of fitting the ensemble with uniform weights to the experimental data.
- chi2_after:
The value for the chisquare of fitting the reweighted ensemble to the experimental data.
- phi:
The fraction of effective frames being used in the reweighted ensemble.
thetas (
np.ndarray) β Array of values for the theta parameter used when applying BME algorithm.choices (
int | list[int], optional) β Theta value(s) chosen for reweighting ensemble, corresponding data points will be highlighted in the created Figure. Defaults to None.title_text (
str, optional) β Title for the created Figure. Defaults to None.colors (
list[str], optional) β Hexcodes for the colors to use for highlighting theta values. Defaults to [β#E69F00β, β#56B4E9β,β#009E73β,β#F0E442β,β#0072B2β,β#D55E00β,β#CC79A7β].
- Returns:
The created plot, optionally with data points corresponding to highlighted theta values in different colors.
- Return type:
go.Figure
- ensemblify.reweighting.figures.create_rw_saxs_fits_fig(q, i_exp, err, i_prior, i_posts, title_text=None, colors=None)ΒΆ
Create a multiplot Figure showcasing the differences between uniform and reweighted calculated SAXS data, when fit to experimental data.
- Parameters:
q (
np.ndarray) β An array with momentum transfer values, common to all SAXS curves being deal with.i_exp (
np.ndarray) β An array with experimentally measured SAXS intensities.err (
np.ndarray) β An array with the experimental error of the provided experimental SAXS intensities.i_prior (
np.ndarray) β An array of SAXS intensities averaged over all the frames of a SAXS data file calculated from a conformational ensemble with uniform weights.i_posts (
np.ndarray | list[np.ndarray]) β An array or list of arrays of SAXS intensities averaged over all the frames of a SAXS data file calculated from a conformational ensemble with the provided set of weights.title_text (
str, optional) β A title for the created multiplot Figure. Defaults to None.colors (
list[str], optional) β Color to attribute to the plotted prior and posterior traces, in order of input. Defaults to [β#E69F00β, β#56B4E9β,β#009E73β,β#F0E442β,β#0072B2β,β#D55E00β,β#CC79A7β].
- Returns:
- A multiplot Figure containing four plots:
the fitting of i_prior and i_post(s) to the experimental SAXS data i_exp.
the previous plot in log scale.
Kraty plot for i_prior and i_post fitted to experimental data.
residuals between i_prior/i_post(s) and i_exp.
- Return type:
go.Figure
- ensemblify.reweighting.figures.create_reweighting_metrics_fig(metrics, weight_sets, title_text=None, colors=None)ΒΆ
Create a Figure with probability distribution plots for calculated structural metrics, using uniform or unequal weights.
- Parameters:
metrics (
pd.DataFrame) β A DataFrame with the calculated structural metrics, one row per frame in the conformational ensemble.weight_sets (
np.ndarray | list[np.ndarray]) β An array or list of arrays containing the weights for calculating the probability distributions of each structural metric, for each set of weights.title_text (
str, optional) β Title for the created Figure. Defaults to None.colors (
list[str], optional) β Hexcodes for colors to use for the traces relative to each i_post, in order of input. Defaults to [β#E69F00β,β#56B4E9β,β#009E73β,β#F0E442β,β#0072B2β,β#D55E00β,β#CC79A7β].
- Returns:
A Figure plotting the structural metrics distributions for uniformly and unequally weighted conformational ensembles.
- Return type:
go.Figure