def calc_fret_deltas(residues):
    delta_dict = {}

    # --- First, fit Bid data ---
    bid_fit_results = nba.plot_3conf_fits(df_pre, residues, 'Bid', dtype='FRET',
                                          do_plot=False)
    for fr in bid_fit_results:
        # Calculate the difference
        key = (fr.activator, fr.measurement, fr.nbd_site, fr.rep_index)
        delta_fret = np.max(fr.y) - fr.y[-1]
        delta_dict[key] = delta_fret

    # --- Now do Bim ---
    bim_fit_results = nba.plot_3conf_fits(df_pre, residues, 'Bim', dtype='FRET',
                                          do_plot=False)
    for fr in bim_fit_results:
        # Calculate the difference
        key = (fr.activator, fr.measurement, fr.nbd_site, fr.rep_index)
        delta_fret = np.max(fr.y) - fr.y[-1]
        delta_dict[key] = delta_fret

    # Cache the results
    with open('fret_deltas.pck', 'w') as f:
        cPickle.dump(delta_dict, f)

    return delta_dict
Example #2
0
from tbidbaxlipo.plots.nbd_bax_analysis import plot_2conf_fits, plot_3conf_fits
from tbidbaxlipo.plots.bid_bim_fret_nbd_release.preprocess_data \
        import df_pre, df, nbd_residues
from matplotlib import pyplot as plt

plt.ion()
nbd_residues=['184']
fret_fr = plot_2conf_fits(df_pre, nbd_residues, activator='Bim', dtype='FRET',
                replicates=(1, 2, 3))
#plt.show()
nbd_fr = plot_3conf_fits(df_pre, nbd_residues, activator='Bim', dtype='NBD',
                replicates=(1, 2, 3))
#plt.show()

fret_k1 = [fret_fr[i].param_dict['c0_to_c1_k'] for i in range(3)]
nbd_k1 = [nbd_fr[i].param_dict['c0_to_c1_k'] for i in range(3)]


print "FRET", fret_k1
print "NBD", nbd_k1