Direct ecitation coefficient fit

This notebook estracts the direct excitation coefficient from the set of 5 us-ALEX smFRET measurements.

What it does?

This notebook performs a weighted average of direct excitation coefficient fitted from each measurement.

Dependencies

This notebooks reads the file:


In [ ]:
data_file = 'results/usALEX-5samples-PR-raw-dir_ex_aa-fit-AexAem.csv'

The data has been generated by running the template notebook usALEX-5samples-PR-raw-dir_ex_aa-fit-AexAem for each sample.

To recompute the PR data used by this notebook run the 8-spots paper analysis notebook.

Computation


In [ ]:
from __future__ import division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format='retina'  # for hi-dpi displays

sns.set_style('whitegrid')
palette = ('Paired', 10)
sns.palplot(sns.color_palette(*palette))
sns.set_palette(*palette)

In [ ]:
data = pd.read_csv(data_file).set_index('sample')
data

In [ ]:
data.columns

In [ ]:
d = data[[c for c in data.columns if c.startswith('dir')]]
d.plot(kind='line', lw=3, title='Direct Excitation Coefficient')
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0., frameon=False);

In [ ]:
dir_ex_aa = np.average(data.dir_ex_S_kde_w5, weights=data.n_bursts_aa)
'%.5f' % dir_ex_aa

Save coefficient to disk


In [ ]:
with open('results/usALEX - direct excitation coefficient dir_ex_aa.csv', 'w') as f:
    f.write('%.5f' % dir_ex_aa)

In [ ]: