jade.RAbD_BM.recovery_rr_tools.calculate_geometric_means_rr(df, x, y, hue=None)[source]

Example use: rr_data_lengths = calculate_geometric_means_rr(df_all, x=’cdr’, y=’length_rr’, hue=’exp’) rr_data_clusters = calculate_geometric_means_rr(df_all, x=’cdr’, y=’cluster_rr’, hue=’exp’)

jade.RAbD_BM.recovery_rr_tools.calculate_rr_errors(df_all_errors)[source]

Calculates the risk ratio errors for cluster and lengths using propagation error equations calculated for the recovery itself. Which is the same for percent as it would be raw data, as the N cancels out in the equations. http://lectureonline.cl.msu.edu/~mmp/labs/error/e2.htm

jade.RAbD_BM.recovery_rr_tools.calculate_set_errorbars_hist(ax, data, x, y, binomial_distro=True, total_column='total_entries', y_freq_column=None, x_order=None, hue_order=None, hue=None, caps=False, color='k', linewidth=0.75, base_columnwidth=0.8, full=True)[source]

Calculates the standard deviation of the data, sets erorr bars for a histogram. Default base_columnwidth for seaborn plots is .8

Optionally give x_order and/or hue_order for the ordering of the columns. Make sure to pass this while plotting.

Notes:
  1. If Hue is enabled, this base is divided by the number of hue_names for the final width used for plotting.
  2. Caps are the line horizontal lines in the errorbar.
  3. ‘full’ means error bars on both vertical sides of the histogram bar.
Warning:
linewidth of .5 does not show up in all PDFs for all bars.
jade.RAbD_BM.recovery_rr_tools.calculate_set_errorbars_scatter(ax, data, x, y, binomial_distro=False, total_column='total_entries', caps=False, color='k', lw=1.5)[source]

(Untested) - Calculates the standard deviation of the data, sets error bars for a typical scatter plot

jade.RAbD_BM.recovery_rr_tools.calculate_stddev_binomial_distribution2(df, x, y, total_column, y_mean_column, hue=None, percent=True)[source]

Calcuates stddeviations for a binomial distribution. Returns a dataframe of stddevs If percent=True, we dived by the total to normalize the standard deviation. SD of ‘mean’ = SQRT(n*p*q) where p is probability of success and q is probability of failure.

jade.RAbD_BM.recovery_rr_tools.load_precomputed_recoveries(db_path='data/all_recovery_and_risk_ratio_data.db', table='full_data')[source]

Reads recovery data from a database created via script.

rtype: pandas.Dataframe

jade.RAbD_BM.recovery_rr_tools.order_by_row_group(df, column, groups)[source]

Order a dataframe by groups. Return the dataframe. Probably a better way to do this already, but I don’t know what it is.

jade.RAbD_BM.recovery_rr_tools.plot_rr(data, x, y, hue=None, ci=None)[source]
jade.RAbD_BM.recovery_rr_tools.remove_pdb_and_cdr(df, pdbid, cdr)[source]

Removes a particular pdbid and cdr from the db. Returns the new df.

jade.RAbD_BM.recovery_rr_tools.set_errorbars_bar(ax, data, x, y, error_dfs, x_order=None, hue_order=None, hue=None, caps=False, color='k', linewidth=0.75, base_columnwidth=0.8, full=True)[source]

Sets erorr bars for a bar chart.

Default base_columnwidth for seaborn plots is .8

Optionally give x_order and/or hue_order for the ordering of the columns. Make sure to pass this while plotting.

Notes:
  1. If Hue is enabled, this base is divided by the number of hue_names for the final width used for plotting.
  2. Caps are the line horizontal lines in the errorbar.
  3. ‘full’ means error bars on both vertical sides of the histogram bar.
Warning:
linewidth of .5 does not show up in all PDFs for all bars.
jade.RAbD_BM.recovery_rr_tools.set_errorbars_bar_rr(ax, data, x, y, error_dfs, x_order=None, hue_order=None, hue=None, caps=False, color='k', linewidth=0.75, base_columnwidth=0.8, full=True)[source]

Sets erorr bars for a bar chart.

Default base_columnwidth for seaborn plots is .8

Optionally give x_order and/or hue_order for the ordering of the columns. Make sure to pass this while plotting.

Notes:
  1. If Hue is enabled, this base is divided by the number of hue_names for the final width used for plotting.
  2. Caps are the line horizontal lines in the errorbar.
  3. ‘full’ means error bars on both vertical sides of the histogram bar.
Warning:
linewidth of .5 does not show up in all PDFs for all bars.